검색어 순위 출력 기간 조정에 관하여 채택완료
최근 검색어 순위 스킨을 쓰고 있는데요. 약 일주일이 지나면 첨부한 이미지처럼
검색어가 공백으로 나타납니다. 기간 설정은 어떻게 하는지 모르겠네요. 아래 관련 스킨입니다.
$date_cnt * 172800 <-이것이 기간을 조정하는 것인가 해서 두배로 했거등요. 그런데도 소용 없습니다.
원래는 $date_cnt * 86400인걸 두배로 했습니다만,,,,
어디를 조정해야 하는지요...고수님 부탁드립니다.ㅜㅜ
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$date_gap_old = date("Y-m-d", strtotime($date_gap) - ($date_cnt * 172800));
$old = array(); $sql2 = " select pp_word, count(*) as cnt from $g4[popular_table] where pp_date between '$date_gap_old' and '$date_gap' group by pp_word order by cnt desc, pp_word limit 0, 100 "; $qry2 = sql_query($sql2); $count = mysql_num_rows($qry2); for ($j=0; $row2=sql_fetch_array($qry2); $j++) { $old[$j] = $row2; }
for ($i=0; $i<$pop_cnt; $i++) { for ($j=0; $j<$count; $j++) { if ($old[$j][pp_word] == $list[$i][pp_word]) { break; } }
$list[$i][pp_word] = urldecode($list[$i][pp_word]); $list[$i][pp_rank] = $i + 1; if ($count == $j) { $list[$i][old_pp_rank] = 0; $list[$i][rank_gap] = 0; } else { $list[$i][old_pp_rank] = $j + 1; $list[$i][rank_gap] = $list[$i][old_pp_rank] - $list[$i][pp_rank]; } if ($list[$i][rank_gap] > 0) $list[$i][icon] = "up"; else if ($list[$i][rank_gap] < 0) $list[$i][icon] = "down"; else if ($list[$i][old_pp_rank] == 0) $list[$i][icon] = "new"; else if ($list[$i][rank_gap] == 0) $list[$i][icon] = "nogap"; }
?>
|
|
답변 2개
제가 소스파악을 못하는건지.... 위의 쿼리문은 카운트만 뽑아오는거 아닌가요??? pp_word검색만하고 쓰는데는 없는거같은데요...
pp_date사이에있는 것들중 pp_word를 그룹바이 기준으로 뽑고나서 나온 pp_word와 갯수를 세기만하지 $list[$i]에 들어가는 글들의 갯수가 안보이네요...
그렇다고 sql2에 있는 쿼리문이 최근검색어순위 리스트를 뽑아주는데 사용되는것도 아니고요...
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
알기쉽게 알려 주시면 도움이 되겠습니다만......ㅎㅎ
답변다운 답변을 주시기 바랍니다..ㅎㅎㅎ