제목을 link_1 로 링크를 걸려면
본문
제목을 link_1 로 링크를 걸려면
----------------------------------------------------------------------------------------------------------
if($bo_table){ //각 게시판 출력
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
$bo_subject = get_text($board['bo_subject']);
$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql_between = " wr_datetime between '$term_time' and '".G5_TIME_YMDHIS."' ";
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 and {$sql_between} order by {$options} limit 0, {$rows} ";
$result = sql_query($sql);
// echo "11";
// echo $sql;
for ($i=0; $row = sql_fetch_array($result); $i++) {
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
}
}else{ //전체 게시판 출력
$sql_between = " a.bn_datetime between '$term_time' and '".G5_TIME_YMDHIS."' ";
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b where a.bo_table = b.bo_table and b.bo_use_search = 1 and a.wr_id = a.wr_parent and {$sql_between} ";
$sql_order = " order by a.bn_datetime desc ";
//echo "22";
//echo $sql;
$sql = " select a.*, count(b.bo_subject) as cnt {$sql_common} {$sql_order} limit 0, {$rows} ";
$row = sql_fetch($sql);
if($row[cnt] > 0){
$sql = " select a.*, b.bo_subject {$sql_common} {$sql_order} limit 0, {$rows} ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++){
$tmp_write_table = $g5['write_prefix'].$row['bo_table'];
$bo_table = $row['bo_table'];
if($i > 0)
$sql2 .= " union ";
$sql2 .= "(select '{$bo_table}' as bo_table, wr_id, wr_subject, wr_hit, wr_good from {$tmp_write_table} where wr_datetime between '{$term_time}' and '".G5_TIME_YMDHIS."') ";
}
$sql2 .= " order by ".$options." limit 0, 10";
$result2 = sql_query($sql2);
for ($i=0; $row2 = sql_fetch_array($result2); $i++){
$list[$i]['href'] = G5_BBS_URL.'/board.php?bo_table='.$row2['bo_table'].'&wr_id='.$row2['wr_id'];
$list[$i]['subject'] = $row2['wr_subject'];
}
}
}
ob_start();
?>
<style type=text/css>
.lt_full {position:relative;float:left;padding-bottom:10px;width:100%;height:135px;border-bottom:1px solid #e9e9e9}
.lt2 {position:relative;float:left;padding-bottom:10px;width:354px;}
.lt2 ul {margin:0 0 0 0;padding:0;list-style:none}
.lt2 li {padding:0}
</style>
<div class="lt_full">
<div class="lt2">
<ul>
<?php for ($i=0; $i<count($list); $i++) { ?>
<li>
<?php
echo "<a href=\"".$list[$i]['href']."\">";
echo "<img src='".G5_URL."/img/num_".($i+1).".gif'> ";
echo "<strong>".$list[$i]['subject']."</strong>";
if ($list[$i]['comment_cnt'])
echo $list[$i]['comment_cnt'];
echo "</a>";
?>
</li>
------------------------------------------------------------------------------------
다음중 어디를 수정해야 할까요?
답변 1
이것은 목록에서 사용되는 링크 입니다.
$list[$i]['href'] = G5_BBS_URL.'/board.php?bo_table='.$row2['bo_table'].'&wr_id='.$row2['wr_id'];
<a href="<?php echo $view[wr_link1];?>">
위의 경우는 읽기 페이지에서 링크 이고
<a href="<?php echo $list[$i][wr_link1];?>">
이것은 목록에서 경우 입니다.