최신글 클릭시 게시판 본문으로 이동하는 법을 알고싶습니다.
안녕하세요.
메인에 최신글 불러오기는 했는데 제목을 클릭했을 때 게시판 본문 페이지로 넘어가게 하고싶습니다.
a href 주소를 변경해야하는 것 같은데 어떻게 수정해야할 지 모르겠어서요
링크 클릭하면 메인으로 연결됩니다.
도움 부탁드립니다!
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=25><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td></tr>
<tr><td bgcolor=#EBEBEB height=1></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
답변 1개 / 댓글 2개
올려두신 소스에서는 게시판 본문으로 가게끔 되어 있습니다.
echo "<a href='{$list[$i]['href']}'>";
답변에 대한 댓글 2개
$list[$i][href] 에는 각 최근게시물의 실제 게시물 보기페이지 링크주소값이 담겨있습니다.
그러므로 링크가 클릭되면 당연히 해당 게시물보기페이지로 이동됩니다. 위에 적어주신 소스에는 그렇게 반영되어 있구요.
답변을 작성하려면 로그인이 필요합니다.
홈페이지 메인에서 내용이 보여서요ㅜㅜ