검색어 출력에 관하여 정보
검색어 출력에 관하여본문
전체검색에서 검색을 하면,
"검색결과 모두 2개의 내용이 검색되었습니다. (1/1 페이지)" 라는 문구가 있는데, 제일 앞에 현재 검색중인 검색어를 출력하고 싶습니다.
예를 들면, sir를 검색을 하면,
"sir에 관한 검색결과 모두 2개의 내용이 검색되었습니다. (1/1 페이지)" 이런식으로 현재의 검색어를 맨 앞에 출력하고 싶습니다.
어제 연구를 해봤는데 대체 안되네요..
아래는 검색스킨 소스입니다. 고수님들 봐주십시요.
++++++++++++++++++++++
<div id="search_alist">
<?
if($stx)
{
echo "<p>검색결과 모두 <b>".number_format($total_count)."</b>개의 내용이 검색되었습니다. (<b>".number_format($page)."/".number_format($total_page)."</b> 페이지)</p>";
}
?>
<?
$k=0;
for($idx=$table_index, $k=0; $idx<count($search_table) && $k<$rows; $idx++) {
?>
<div class="line"></div>
<h3><?=$bo_subject[$idx]?>에서 (<?=count($list[$idx])?>)개의 내용이 검색되었습니다.</h3>
<ul>
<?
$comment_href = "";
$data_path = $g4[path]."/data/file/".$search_table[$idx];
$thumb_data_path = $g4[path]."/data/file/$search_table[$idx]/thumb";
for($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++){
//내용에서 html코드가 보이면 주석해제 후 사용***1
$list[$idx][$i][content]=cut_str(strip_tags($list[$idx][$i][wr_content]),300,"...");
$comment_href=$comment=$img=$file_name="";
$list[$idx][$i][subject]=str_replace("<span style='background-color:YELLOW; color:RED;'>","<span class='s_word1'>",$list[$idx][$i][subject]);
//$list[$idx][$i][content]=str_replace("<span style='background-color:YELLOW; color:RED;'>","<span class='s_word2'>",$list[$idx][$i][content]);
//내용에서 html코드가 보이면 주석해제 후 사용***2
$list[$idx][$i][content]=str_replace($stx,"<span class='s_word2'>".$stx."</span>",$list[$idx][$i][content]);
// 가변 파일
$file['file'] = get_file($search_table[$idx], $list[$idx][$i][wr_id]);
$file_name=$file[file][0][file];
$file_reading=$data_path."/".$file_name;
$simg=$thumb_data_path."/s".$file_name;
if($file_name && file_exists($file_reading) && preg_match("/\.jpg|\.gif|\.png|\.bmp|\.jpeg/",strtolower($file_name))){
if(file_exists($simg)) $img=$simg;
else $img=$file_reading;
}
if($list[$idx][$i][wr_is_comment]) {
$comment_href = "#c_".$list[$idx][$i][wr_id];
$comment="[코멘트] ";
}
?>
<li>
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><p class="s_subject"><a href="<?=$list[$idx][$i][href].$comment_href?>"><?=$comment.$list[$idx][$i][subject]?></a> <a href="<?=$list[$idx][$i][href].$comment_href?>" target="_blank9eaecd">[새창]</a></p></td>
</tr>
<tr>
<td><p class="s_content">
<?if($img){?>
<a href="<?=$list[$idx][$i][href]?>"><img src="<?=$img?>" width="90" align="left" class="s_thm"></a>
<?}?>
<?=$list[$idx][$i][file]?><?=$list[$idx][$i][content]?></p></td>
</tr>
</table>
</li>
<?}?>
</ul>
<?}?>
</div>
"검색결과 모두 2개의 내용이 검색되었습니다. (1/1 페이지)" 라는 문구가 있는데, 제일 앞에 현재 검색중인 검색어를 출력하고 싶습니다.
예를 들면, sir를 검색을 하면,
"sir에 관한 검색결과 모두 2개의 내용이 검색되었습니다. (1/1 페이지)" 이런식으로 현재의 검색어를 맨 앞에 출력하고 싶습니다.
어제 연구를 해봤는데 대체 안되네요..
아래는 검색스킨 소스입니다. 고수님들 봐주십시요.
++++++++++++++++++++++
<div id="search_alist">
<?
if($stx)
{
echo "<p>검색결과 모두 <b>".number_format($total_count)."</b>개의 내용이 검색되었습니다. (<b>".number_format($page)."/".number_format($total_page)."</b> 페이지)</p>";
}
?>
<?
$k=0;
for($idx=$table_index, $k=0; $idx<count($search_table) && $k<$rows; $idx++) {
?>
<div class="line"></div>
<h3><?=$bo_subject[$idx]?>에서 (<?=count($list[$idx])?>)개의 내용이 검색되었습니다.</h3>
<ul>
<?
$comment_href = "";
$data_path = $g4[path]."/data/file/".$search_table[$idx];
$thumb_data_path = $g4[path]."/data/file/$search_table[$idx]/thumb";
for($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++){
//내용에서 html코드가 보이면 주석해제 후 사용***1
$list[$idx][$i][content]=cut_str(strip_tags($list[$idx][$i][wr_content]),300,"...");
$comment_href=$comment=$img=$file_name="";
$list[$idx][$i][subject]=str_replace("<span style='background-color:YELLOW; color:RED;'>","<span class='s_word1'>",$list[$idx][$i][subject]);
//$list[$idx][$i][content]=str_replace("<span style='background-color:YELLOW; color:RED;'>","<span class='s_word2'>",$list[$idx][$i][content]);
//내용에서 html코드가 보이면 주석해제 후 사용***2
$list[$idx][$i][content]=str_replace($stx,"<span class='s_word2'>".$stx."</span>",$list[$idx][$i][content]);
// 가변 파일
$file['file'] = get_file($search_table[$idx], $list[$idx][$i][wr_id]);
$file_name=$file[file][0][file];
$file_reading=$data_path."/".$file_name;
$simg=$thumb_data_path."/s".$file_name;
if($file_name && file_exists($file_reading) && preg_match("/\.jpg|\.gif|\.png|\.bmp|\.jpeg/",strtolower($file_name))){
if(file_exists($simg)) $img=$simg;
else $img=$file_reading;
}
if($list[$idx][$i][wr_is_comment]) {
$comment_href = "#c_".$list[$idx][$i][wr_id];
$comment="[코멘트] ";
}
?>
<li>
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><p class="s_subject"><a href="<?=$list[$idx][$i][href].$comment_href?>"><?=$comment.$list[$idx][$i][subject]?></a> <a href="<?=$list[$idx][$i][href].$comment_href?>" target="_blank9eaecd">[새창]</a></p></td>
</tr>
<tr>
<td><p class="s_content">
<?if($img){?>
<a href="<?=$list[$idx][$i][href]?>"><img src="<?=$img?>" width="90" align="left" class="s_thm"></a>
<?}?>
<?=$list[$idx][$i][file]?><?=$list[$idx][$i][content]?></p></td>
</tr>
</table>
</li>
<?}?>
</ul>
<?}?>
</div>
댓글 전체
<p>$stx에 검색결과 모두
$stx를 넣으세요.
$stx를 넣으세요.
댓글 감사합니다...
넣었는데, 출력이 안되네요...ㅜㅜ
넣었는데, 출력이 안되네요...ㅜㅜ
<p>".$stx."에 검색결과 모두
이렇게 해보세요.
이렇게 해보세요.
우아~~~~~~,,,,,,!!
감사합니다..바로 출력이 되네요....^^
감사하고 고맙습니다....
좋은 시간 되세요....
감사합니다..바로 출력이 되네요....^^
감사하고 고맙습니다....
좋은 시간 되세요....