무슨 오류인지 좀 알려주세요. > 그누4 질문답변

그누4 질문답변

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

무슨 오류인지 좀 알려주세요. 정보

무슨 오류인지 좀 알려주세요.

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :


Warning: krsort() expects parameter 1 to be array, null given in /www/xxx.com/rank_day.php on line 47

Warning: Invalid argument supplied for foreach() in /www/xxx.com/rank_day.php on line 55

위 두가지 오류코드가 웹상에 찍힙니다.
해당되는 라인은 별도로 표시했습니다.


아래는 해당소스입니다.
----------------------------------------------------------------------------
<?
include_once("./_common.php");

define("_CO_INDEX_", TRUE);
$html_title = "";
$g4[title] = "" . $html_title;
include_once("./_head.php");

$before_day = 2; //게시물을 추출할기간설정
$before_time = date("Y-m-d H:i:s", $g4[server_time] - (86400 * $before_day));

$list1 = array();

$top1 = 3;
$bo_tables = "('w21','w22','w23','w31','w32','w33','w34','w35','w36','w37','w38','w51','w52','w53')";    // <-- board1~3은 원하는 게시판의 bo_table 값들
$sql = " select bo_table, bo_notice from $g4[board_table]
          where bo_table in $bo_tables";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
    $sql2 = " select * from $g4[write_prefix]$row[bo_table]
              where wr_is_comment = 0
                and wr_datetime >= '$before_time'
              order by wr_datetime desc ";
    $result2 = sql_query($sql2);
    while ($row2 = sql_fetch_array($result2))
    {

        $key = substr('00000'.$row2[wr_hit],-5) . '-' . $row2[wr_id];
        $list2[$key][subject] = conv_subject($row2[wr_subject],40,'…');
        $list2[$key][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
        $list2[$key][bo_table] = $row[bo_table];
        $list2[$key][wr_id] = $row2[wr_id];
        $list2[$key][wr_hit] = $row2[wr_hit];
        $list2[$key][hit] = "($row2[wr_hit])";
$list2[$key][file][0][file] = $row2[file][1][file];
$list2[$key][comment] = $row2[wr_comment];
        if($row2[wr_comment]>0) $list2[$key][comment_cnt] = $row2[wr_comment];
        $list2[$key][wr_last] = $row2[wr_last];
$list2[$key][wd] = substr($row2[wr_datetime],0,4)."-".substr($row2[wr_datetime],5,2)."-".substr($row2[wr_datetime],8,2);
$list2[$key][name] = $row2[wr_name];
$list2[$key][id] = $row2[mb_id];
        $list2[$key][mb_info] = get_member($list2[$key][id]);
}
}

krsort($list2); ///////////////////////////////////////// 이부분

$latest_skin_path = "$g4[path]/skin/latest/rank";
?>

<div style="width:380px;margin-left:16px;">
<?
        $i=0;
        foreach($list2 as $key=>$value) { ////////////////////////////////////////이부분
            if ($i++>=($top1)) break;
?>
<div style="width:380px;">
<div class="cc aleft bleft" style="width:63px;height:48px;">
<a href='<?=$list2[$key][href]?>'>
<?
//이미지 찾아오기 1
$sql_1 = " select bf_file from `$g4[board_file_table]` where bo_table = '{$list2[$key][bo_table]}' and wr_id = '{$list2[$key][wr_id]}' order by bf_no limit 1 ";
$result_1 = mysql_fetch_array(sql_query($sql_1));

//썸네일경로 사용할경우
$data_path = "$g4[path]/data/file/{$list2[$key][bo_table]}/thumbnail/"; //게시판 업로드 기본경로
$list2[$key][bf_file] = $data_path . $list2[$key][wr_id]; //퍼일 전체경로 = 해당게시판 해당글의 파일명 : $result_1[bf_file]


if (file_exists($list2[$key][bf_file])){
$imgii = "<img src='{$list2[$key][bf_file]}' width=46 height=46 class=img align='absmiddle'>";
}else{
$imgii = "<img src='{$g4[path]}/wimg/noimg.png' width=46 height=46 class=img align='absmiddle'>";
}


?>
<?=$imgii?></a></div>
<div style="width:315px;height:48px;" class="bleft aleft">
<div class="cc lh14"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$list2[$key][bo_table]?>"><span class="text8 fontg">

</span></a></div>
<div class="cc fs" style="height:4px;"></div>
<div><a href='<?=$list2[$key][href]?>'><?=$list2[$key][subject]?></a>


<?
$wr_last = $list2[$key][wr_last];
$Co_datetime = substr($wr_last,0,4).substr($wr_last,5,2).substr($wr_last,8,2);
$To_datetime = date("Ymd");

if(count($list2[$key][comment_cnt]) == 0) {
echo "";
}elseif($To_datetime - $Co_datetime < 3){
    echo " <span class='comm1'>{$list2[$key][comment_cnt]}</span>";
}else{
    echo " <span class='comm'>{$list2[$key][comment_cnt]}</span>";
}


</div>
<div class="fs cc" style="height:3px;"></div>
<div class="cc lh20">
<span class="text8 fontg"><?=$list2[$key][wd]?></span><span style="padding:0 8px;"></span><?=$aaicon_lv?><span class="text8"><?=$list2[$key][name]?></span><?=$aaicon_sadmin?>
</div>

</div>
<div class="cc fs" style="height:17px;"></div>
</div>

<? } ?>


</div>
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로