o

gnu2.0 베타용 최신겔러리 추출 (스킨방식)

최신글과 함게 전체 올립니다.
최신겔러리 추출에는 조금 에러부분이 있는듯합니다.
소스를 참고로 기죤소스보고 수정하시면되겠죠 *^^*
아참 날짜 옆에 넣는게 빠졌네요 *^^* 추가하는것 힘들지 않으시겠죠 *^^*

########################################################################################
##   userlib.inc.php                                                                                                     ##
########################################################################################
<?

// 새글 추출
function newlist($skins, $bo_table, $subject, $rows, $subjectlen='')
{
&nbsp; &nbsp;global $cfg, $absdir, $reldir, $uc1, $uc2, $uc3;

&nbsp; &nbsp;$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
&nbsp; &nbsp;$bd = sql_fetch_array($sql);

&nbsp; &nbsp;if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];

&nbsp;
&nbsp; &nbsp;$cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사
&nbsp; &nbsp;
&nbsp; &nbsp;$게시판제목 &nbsp; = $subject; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;$게시판 &nbsp; &nbsp; &nbsp; = $bo_table;
&nbsp; &nbsp;$절대경로 &nbsp; &nbsp; = $cfg[url];
&nbsp; &nbsp;$새글스킨경로 = "$cfg[url]/$cfg[dir_skin]/";
&nbsp; &nbsp;$스킨 &nbsp; &nbsp; &nbsp; &nbsp; = $skins;
&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;$table = "{$cfg[board_table_prefix]}{$bo_table}";
&nbsp; &nbsp;$result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
&nbsp; &nbsp;for ($i = 0; $row = mysql_fetch_array($result); $i++) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_file &nbsp; = ($row[wr_file1] || $row[wr_file2]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_link &nbsp; = ($row[wr_link1] || $row[wr_link2]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_new &nbsp; &nbsp;= ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600))) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_hot &nbsp; &nbsp;= ($row[wr_hit] >= $board[bo_hot]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_battle = ($row[wr_commentcnt] >= $board[bo_battle]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_secret = $row[wr_secret] ? true : false; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_commentcnt &nbsp;= ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;

&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_subject &nbsp;= get_text(cut_str($row[wr_subject], $subjectlen, '…'));
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_id &nbsp; &nbsp; &nbsp; = $row[wr_id];
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->bo_table &nbsp; &nbsp;= $bo_table;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_datetime = $row[wr_datetime];
&nbsp; &nbsp;}
&nbsp; &nbsp;mysql_free_result($result);

&nbsp; &nbsp;require_once "./gnu2/skin/$skins/newlist.skin.php";

}



// 최신 그림추출
function newpic($skins, $bo_table, $subject, $rows, $subjectlen='')
{
&nbsp; &nbsp;global $cfg;

&nbsp; &nbsp;$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
&nbsp; &nbsp;$bd = sql_fetch_array($sql);

&nbsp; &nbsp;if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];

&nbsp; &nbsp;$cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사
&nbsp; &nbsp;
&nbsp; &nbsp;$게시판제목 &nbsp; = $subject; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;$게시판 &nbsp; &nbsp; &nbsp; = $bo_table;
&nbsp; &nbsp;$절대경로 &nbsp; &nbsp; = $cfg[url];
&nbsp; &nbsp;$새글스킨경로 = "$cfg[url]/$cfg[dir_skin]/";
&nbsp; &nbsp;$스킨 &nbsp; &nbsp; &nbsp; &nbsp; = $skins;

&nbsp; &nbsp;$table = "{$cfg[board_table_prefix]}{$bo_table}";
&nbsp; &nbsp;$result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
&nbsp; &nbsp;for ($i = 0; $row = mysql_fetch_array($result); $i++) {
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_file &nbsp; = ($row[wr_file1] || $row[wr_file2]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_link &nbsp; = ($row[wr_link1] || $row[wr_link2]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_new &nbsp; &nbsp;= ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600))) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_hot &nbsp; &nbsp;= ($row[wr_hit] >= $board[bo_hot]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_battle = ($row[wr_commentcnt] >= $board[bo_battle]) ? true : false;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->icon_secret = $row[wr_secret] ? true : false; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_commentcnt &nbsp;= ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;


&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_subject &nbsp;= get_text(cut_str($row[wr_subject], $subjectlen, '…'));
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_id &nbsp; &nbsp; &nbsp; = $row[wr_id];
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->bo_table &nbsp; &nbsp;= $bo_table;
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->wr_datetime = $row[wr_datetime]; &nbsp; &nbsp; &nbsp; &nbsp;
// 갤러리
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->images = $row[wr_file1];
&nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->tr = false;
&nbsp; &nbsp; &nbsp; &nbsp;if ($i > 0 && ($i % 5 == 0))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->tr = true;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$temp[$i]->dir_file = $cfg[dir_file];

&nbsp; &nbsp; &nbsp; &nbsp;}
&nbsp; &nbsp; &nbsp; &nbsp;mysql_free_result($result);

