3만원에 작성된 연관 검색어 무료로 뿌립니다. 정보
3만원에 작성된 연관 검색어 무료로 뿌립니다.본문
전 아미나 LTE BSE 사용중입니다.
아미나에 맞게 짜여져 있습니다. 다른 빌더에서 가능한지는 모르겠습니다만 한번 시도해 보세요.
그리고 적당히 바꿔서 보이게 하면 될 것 같습니다.
lib/common.lib.php
적당한 곳에
function get_same_keyword($word){
$return_data = "";
$sql = "select pp_word, count(*) as cnt from g5_popular where pp_word like '%$word%' group by pp_word order by cnt desc limit 20 ";
$sql_result = sql_query($sql);
//ul 및 li에 class추가해서 사용할 것
$return_data = "<b>연관 검색어 : </b>";
while($data = sql_fetch_array($sql_result)){
$return_data .= "<a href='".G5_BBS_URL."/search.php?stx=".urlencode($data[pp_word])."'>$data[pp_word]</a> ";
}
$return_data .= "";
return $return_data;
}
아래는 뿌리고 싶은 페이지에 넣어주면 됩니다. 전 스킨 안에 검색 스킨 안에 넣었습니다.
<div class="search-box">
<?php echo get_same_keyword($text_stx); ?><br style="display: block; margin: 8px 0;">
</div>
위 스크립트 더 잘 수정할 수 있는 분이 계시면 수정 부탁드립니다. 제 머리로는 여기까지 인데요.....
추천 누르는거 잊지 마시구요. 그럼...
8
댓글 13개
그렇지 않을경우 php 7.2 에서 오류가 발생합니다.
function get_same_keyword($word){
$return_data = "";
$sql = "select pp_word, count(*) as cnt from g5_popular where pp_word like '%{$word}%' group by pp_word order by cnt desc limit 20 ";
$sql_result = sql_query($sql);
//ul 및 li에 class추가해서 사용할 것
$return_data = "<b>연관 검색어 : </b>";
while($data = sql_fetch_array($sql_result)){
$return_data .= "<a href='".G5_BBS_URL."/search.php?stx=".urlencode($data['pp_word'])."'>{$data['pp_word']}</a> ";
}
$return_data .= "";
return $return_data;
}
일단 추천요^^