전체 검색 결과 내용 표시 출력 코드 수정

This commit is contained in:
chicpro
2014-05-30 11:27:16 +09:00
parent adbc1eace3
commit 14db33addb
2 changed files with 16 additions and 10 deletions

View File

@ -120,7 +120,7 @@ if ($stx) {
$sql = " select wr_id from {$tmp_write_table} where {$sql_search} ";
$result = sql_query($sql, false);
$row[cnt] = @mysql_num_rows($result);
$row['cnt'] = @mysql_num_rows($result);
$total_count += $row['cnt'];
if ($row['cnt']) {
@ -168,7 +168,7 @@ if ($stx) {
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 검색어까지 링크되면 게시판 부하가 일어남
$list[$idx][$i] = $row;
$list[$idx][$i][href] = './board.php?bo_table='.$search_table[$idx].'&wr_id='.$row['wr_parent'];
$list[$idx][$i]['href'] = './board.php?bo_table='.$search_table[$idx].'&wr_id='.$row['wr_parent'];
if ($row['wr_is_comment'])
{
@ -189,7 +189,13 @@ if ($stx) {
if ($read_level[$idx] <= $member['mb_level'])
{
$content = cut_str(get_text(strip_tags($row['wr_content'])),300,"");
//$content = cut_str(get_text(strip_tags($row['wr_content'])), 300, "…");
$content = strip_tags($row['wr_content']);
$content = get_text($content, 1);
$content = strip_tags($content);
$content = str_replace('&nbsp;', '', $content);
$content = cut_str($content, 300, "");
if (strstr($sfl, 'wr_content'))
$content = search_font($stx, $content);
}

View File

@ -109,19 +109,19 @@ add_stylesheet('<link rel="stylesheet" href="'.$search_skin_url.'/style.css">',
<ul>
<?php
for ($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++) {
if ($list[$idx][$i][wr_is_comment])
if ($list[$idx][$i]['wr_is_comment'])
{
$comment_def = "<span class=\"cmt_def\">댓글 | </span>";
$comment_href = "#c_".$list[$idx][$i][wr_id];
$comment_href = "#c_".$list[$idx][$i]['wr_id'];
}
?>
<li>
<a href="<?php echo $list[$idx][$i][href] ?><?php echo $comment_href ?>" class="sch_res_title"><?php echo $comment_def ?><?php echo $list[$idx][$i][subject] ?></a>
<a href="<?php echo $list[$idx][$i][href] ?><?php echo $comment_href ?>" target="_blank">새창</a>
<p><?php echo $list[$idx][$i][content] ?></p>
<?php echo $list[$idx][$i][name] ?>
<span class="sch_datetime"><?php echo $list[$idx][$i][wr_datetime] ?></span>
<a href="<?php echo $list[$idx][$i]['href'] ?><?php echo $comment_href ?>" class="sch_res_title"><?php echo $comment_def ?><?php echo $list[$idx][$i]['subject'] ?></a>
<a href="<?php echo $list[$idx][$i]['href'] ?><?php echo $comment_href ?>" target="_blank">새창</a>
<p><?php echo $list[$idx][$i]['content'] ?></p>
<?php echo $list[$idx][$i]['name'] ?>
<span class="sch_datetime"><?php echo $list[$idx][$i]['wr_datetime'] ?></span>
</li>
<?php } ?>
</ul>