&nbsp; &nbsp;require_once "./gnu2/skin/$skins/newpic.skin.php";
&nbsp; &nbsp;}
&nbsp; &nbsp;
?>


########################################################################################
## &nbsp; gnu2/skin/login_skin/newpic.skin.php &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##
########################################################################################
<table border="0" cellpadding="0" cellspacing="0" width="100%" align=center height="20" style='font-family:Verdana; font-size:9pt;'>
&nbsp; &nbsp;<tr>
&nbsp; &nbsp; &nbsp; &nbsp;<td width="22" height="22" style="font-size:9pt; font:"돋움">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? echo "<img src='$새글스킨경로/$스킨/images/qaz_lost_02.gif' width='22' height='29' border='0'>" ?></td> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;<td height="22" width="343" background="<? echo "$새글스킨경로/$스킨" ?>/images/qaz_lost_04.gif" >
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? echo "<b>$게시판제목</b>" ?></td>
&nbsp; &nbsp; &nbsp; &nbsp;<td height="22" background="<? echo "$새글스킨경로/$스킨" ?>/images/qaz_lost_04.gif" align=right >
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? echo "<a href='$절대경로/gblist.php?bo_table=$게시판'>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<img src='$새글스킨경로/$스킨/images/more.gif' width='40' height='15' border='0'></a>" ?></td>
&nbsp; &nbsp; &nbsp; &nbsp;<td width="22" height="22" align="right">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? echo "<img src='$새글스킨경로/$스킨/images/qaz_lost_03.gif' width='22' height='29' border='0'>" ?></td>
&nbsp; &nbsp;</tr>
</table>
&nbsp; <!-- 최근글 목록이 나오는 부분 -->
<table width=100% border=0 cellpadding=4 cellspacing=1 style='table-layout:fixed;'>

&nbsp; &nbsp;<tr>

&nbsp; &nbsp;<? for ($i=0; $i<count($temp); $i++) { ?> &nbsp;

<? if ($temp[$i]->tr) echo "</tr><tr>" ?>
&nbsp; &nbsp; &nbsp; &nbsp;<td width=20% valign=top>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<table width=100%>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<tr>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td align=center>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? if ($temp[$i]->images) { ?>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href='<? echo $절대경로 ?>/gbview.php?bo_table=<? echo $게시판 ?>&wr_id=<? echo $temp[$i]->wr_id ?>'>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<img src='<? echo $절대경로 ?>/data/file/<? echo $temp[$i]->images ?>'width=70 height=70 border=0></a>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? } ?> &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</td>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</tr>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<tr>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td style='font-size:9pt;' align=center><? echo $제목 ?></td>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</tr>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</table>
&nbsp; &nbsp; &nbsp; &nbsp;</td>
&nbsp; &nbsp;<? } ?>
&nbsp; &nbsp;</tr>
</table>
|

댓글 3개

감사합니다.
최신글 추출이 한 스킨당 하나씩 먹는거 같습니다. 최신글 추출한 만큼 스킨을 만들어야 된다는...^^;
최신글 추출에서 여러개를할경우 현재 배열함수 문제인지 한개만 나와버리는 버그가있습니다. 그 버그 잡기쩐까지는 이 소스로 사용하세요 *^^*
<?

// 새글 추출
function newlist($skins, $bo_table, $subject, $rows, $subjectlen='')
{
global $cfg, $uc1, $uc2, $uc3;

$sql = " select * from gb_board where bo_table = '$bo_table' ";
$bd = sql_fetch_array($sql);

if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];


$cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사

$게시판제목 = $subject;
$게시판 = $bo_table;
$절대경로 = $cfg[url];
$새글스킨경로 = "$cfg[url]/$cfg[dir_skin]/";
$스킨 = $skins;


