테스트 사이트 - 개발 중인 베타 버전입니다

게시판이 안나와요 채택완료

대한사랑 6년 전 조회 3,894

코드 어디가 오류인가요?

고수님들 부탁드립니다

 

 echo "[{$list[$m][$n][bo_subject]}] ";

댓글을 작성하려면 로그인이 필요합니다.

답변 4개

채택된 답변
+20 포인트
s
sinbi Expert
6년 전

위 구문에 들어간 낱개 상수 변수들이 제대로 찍히는지부터 먼저 확인해 보세요.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

대한사랑
6년 전
제가 초보라 잘 몰라서요

소스코드입니다

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$group_latest_skin_url.'/style.css">', 0);
?>

<!-- <?php echo $bo_subject; ?> 최신글 시작 { -->
<div style="height:106px" class="tab_list m1">
<ul>
<?
for($m=0; $m<count($gr_id); $m++) {
$num = $m+1;
?>
<li class="m<?=$num?>">
<a jquery16408452460570924265="<?=$num?>">
<span><?=$gr[$m][gr_subject]?></span>
</a>
<ul>
<?
$empty_row = $rows - count($list[$m]);

for($n=0; $n<count($list[$m]); $n++) {
echo "<li>";
echo "<a class=\"board\" href=\"".G5_BBS_URL."/board.php?bo_table={$bo_table}\">[{$list[$m][$n][bo_subject]}] </a>";
echo "<a href=\"{$list[$m][$n]['href']}\">{$list[$m][$n][subject]}</a>";
if ($list[$m][$n]['comment_cnt'])
echo " <a class=\"commnet\" href=\"{$list[$m][$n]['comment_href']}\">{$list[$m][$n]['comment_cnt']}</a>";
echo "<span class=\"datetime\">{$list[$m][$n][datetime2]}</span>";

//echo date("Y-m-d H:i:s", G5_SERVER_TIME - ($board['bo_new'] * 3600));
//echo $list[$m][$n]['wr_datetime'];

$list[$m][$n]['icon_new'] = '';
if ($list[$m][$n]['wr_datetime'] >= date("Y-m-d H:i:s", G5_SERVER_TIME - ($board['bo_new'] * 3600)))
$list[$m][$n]['icon_new'] = '<img src="'.$group_latest_skin_url.'/img/icon_new.gif" alt="새글">';



$list[$m][$n]['icon_link'] = '';
if ($list[$m][$n]['wr_link1'] || $list[$m][$n]['wr_link2'])
$list[$m][$n]['icon_link'] = '<img src="'.$group_latest_skin_url.'/img/icon_link.gif" alt="관련링크">';

if ($list[$m][$n]['file']['count'])
$list[$m][$n]['icon_file'] = '<img src="'.$group_latest_skin_url.'/img/icon_file.gif" alt="첨부파일">';

$list[$m][$n]['icon_hot'] = '';
if ($board['bo_hot'] && $list[$m][$n]['wr_hit'] >= $board[$m][$n]['bo_hot'])
$list[$m][$n]['icon_hot'] = '<img src="'.$group_latest_skin_url.'/img/icon_hot.gif" alt="인기글">';

$list[$m][$n]['icon_secret'] = '';
if (strstr($list[$m][$n]['wr_option'], 'secret'))
$list[$m][$n]['icon_secret'] = '<img src="'.$group_latest_skin_url.'/img/icon_secret.gif" alt="비밀글">';


//if (isset($list[$m][$n]['icon_new'])) echo " " . $list[$m][$n]['icon_new'];
echo " " . $list[$i][$n]['icon_new'];
echo " " . $list[$m][$n]['icon_file'];
echo " " . $list[$m][$n]['icon_link'];
echo " " . $list[$m][$n]['icon_hot'];
echo " " . $list[$m][$n]['icon_secret'];

echo "</li>";
}


/*/echo $list[$i]['icon_reply']." ";
echo "<a href=\"".$list[$i]['href']."\">";
if ($list[$i]['is_notice'])
echo "<strong>".$list[$i]['subject']."</strong>";
else
echo $list[$i]['subject'];

if ($list[$i]['comment_cnt'])
echo $list[$i]['comment_cnt'];

echo "</a>";

// if ($list[$m][$n]['link']['count']) { echo "[{$list[$m][$n]['link']['count']}]"; }
// if ($list[$m][$n]['file']['count']) { echo "<{$list[$m][$n]['file']['count']}>"; }

if (isset($list[$m][$n]['icon_new'])) echo " " . $list[$m][$n]['icon_new'];
if (isset($list[$m][$n]['icon_hot'])) echo " " . $list[$m][$n]['icon_hot'];
if (isset($list[$m][$n]['icon_file'])) echo " " . $list[$m][$n]['icon_file'];
if (isset($list[$m][$n]['icon_link'])) echo " " . $list[$m][$n]['icon_link'];
if (isset($list[$m][$n]['icon_secret'])) echo " " . $list[$m][$n]['icon_secret'];
*/

for($l=0; $l<$empty_row; $l++) {
echo "<li> <a href='#'>".$gr[$m][gr_subject]."탭의 최신글이 더 없습니다.</a></li>";
}
?>
<li class="more"> <a href="<?php echo G5_BBS_URL?>/group.php?gr_id=<?=$gr_id[$m]?>">더보기</a>
</li>
</ul>
</li>
<? } ?>
</ul>
</div>

<script type="text/javascript">
jQuery(function($){
var tab = $('.tab_list');
tab.removeClass('js_off');
tab.css('height', tab.find('>ul>li>ul:visible').height()+40);
function onSelectTab(){
var t = $(this);
var myClass = t.parent('li').attr('class');
t.parents('.tab_list:first').attr('class', 'tab_list '+myClass);
tab.css('height', t.next('ul').height()+40);
}
tab.find('>ul>li>a').click(onSelectTab).focus(onSelectTab);
});
</script>
s
sinbi
6년 전
이렇게 코드 올려주셔도값을 찍어볼 수가 없어 저는 확인할 수가.....

저 같은 경우, 위 코드가 작동 안 될 때....

echo G5_BBS_URL;

echo $bo_table;

echo $list[$m][$n]['bo_subject'];

이런 식으로 낱개변수값이 먼저 잘 되는지부터 확인합니다.

댓글을 작성하려면 로그인이 필요합니다.

s
sinbi Expert
6년 전

echo "[{$list[$m][$n]['bo_subject']}]";

 

요거 되나 해보세용.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

대한사랑
6년 전
존재하지 않는 게시판이라 뜹니다

댓글을 작성하려면 로그인이 필요합니다.

플라이
6년 전

변수는 {} 감싸면 되는데 {[]} 이런식으로 중간에 [] 를 넣어두셨네요

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

6년 전

 echo "[{$list[$m][$n][bo_subject]}] ";

로 해보세요 $bo_table에 []는 필요 없어보이네요

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

대한사랑
6년 전
존재하지 않는 게시판이라 뜹니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인