y

최근 갤러리 불로 오는것중에서요

 
이미지 클릭시  링크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>&nbsp;</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>
|

댓글 2개

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++;
}

이런식으로하면되것같아요;;
이 부분을 어떻게 삽입해줘야되나요
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 1,443
18년 전 조회 1,516
18년 전 조회 1,571
18년 전 조회 1,508
18년 전 조회 1,529
18년 전 조회 1,559
18년 전 조회 1,527
18년 전 조회 1,504
18년 전 조회 1,633
18년 전 조회 1,513
18년 전 조회 1,561
18년 전 조회 1,602
18년 전 조회 1,353
18년 전 조회 1,543
18년 전 조회 1,203
18년 전 조회 1,511
18년 전 조회 1,841
18년 전 조회 1,510
18년 전 조회 1,563
18년 전 조회 2,265
🐛 버그신고