최근 갤러리 불로 오는것중에서요 정보
최근 갤러리 불로 오는것중에서요
본문
이미지 클릭시 링크1번에 적었던 url 주소로 이동하고
제목 클릭시 해당 게시판으로 이동하게 하고 싶은데 어떻게 해야되나요
http://www.dbon.co.kr 에서 메인에 보면 신규 웹사이트라는 부분이 있는데
소스를 잘못 수정했는지 중간정도부터는 이상하게 해당사이트로 안가고 최근에 올렸던
사이트로 이동해버리네요 ~
아래소스는 제가 쓰고 있는 메인 최근게시물 소스입니다
-------------------------------
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
list($height, $row_cnt) = explode(",", $options);
$all_cnt = 0;
?>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<style type="text/css">
<!--
.t1 {
font-family: "돋움", "돋움체";
font-size: 11px;
letter-spacing: -1pt
}
-->
</style>
<table width='95%'>
<? for ($k=0; $k<$row_cnt; $k++ ) { ?>
<tr>
<?
for ($i=0; $i<count($list)/$row_cnt; $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$all_cnt][wr_subject]);
$content = cut_str(get_text($list[$all_cnt][wr_content]), 8);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
if (!file_exists($img) || !$list[$all_cnt][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/link.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
echo <<<HEREDOC
<td width='<?=$subject_len?>' valign='top' align='center'>
<table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='<?=$height?>' align='center'>
<div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #EFEFEF;padding:1px' align='center'>
<a href='$g4[bbs_path]/link.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1' target='_new'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='3' align='center' class="t1"></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center' class="t1"><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$list[$all_cnt][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
$all_cnt++;
}
?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr>
<td height="15" colspan="2" align='center' class="t1">게시물이 없습니다.</td>
</tr>
<? } ?>
</table>
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
list($height, $row_cnt) = explode(",", $options);
$all_cnt = 0;
?>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<style type="text/css">
<!--
.t1 {
font-family: "돋움", "돋움체";
font-size: 11px;
letter-spacing: -1pt
}
-->
</style>
<table width='95%'>
<? for ($k=0; $k<$row_cnt; $k++ ) { ?>
<tr>
<?
for ($i=0; $i<count($list)/$row_cnt; $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$all_cnt][wr_subject]);
$content = cut_str(get_text($list[$all_cnt][wr_content]), 8);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
if (!file_exists($img) || !$list[$all_cnt][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/link.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
echo <<<HEREDOC
<td width='<?=$subject_len?>' valign='top' align='center'>
<table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='<?=$height?>' align='center'>
<div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #EFEFEF;padding:1px' align='center'>
<a href='$g4[bbs_path]/link.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1' target='_new'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='3' align='center' class="t1"></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center' class="t1"><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$list[$all_cnt][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
$all_cnt++;
}
?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr>
<td height="15" colspan="2" align='center' class="t1">게시물이 없습니다.</td>
</tr>
<? } ?>
</table>
댓글 전체
for문이 두개라서 $i 가 반복할때 0 으로 계속 초기화되는것같은데요.
새로운변수를하나만들어서 카운트시켜주시면될것같아요.
예로
$l 이라는변수를 사용한다고하면
for ($i=0; $i<count($list)/$row_cnt; $i++) {
$href = "$g4[bbs_path]/link.php?bo_table=$bo_table&wr_id={$list[$l][wr_id]}&no=1";
$l++;
}
이런식으로하면되것같아요;;
새로운변수를하나만들어서 카운트시켜주시면될것같아요.
예로
$l 이라는변수를 사용한다고하면
for ($i=0; $i<count($list)/$row_cnt; $i++) {
$href = "$g4[bbs_path]/link.php?bo_table=$bo_table&wr_id={$list[$l][wr_id]}&no=1";
$l++;
}
이런식으로하면되것같아요;;
이 부분을 어떻게 삽입해줘야되나요