$table = "{$cfg[board_table_prefix]}{$bo_table}";
$result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
for ($i = 0; $row = mysql_fetch_array($result); $i++) {

$temp[$i]->icon_file = ($row[wr_file1] || $row[wr_file2]) ? true : false;
$temp[$i]->icon_link = ($row[wr_link1] || $row[wr_link2]) ? true : false;
$temp[$i]->icon_new = ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600))) ? true : false;
$temp[$i]->icon_hot = ($row[wr_hit] >= $board[bo_hot]) ? true : false;
$temp[$i]->icon_battle = ($row[wr_commentcnt] >= $board[bo_battle]) ? true : false;
$temp[$i]->icon_secret = $row[wr_secret] ? true : false;

$temp[$i]->wr_commentcnt = ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;

$temp[$i]->wr_subject = get_text(cut_str($row[wr_subject], $subjectlen, '…'));
$temp[$i]->wr_id = $row[wr_id];
$temp[$i]->bo_table = $bo_table;
$temp[$i]->wr_datetime = $row[wr_datetime];
}
mysql_free_result($result);

echo "
<table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'>
<tr>
<td width=22 height=22 style='font-size:9pt; font:돋움'>
<img src='$새글스킨경로/$스킨/images/qaz_lost_02.gif' width='22' height='29' border='0'></td>
<td height=22 width=343 background='$새글스킨경로/$스킨/images/qaz_lost_04.gif' >
<b>$게시판제목</b></td>
<td height=22 background='$새글스킨경로/$스킨/images/qaz_lost_04.gif' >
<a href='$절대경로/gblist.php?bo_table=$게시판'>
<img src='$새글스킨경로/$스킨/images/more.gif' width='40' height='15' border='0'></a></td>
<td width=22 height=22 align=right>
<img src='$새글스킨경로/$스킨/images/qaz_lost_03.gif' width='22' height='29' border='0'></td>
</tr>
</table>


<tr>
<td height=2 colspan=4></td>
</tr>
<tr>
<td height=20 colspan=4 >
<table border='0' cellpadding='0' cellspacing='0' width='100%'> ";
for ($i=0; $i<count($temp); $i++) {
echo "
<tr>
<td style='font-size:9pt;'> <img src='$새글스킨경로/$스킨/images/arrow.gif' border=0> ";

if ($temp[$i]->icon_file) echo "<img src='$새글스킨경로/$스킨/images/icon_file.gif' align=absmiddle>";
if ($temp[$i]->icon_link) echo "<img src='$새글스킨경로/$스킨/images/icon_link.gif' align=absmiddle>";


echo "<a href='$절대경로/gbview.php?bo_table=$게시판&wr_id={$temp[$i]->wr_id}'>{$temp[$i]->wr_subject}</a>";


if ($temp[$i]->wr_commentcnt) echo "[{$temp[$i]->wr_commentcnt}]";

if ($temp[$i]->icon_new) echo "<img src='$새글스킨경로/$스킨/images/icon_new.gif' align=absmiddle>";
if ($temp[$i]->icon_hot) echo "<img src='$새글스킨경로/$스킨/images/icon_hot.gif' align=absmiddle>";
if ($temp[$i]->icon_battle) echo "<img src='$새글스킨경로/$스킨/images/icon_battle.gif' align=absmiddle>";
if ($temp[$i]->icon_secret) echo "<img src='$새글스킨경로/$스킨/images/icon_secret.gif' align=absmiddle>";

echo " </td>
</tr> ";
}
echo " </table>

</td>
</tr>
<tr>
<td width=100% height=1 background='$새글스킨경로/images/underline.gif' colspan=4></td>
</tr>
</table> ";



}
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3 팁자료실

+
제목 글쓴이 날짜 조회
22년 전 조회 3,428
22년 전 조회 2,671
22년 전 조회 3,650
22년 전 조회 3,095
22년 전 조회 2,328
22년 전 조회 2,496
22년 전 조회 2,306
22년 전 조회 3,092
22년 전 조회 2,503
22년 전 조회 2,891
22년 전 조회 6,754
22년 전 조회 2,876
22년 전 조회 2,394
22년 전 조회 2,904
22년 전 조회 4,167
22년 전 조회 2,684
22년 전 조회 3,228
22년 전 조회 2,655
22년 전 조회 3,594
22년 전 조회 3,322
🐛 버그신고