인기검색어 문의드려요

인기검색어 문의드려요

QA

인기검색어 문의드려요

본문

 

 

한글자 단어 즉(배, 콩, 조, 껌)이런한글자는 안나오게 가능할까요 

한글자 이상만 출력하고싶습니다. 

 

아래는 인기검색어 사용하는 코드입니다.

고수님들 도움 부탁드립니다.

 

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";

}

 

?>

 

<link rel="stylesheet" type="text/css" href="<?=$popular_skin_path?>/style.css" />

<div id="popular3">

   <div class="inner">

   <div align="center"  class="subject">인기검색어</div>

   <ol>

     <? for ($i=0; $i<$pop_cnt; $i++) { ?>

     <? if (empty($list[$i]['pp_word'])) continue; ?>

      <li>

         <div class="word t<?=sprintf("%02d", $i+1)?>"><a href="<?=$g4['path']?>/search.php?keyword=<?=urlencode($list[$i][pp_word])?>"><?=$list[$i][pp_word]?></a></div>

         <div class="gap">

         <? switch ($list[$i][icon]) {

            case "up"    : echo "<img src='{$popular_skin_path}/img/up.gif' alt='Up' class='absmiddle' />".abs($list[$i][rank_gap]).""; break;

            case "down"  : echo "<img src='{$popular_skin_path}/img/down.gif' alt='Down' class='absmiddle' />".abs($list[$i][rank_gap]).""; break;

            case "new"   : echo "<img src='{$popular_skin_path}/img/new.gif' alt='New' class='absmiddle' />"; break;

            case "nogap" : echo "<img src='{$popular_skin_path}/img/nogap.gif' alt='Nogap' class='absmiddle' />"; break; } ?></div>

      </li>

     <? } ?>

   </ol>

   </div>

</div>

이 질문에 댓글 쓰기 :

답변 5


$sql2 = " select pp_word, count(*) as cnt from $g4[popular_table]
	  where length(pp_word) > 1 and pp_date between '$date_gap_old' and '$date_gap'
	  group by pp_word
	  order by cnt desc, pp_word
	  limit 0, 100 ";

 

이게 안된다면 lib / popular.lib.php 에다가 sql 작성부분에 where 사이에 and 넣고 length(pp_word) > 1 해보세요..

답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT