소스 좀 봐주세요. ! 정보
소스 좀 봐주세요. !본문
아래소스는 관리자님께서 사용하시는 조회순 top , bottom 에서..
그룹 게시판물 조회순 top 만 나오게 필요한 부분만 해봣는데..
이대로 써도 되는지? 필요없는 부분이나 수정할 필요 있나요?
<?
include_once("./_common.php");
$before_day = 15;
$before_time = date("Y-m-d H:i:s", $g4[server_time] - (86400 * $before_day));
$list1 = array();
$top1 = $top2 = 8;
$gr_id = "그룹명";
$sql = " select bo_table, bo_notice from $g4[board_table]
where gr_id = '$gr_id'
and bo_use_search = 1 ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
$sql2 = " select * from $g4[write_prefix]$row[bo_table]
where wr_comment > -1
and wr_datetime >= '$before_time' ";
$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],42,'');
$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][is_notice] = preg_match("/[^0-9]{0,1}{$row2[wr_id]}[\r]{0,1}/",$row[bo_notice]);
$list2[$key][wr_hit] = $row2[wr_hit];
$list2[$key][hit] = "($row2[wr_hit])";
}
}
krsort($list2);
?>
<style type="text/css">
<!--
body,td {font-size:9pt;}
a:link, a:visited, a:active { text-decoration:none; color:black; font-size:9pt }
a:hover { text-decoration:underline; color:black; }
a: { text-decoration:none; color:black; font-size:9pt }
</style>
<table border="0" cellspacing="0" cellpadding="0" bgcolor width=100%>
<?
$i=0;
foreach($list2 as $key=>$value) {
if ($i++>=($top1-1)) break;
?>
<tr>
<td style=padding-left:4>
<?
echo $list2[$key][icon_reply] . " ";
echo "<a href='{$list2[$key][href]}' target=_parent>";
if ($list2[$key][is_notice])
echo "<font style='font-size:9pt; color:black;'><strong>{$list2[$key][subject]}</strong></font>";
else
echo "<font style='font-size:9pt; color:#363636;'><strong>{$list2[$key][subject]}</strong></font>";
echo "</a>";
?>
</td>
<tr><td height=1 colspan=2></td>
<tr><td height=1 bgcolor=dddddd colspan=2></td>
<tr><td height=5 colspan=2></td>
<? } ?>
<? if (count($list2) == 0) { ?>
<tr><td colspan=2 align=center height=30 background="<?=$latest_skin_path?>/img/board_bg_line.gif">게시물이 없습니다.</td></tr>
<? } ?>
</table>
그룹 게시판물 조회순 top 만 나오게 필요한 부분만 해봣는데..
이대로 써도 되는지? 필요없는 부분이나 수정할 필요 있나요?
<?
include_once("./_common.php");
$before_day = 15;
$before_time = date("Y-m-d H:i:s", $g4[server_time] - (86400 * $before_day));
$list1 = array();
$top1 = $top2 = 8;
$gr_id = "그룹명";
$sql = " select bo_table, bo_notice from $g4[board_table]
where gr_id = '$gr_id'
and bo_use_search = 1 ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
$sql2 = " select * from $g4[write_prefix]$row[bo_table]
where wr_comment > -1
and wr_datetime >= '$before_time' ";
$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],42,'');
$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][is_notice] = preg_match("/[^0-9]{0,1}{$row2[wr_id]}[\r]{0,1}/",$row[bo_notice]);
$list2[$key][wr_hit] = $row2[wr_hit];
$list2[$key][hit] = "($row2[wr_hit])";
}
}
krsort($list2);
?>
<style type="text/css">
<!--
body,td {font-size:9pt;}
a:link, a:visited, a:active { text-decoration:none; color:black; font-size:9pt }
a:hover { text-decoration:underline; color:black; }
a: { text-decoration:none; color:black; font-size:9pt }
</style>
<table border="0" cellspacing="0" cellpadding="0" bgcolor width=100%>
<?
$i=0;
foreach($list2 as $key=>$value) {
if ($i++>=($top1-1)) break;
?>
<tr>
<td style=padding-left:4>
<?
echo $list2[$key][icon_reply] . " ";
echo "<a href='{$list2[$key][href]}' target=_parent>";
if ($list2[$key][is_notice])
echo "<font style='font-size:9pt; color:black;'><strong>{$list2[$key][subject]}</strong></font>";
else
echo "<font style='font-size:9pt; color:#363636;'><strong>{$list2[$key][subject]}</strong></font>";
echo "</a>";
?>
</td>
<tr><td height=1 colspan=2></td>
<tr><td height=1 bgcolor=dddddd colspan=2></td>
<tr><td height=5 colspan=2></td>
<? } ?>
<? if (count($list2) == 0) { ?>
<tr><td colspan=2 align=center height=30 background="<?=$latest_skin_path?>/img/board_bg_line.gif">게시물이 없습니다.</td></tr>
<? } ?>
</table>
댓글 전체

질문은 직접해보시고 문제가 발생되거나 했을때 또 해당문제에 대한 조치를 취해도 되지 않을때 하셔야 합니다.
해보지도 않으시고 질문을?......ㅠ.ㅠ
해보지도 않으시고 질문을?......ㅠ.ㅠ