인기검색어 문의드려요 채택완료
한글자 단어 즉(배, 콩, 조, 껌)이런한글자는 안나오게 가능할까요
한글자 이상만 출력하고싶습니다.
아래는 인기검색어 사용하는 코드입니다.
고수님들 도움 부탁드립니다.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$date_gap_old = date("Y-m-d", strtotime($date_gap) - ($date_cnt * 86400));
$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";
}
?>
switch ($list[$i][icon]) {
case "up" : echo "
".abs($list[$i][rank_gap]).""; break;case "down" : echo "
".abs($list[$i][rank_gap]).""; break;case "new" : echo "
"; break;case "nogap" : echo "
"; break; } ?>
for ($i=0; $i<$pop_cnt; $i++) { ?>
if (empty($list[$i]['pp_word'])) continue; ?>
} ?>
답변 5개
댓글을 작성하려면 로그인이 필요합니다.
</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">$sql2 = " select pp_word, count(*) as cnt from $g4[popular_table]</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> where <span style="color: rgb(80, 80, 80); font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">length(pp_word) > 1 and </span><span style="font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">pp_date between '$date_gap_old' and '$date_gap'</span></p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> group by pp_word</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> order by cnt desc, pp_word</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> limit 0, 100 ";</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">
이게 안된다면 lib / popular.lib.php 에다가 sql 작성부분에 where 사이에 and 넣고 length(pp_word) > 1 해보세요..
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인