T

최신글과 투표가 충돌나는데 ..

최신글
--------------------------------------------------------------------------
<?

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

if ($hours < 1 || $hours > 24) {
$hours = 24; //288시간내에.. 올라온 새글...
}

$li = 11; //몇개뽑을건가..
?>

<table width=180 cellpadding=0 cellspacing=0>
<tr>
<td valign=top align=center><img src="images/newlist_1.gif" width="180" height="10"></td>
</tr>
<tr>
<td align=center valign=top background="images/newlist_2.gif"><?

$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * $hours));

$sql = " select bo_subject, bo_table
from $cfg[table_board]
order by bo_order_search ";
$result = sql_query($sql);

while ($row = mysql_fetch_array($result)) {

//제외게시판 ||(or) 로 구분합다 $row[bo_table]==테이블이름

if($row[bo_table]==notice ||$row[bo_table]==news ||$row[bo_table]==test ||$row[bo_table]==test2 ||$row[bo_table]==test3 ||$row[bo_table]==test4 ){}
else{

$tbl = "{$cfg[write_table_prefix]}{$row[bo_table]}";
$sql2 = " select wr_id,
wr_parent_id,
mb_id,
wr_name,
wr_email,
wr_homepage,
wr_num,
wr_subject,
wr_content,
wr_comment,
wr_commentcnt,
wr_datetime,
wr_file1,
wr_file2,
wr_link1,
wr_link2,
wr_hit
from $tbl
where wr_datetime >= '$intime'
and wr_comment = '0'
order by wr_id desc";
$result2 = sql_query($sql2);

for ($i = 0; $row2 = mysql_fetch_array($result2); $i++) {

$wr_subject = get_text($row2[wr_subject]);

$key = $row2[wr_datetime] . $row[bo_table] . $row2[wr_id];

$list[$key]->bo_subject = $row[bo_subject];
$list[$key]->bo_table = $row[bo_table];
// $list[$key]->mb_id = $row2[mb_id];
$list[$key]->mb_open = $row2[mb_open];
// $list[$key]->wr_id = $row2[wr_id];
// $list[$key]->wr_parent_id = $row2[wr_parent_id];
$list[$key]->wr_subject = cut_str($wr_subject,24,'..'); // 글자 길이.........
$list[$key]->wr_comment = $row2[wr_comment];
$list[$key]->wr_content = cut_str(strip_tags($row2[wr_content]),240);
$list[$key]->wr_commentcnt = $row2[wr_commentcnt];

//파일, 링크


$list[$key]->link1 = set_http(get_text(cut_str($row2[wr_link1], 255)));
$link[$key]->link_href1 = "./?doc=bbs/gnuboard.php&bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
$link[$key]->link_href11 = "./?doc=bbs/gnuboard.php&bo_table=$row[bo_table]";
$list[$key]->link2 = set_http(get_text(cut_str($row2[wr_link2], 255)));
$link[$key]->link_href2 = "./?doc=bbs/gblink.php&bo_table=$row[bo_table]&wr_id=$row2[wr_id]&index=2";

}
mysql_free_result($result2);

}//else
}
mysql_free_result($result);
?>

<table width=100% border=0 cellspacing=0 cellpadding=0 align=center>
<tr><td colspan=4 height=1></td></tr>
<?
if (count($list) > 0) {
$p=-1;
krsort($list);
foreach ($list as $key=>$value) {
if(time()-(60*60*24) <= strtotime($list[$i][wr_datetime])) $list[$i][date] = date('H:i',strtotime($list[$i][wr_datetime]));
else $list[$i][date] = date('Y.m.d',strtotime($list[$i][wr_datetime]));

$p++;
if ($p >= $li) break;
$comment = "";
$atag_comment = "";
if ($value->wr_comment > 0) {
$comment = "<span style='font-size:8pt;'>[c]</span> ";
$atag_comment = "#c{$value->wr_id}";
}

$commentcnt = "";
if ($value->wr_commentcnt > 0) {
$commentcnt = "<span style='font-size:9pt;'>[{$value->wr_commentcnt}]</span>";
}

$value->bo_subject = cut_str($value->bo_subject, 20);
echo "<tr>";
echo "<td width=100%>";
echo "<table width=100% border=0 cellspacing=0 cellpadding=0 align=center>";
echo "<tr>";
echo "<td align=left>&nbsp;&nbsp;";
echo "<img src=images/icon_02.gif> <a href='{$link[$key]->link_href1}' title='[{$value->bo_subject}]에 등록된 글입니다. '>{$value->wr_subject}</a> <font class=cpt7>{$commentcnt}</font></td>";
echo "</tr></table>";
echo "</tr>";
echo "<tr><td height=5></td></tr>";
}
} else
echo "<td align=center colspan=4>등록된 글이 없습니다.</td>";
?>
</table> </td>
</tr>
<tr>
<td valign=top align=center><img src="images/newlist_3.gif" width="180" height="10"></td>
</tr>
</table>
-------------------------------------------------------------------------------------------------------------

와 투표가 서로 충돌해서...

그러니간 ..

투표함에.. 내용이 1,2,3,4 가 있다면...

최신글에 아무글자도 없을때...

간격이 1.2.3.4 로 나오네요...

저걸 어떠게 해야되느데... 아시는분 있으세요??
|

댓글 1개

vote.php 에서 사용된 $list[] 값이 그대로 넘어와서 그런것 같습니다.
위 소스에서 $list[] 를 변경하세요. $newlist[]라고 하면 되겠네요...
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
20년 전 조회 1,448
20년 전 조회 1,299
20년 전 조회 1,322
20년 전 조회 1,389
20년 전 조회 1,370
20년 전 조회 1,470
20년 전 조회 1,633
20년 전 조회 1,480
20년 전 조회 1,441
20년 전 조회 1,301
20년 전 조회 1,324
20년 전 조회 1,292
20년 전 조회 1,575
20년 전 조회 1,439
20년 전 조회 1,513
20년 전 조회 1,399
20년 전 조회 1,384
20년 전 조회 1,467
20년 전 조회 2,830
20년 전 조회 1,279
🐛 버그신고