검색어 순위를 1,2.3위까지만 보이게 하기 정보
검색어 순위를 1,2.3위까지만 보이게 하기본문
초짜라 인기 검색어에서 검색어 순위를 1,2.3위 까지만 보이게 하고 싶은데
어디를 손대야 할지를 모르겟네요.
도와주세요 ....
댓글 전체
해보진 않았지만..
인기검색어 스킨 상단<? ?> 구문안에..
$list = 3;
이라고 넣어보세요.
인기검색어 스킨 상단<? ?> 구문안에..
$list = 3;
이라고 넣어보세요.
$list = 3; 해보니 리스트가 전혀 안뜨는데요..
아~~
소스 수정하지 마시고...
불러올때..
<?=popular('basic', 3);?> 하셔도 되겠네요.
인기게시물은 제가 잘안써서 정확히 몰랐네요. 번거롭게 해드려서 죄송합니다.
소스 수정하지 마시고...
불러올때..
<?=popular('basic', 3);?> 하셔도 되겠네요.
인기게시물은 제가 잘안써서 정확히 몰랐네요. 번거롭게 해드려서 죄송합니다.
아참.. 인기검색어 1위부터 차례대로 나열되는 팁은 적용하셨는지요???
http://sir.co.kr/bbs/tb.php/g4_skin/8811
하지 않으셨다면.. 참고하시고 수정하세요.
http://sir.co.kr/bbs/tb.php/g4_skin/8811
하지 않으셨다면.. 참고하시고 수정하세요.
단순히 기본 인기검색어스킨에서 검색어 3개를 뽑아오고자 한다면...
그누보드/lib/popular.lib.php...
.......................................................................................
if (!defined('_GNUBOARD_')) exit;
// 인기검색어 출력
// $skin_dir : 스킨 디렉토리
// $pop_cnt : 검색어 몇개
// $date_cnt : 몇일 동안
function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
{
global $config, $g4;
if (!$skin_dir) $skin_dir = 'basic';
$date_gap = date("Y-m-d", $g4[server_time] - ($date_cnt * 86400));
$sql = " select pp_word, count(*) as cnt from $g4[popular_table]
where pp_date between '$date_gap' and '$g4[time_ymd]'
group by pp_word
order by cnt desc, pp_word
limit 0, $pop_cnt ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
// 스크립트등의 실행금지
$list[$i][pp_word] = get_text($list[$i][pp_word]);
}
ob_start();
$popular_skin_path = "$g4[path]/skin/popular/$skin_dir";
include_once ("$popular_skin_path/popular.skin.php");
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
.......................................................................................
의 8번째라인인...
.......................................................................................
function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
.......................................................................................
의 $pop_cnt=7을 $pop_cnt=3...
하시면 될성싶네요....
참고로...
$date_cnt=3은 3일간 입력된 검색어에서 뽑아온다는 뜻...
그누보드/lib/popular.lib.php...
.......................................................................................
if (!defined('_GNUBOARD_')) exit;
// 인기검색어 출력
// $skin_dir : 스킨 디렉토리
// $pop_cnt : 검색어 몇개
// $date_cnt : 몇일 동안
function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
{
global $config, $g4;
if (!$skin_dir) $skin_dir = 'basic';
$date_gap = date("Y-m-d", $g4[server_time] - ($date_cnt * 86400));
$sql = " select pp_word, count(*) as cnt from $g4[popular_table]
where pp_date between '$date_gap' and '$g4[time_ymd]'
group by pp_word
order by cnt desc, pp_word
limit 0, $pop_cnt ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
// 스크립트등의 실행금지
$list[$i][pp_word] = get_text($list[$i][pp_word]);
}
ob_start();
$popular_skin_path = "$g4[path]/skin/popular/$skin_dir";
include_once ("$popular_skin_path/popular.skin.php");
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
.......................................................................................
의 8번째라인인...
.......................................................................................
function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
.......................................................................................
의 $pop_cnt=7을 $pop_cnt=3...
하시면 될성싶네요....
참고로...
$date_cnt=3은 3일간 입력된 검색어에서 뽑아온다는 뜻...
기본으로 인기검색어가 출력될 자리에 아래처럼 해주면 3개만 가져 옵니다.
<?=popular(basic, 3, 3);?>
설명
<?=popular(스킨명, 출력할갯수, 날짜);?>
<?=popular(basic, 3, 3);?>
설명
<?=popular(스킨명, 출력할갯수, 날짜);?>
감사합니다. 해결되었습니다