최신글함수? 정보
그누보드 최신글함수?본문
와우맨님 관심을 가져주셔서 감사감사..
바쁘다보니 이제 들어와서 보네요.
== latest.skin.php
<table cellpadding="0" cellspacing="0" width="100%"><tr><td> <tr> <td width="11" height="22"> </td> <td width="978" height="22" valign="top"> <table cellpadding="0" cellspacing="0" width="100%" height="20" style="border-bottom-width:0.1mm; border-bottom-color:rgb(51,153,204); border-bottom-style:solid;"> <tr> <td width="90%" height="20"> <b></b><b> <span class=subject><?=$bo_subject?></span> </b> </td> <td width="10%" style="background-repeat:repeat-x;" height="20"> <a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table"?>'><img src='<?=$latest_skin?>/more.gif' border=0></a> </td> </tr> </table> </td> <td width="11" height="22"> </td> </tr><? for ($i=0; $i<count($list); $i++) { ?> <tr> <td width="11"> <p style="border-color:rgb(153,153,153);"> </p> </td> <td> <table width=100% cellspacing="0" cellpadding=0 style="border-color:rgb(153,153,153);"> <td></td> </tr> <tr> <td height="23" width="75%"><img src='<?=$latest_skin?>/bul.gif' border=0 align=absmiddle width="6" height="7"> <a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><?=$list[$i][date]?> <span class=content><?=$list[$i][subject]?></span></a> <?=$list[$i][icon_new]?> <?=$list[$i][commentcnt]?></font></td> <td height="23" width="25%" align=right><?=$list[$i][name]?></td> </tr> <tr> <td width="50%" height=1 background='./<?=$latest_skin?>/dot.gif'></td> <td width="50%" height=1 background='./<?=$latest_skin?>/dot.gif'></td> </tr> <td><span style="font-size:9pt;"></span></td> </tr> </table> </td> <td width="11"> <p> </p> </td> </tr> <? } ?><? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>등록된 내용이 없습니다.</td></tr>"; } ?> </table>
소스가 정리가 안되네요.
넓으시 ㄴ아량으로 이해바랍니다.
== latest.lib.php
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
//==============================================================================
// 최신글 관련 함수
//==============================================================================
// 최신글 추출
function latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin = "./bbs/skin/latest/$skin_dir";
}
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);
$bo_subject = $bo[bo_subject];
$sql = " select *
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][href] = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";
// 코멘트 카운트
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt] > 0) {
$list[$i][commentcnt] = "($row[wr_commentcnt])";
}
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage]);
$list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
$list[$i][content] = get_text($row[wr_content]);
$list[$i][date] = substr($row[wr_datetime],2,8);
$list[$i][icon_new] = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
$list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
for ($k=1; $k<=$cfg[file_count]; $k++) {
if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
$list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
}
}
for ($k=1; $k<=$cfg[link_count]; $k++) {
if ($row["wr_link".$k]) {
$link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
$link[$i]["link_href".$k] = "./?doc=bbs/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
}
}
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
?>
바쁘다보니 이제 들어와서 보네요.
== latest.skin.php
<table cellpadding="0" cellspacing="0" width="100%"><tr><td> <tr> <td width="11" height="22"> </td> <td width="978" height="22" valign="top"> <table cellpadding="0" cellspacing="0" width="100%" height="20" style="border-bottom-width:0.1mm; border-bottom-color:rgb(51,153,204); border-bottom-style:solid;"> <tr> <td width="90%" height="20"> <b></b><b> <span class=subject><?=$bo_subject?></span> </b> </td> <td width="10%" style="background-repeat:repeat-x;" height="20"> <a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table"?>'><img src='<?=$latest_skin?>/more.gif' border=0></a> </td> </tr> </table> </td> <td width="11" height="22"> </td> </tr><? for ($i=0; $i<count($list); $i++) { ?> <tr> <td width="11"> <p style="border-color:rgb(153,153,153);"> </p> </td> <td> <table width=100% cellspacing="0" cellpadding=0 style="border-color:rgb(153,153,153);"> <td></td> </tr> <tr> <td height="23" width="75%"><img src='<?=$latest_skin?>/bul.gif' border=0 align=absmiddle width="6" height="7"> <a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><?=$list[$i][date]?> <span class=content><?=$list[$i][subject]?></span></a> <?=$list[$i][icon_new]?> <?=$list[$i][commentcnt]?></font></td> <td height="23" width="25%" align=right><?=$list[$i][name]?></td> </tr> <tr> <td width="50%" height=1 background='./<?=$latest_skin?>/dot.gif'></td> <td width="50%" height=1 background='./<?=$latest_skin?>/dot.gif'></td> </tr> <td><span style="font-size:9pt;"></span></td> </tr> </table> </td> <td width="11"> <p> </p> </td> </tr> <? } ?><? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>등록된 내용이 없습니다.</td></tr>"; } ?> </table>
소스가 정리가 안되네요.
넓으시 ㄴ아량으로 이해바랍니다.
== latest.lib.php
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
//==============================================================================
// 최신글 관련 함수
//==============================================================================
// 최신글 추출
function latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin = "./bbs/skin/latest/$skin_dir";
}
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);
$bo_subject = $bo[bo_subject];
$sql = " select *
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][href] = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";
// 코멘트 카운트
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt] > 0) {
$list[$i][commentcnt] = "($row[wr_commentcnt])";
}
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage]);
$list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
$list[$i][content] = get_text($row[wr_content]);
$list[$i][date] = substr($row[wr_datetime],2,8);
$list[$i][icon_new] = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
$list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
for ($k=1; $k<=$cfg[file_count]; $k++) {
if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
$list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
}
}
for ($k=1; $k<=$cfg[link_count]; $k++) {
if ($row["wr_link".$k]) {
$link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
$link[$i]["link_href".$k] = "./?doc=bbs/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
}
}
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
?>
댓글 전체