그누보드의 오류가 아닌가요?TT;;; 왜 잘되다가...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "DESIGN");
$html_title = "그누보드3";
?>
<!-- 연재 -->
<table width=100% cellpadding=0 cellspacing=0>
<tr><td height=1 background='./bbs/line.gif'></td></tr>
<tr class='subject subjectbg ht'><td colspan=2> 연재</td></tr>
<tr><td height=1 background='./bbs/line.gif'></td></tr>
<?
$max_i = 7; // 출력갯수
$wtime = date("Y-m-d H:i:s", time()-86400*14);
$arr_series = array("freeboard", "notice", "hangsa", "lastest");
for ($i=0; $i<count($arr_series); $i++) {
$sql = " select wr_id, wr_subject, wr_datetime, wr_commentcnt from $cfg[write_table_prefix]{$arr_series[$i]} where wr_comment = 0 and wr_datetime > '$wtime' ";
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
$aseries[$row[wr_datetime].$arr_series[$i]][table] = $arr_series[$i];
$aseries[$row[wr_datetime].$arr_series[$i]][datetime] = $row[wr_datetime];
$aseries[$row[wr_datetime].$arr_series[$i]][id] = $row[wr_id];
$aseries[$row[wr_datetime].$arr_series[$i]][subject] = $row[wr_subject];
$aseries[$row[wr_datetime].$arr_series[$i]][cnt] = $row[wr_commentcnt];
}
}
@krsort($aseries);
$xtime = date("Y-m-d H:i:s", time()-86400*3);
$i=0;
foreach($aseries as $key=>$value) {
echo "잘되나2";
if ($i++ >= $max_i) break;
echo "잘되나3";
$subject = conv_subject($value[subject], 60,"…");
$new = "";
if ($value[datetime] > $xtime) {
$new = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
$cnt = "";
if ($value[cnt]) {
$cnt = " ($value[cnt])";
}
echo "<tr><td height=22>$new<a href='./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$value[table]&wr_id=$value[id]'>$subject$cnt</a></td></tr>";
}
?>
</table>
연재소스를 사용하는데 계속안되네요.
Warning: Invalid argument supplied for foreach() in /home/01/uri131813/www/gnu3/lastest4.php on line 33
라는 경고가 계속 괴롭힙니다. 도와주세요.^^
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "DESIGN");
$html_title = "그누보드3";
?>
<!-- 연재 -->
<table width=100% cellpadding=0 cellspacing=0>
<tr><td height=1 background='./bbs/line.gif'></td></tr>
<tr class='subject subjectbg ht'><td colspan=2> 연재</td></tr>
<tr><td height=1 background='./bbs/line.gif'></td></tr>
<?
$max_i = 7; // 출력갯수
$wtime = date("Y-m-d H:i:s", time()-86400*14);
$arr_series = array("freeboard", "notice", "hangsa", "lastest");
for ($i=0; $i<count($arr_series); $i++) {
$sql = " select wr_id, wr_subject, wr_datetime, wr_commentcnt from $cfg[write_table_prefix]{$arr_series[$i]} where wr_comment = 0 and wr_datetime > '$wtime' ";
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
$aseries[$row[wr_datetime].$arr_series[$i]][table] = $arr_series[$i];
$aseries[$row[wr_datetime].$arr_series[$i]][datetime] = $row[wr_datetime];
$aseries[$row[wr_datetime].$arr_series[$i]][id] = $row[wr_id];
$aseries[$row[wr_datetime].$arr_series[$i]][subject] = $row[wr_subject];
$aseries[$row[wr_datetime].$arr_series[$i]][cnt] = $row[wr_commentcnt];
}
}
@krsort($aseries);
$xtime = date("Y-m-d H:i:s", time()-86400*3);
$i=0;
foreach($aseries as $key=>$value) {
echo "잘되나2";
if ($i++ >= $max_i) break;
echo "잘되나3";
$subject = conv_subject($value[subject], 60,"…");
$new = "";
if ($value[datetime] > $xtime) {
$new = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
$cnt = "";
if ($value[cnt]) {
$cnt = " ($value[cnt])";
}
echo "<tr><td height=22>$new<a href='./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$value[table]&wr_id=$value[id]'>$subject$cnt</a></td></tr>";
}
?>
</table>
연재소스를 사용하는데 계속안되네요.
Warning: Invalid argument supplied for foreach() in /home/01/uri131813/www/gnu3/lastest4.php on line 33
라는 경고가 계속 괴롭힙니다. 도와주세요.^^
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 2개
근데 저도 정확한 문제는 무엇이었는지 모르겠습니다.
$wtime = date("Y-m-d H:i:s", time()-86400*14);
$arr_series = array("freeboard", "notice", "hangsa", "lastest");
for ($i=0; $i<count($arr_series); $i++) {
$sql = " select wr_id, wr_subject, wr_datetime, wr_commentcnt from $cfg[write_table_prefix]{$arr_series[$i]} where wr_comment = 0 and wr_datetime > '$wtime' ";
위의 소스중에서 보니깐 $wtime 를 출력해보니 현재의 시간이 아니더라구요. 원소스 밑에 있는 $xtime = date("Y-m-d H:i:s", time()-86400*3); 처럼 똑같이 해주었더니 현재의 시간이 출력이 되더라구요.
그리고 $sql 에 보니 wr_datetime > '$wtime' 이부분에 보니 현재시간보다 큰것으로 저장되어 있더라구요.
그래서 수식을 > 에서 < 로 바꾸었더니 되더라구요.
따라서 이파일을 만든 분에게 요청하셔야 할듯 싶네요.
또한 해당 오류를 보니 인자가 선언되지 않았다고 친절하게 33라인을 보라고 나오는군요..
해당 라인의 인자가 넘어오는지 체크 해보시고 어떤 라인인지도 부연설명이 있어야 하지 않을런지요?
제예상에는 아래의 구문에서 오류가 나는지 싶은거 같은데.. 해당 변수들이 제값을 가지고 있는지
이전 라인에서 출력해보시기 바랍니다.
foreach($aseries as $key=>$value) {