겔러리를 최근게시물로 보이게 하자!! 정보
일반 겔러리를 최근게시물로 보이게 하자!!
관련링크
http://www.goodch.com/main.html
297회 연결
본문
겔러리 최근 게시물 추출을 위한 소스 변경.....
lib.inc.php의 내용 750라인에 아래의 내용을 추가합니다..
// 겔러리 새글 추출
function newlist1($gb_table, $subject, $rows, $subjectlen='')
{
global $cfg, $absdir, $reldir, $uc1, $uc2, $uc3;
require_once "$reldir/ets.php";
$sql = " select * from $cfg[table_board] where gb_table = '$gb_table' ";
$bd = sql_fetch_array($sql);
if ($subjectlen == '') $subjectlen = $bd[gb_subject_len];
$temp->게시판제목 = $subject;
$temp->게시판 = $gb_table;
$temp->절대경로 = $absdir;
$temp->상대경로 = $reldir;
$temp->스킨디렉토리 = $cfg[dir_skin];
$temp->스킨 = $cfg[skin];
$temp->uc1 = $uc1;
$temp->uc2 = $uc2;
$temp->uc3 = $uc3;
$table = "{$cfg[board_table_prefix]}{$gb_table}";
$result = sql_query_error(" select * from $table where bd_comment = 0 order by bd_id desc limit {$rows} ");
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$temp->목록[$i]->파일아이콘 = false;
if ($row[bd_file1] || $row[bd_file2])
$temp->목록[$i]->파일아이콘 = true;
$temp->목록[$i]->링크아이콘 = false;
if ($row[bd_link1] || $row[bd_link2])
$temp->목록[$i]->링크아이콘 = true;
$temp->목록[$i]->새글아이콘 = false;
if ($row[bd_datetime] >= date("Y-m-d H:i:s", time() - ($cfg['new'] * 3600)))
$temp->목록[$i]->새글아이콘 = true;
$temp->목록[$i]->뜨거운아이콘 = false;
if ($row[bd_hit] >= $cfg[hot])
$temp->목록[$i]->뜨거운아이콘 = true;
$temp->목록[$i]->전투아이콘 = false;
if ($row[bd_commentcnt] >= $cfg[battle])
$temp->목록[$i]->전투아이콘 = true;
$temp->목록[$i]->비밀아이콘 = false;
if ($row[bd_secret])
$temp->목록[$i]->비밀아이콘 = true;
$temp->목록[$i]->코멘트수 = ($row[bd_commentcnt]) ? $row[bd_commentcnt] : null;
$temp->목록[$i]->제목 = get_text(cut_str($row[bd_subject], $subjectlen, '…'));
$temp->목록[$i]->아이디 = $row[bd_id];
$temp->목록[$i]->게시판 = $gb_table;
// 갤러리
$temp->목록[$i]->이미지 = $row[bd_file1];
$temp->목록[$i]->줄바꿈 = false;
if ($i > 0 && ($i % 5 == 0))
$temp->목록[$i]->줄바꿈 = true;
$temp->목록[$i]->파일디렉토리 = $cfg[dir_file];
}
mysql_free_result($result);
printt($temp, "$reldir/$cfg[dir_skin]/$cfg[skin]/newlist1.ets");
}
######newlist1.ets#########내용입니다.....^^
{* 겔러리 새글 추출 *}
{mask:main}
<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"><span style="font-size:9pt;"><font face="돋움"><img src="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_02.gif" width="22" height="29" border="0"></font></span></td>
<td height="22" width="343" background="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_04.gif" ><font face="돋움"><span style="font-size:9pt;"> <b>{게시판제목}</b></span></font></td>
<td height="22" background="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_04.gif" ><p><span style="font-size:9pt;"><font face="돋움"> <a href='{절대경로}/{상대경로}/gblist.php{uc1}gb_table{uc2}{게시판}'><img src="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/more.gif" width="40" height="15" border="0"></a></font></span></p></td>
<td width="22" height="22" ><p align="right"><font style=font-family:verdana;font-size:7pt face="돋움"><span style="font-size:9pt;"><img src="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_03.gif" width="22" height="29" border="0"></span></font></td>
</tr>
<!-- 최근글 목록이 나오는 부분 -->
<table width=100% border=0 cellpadding=4 cellspacing=1 style='table-layout:fixed;'>
<tr>
{mask:목록}
{var:줄바꿈}</tr><tr>{/var:줄바꿈}
<td width=20% valign=top>
<table width=100%>
<tr>
<td align=center>
{var:이미지}<a href='{절대경로}/{상대경로}/gbview.php{uc1}gb_table{uc2}{게시판}{uc3}sselect{uc2}{검색선택}{uc3}stext{uc2}{검색어}{uc3}bd_id{uc2}{아이디}{uc3}page{uc2}{페이지}'>
<img src='{절대경로}/{상대경로}/{파일디렉토리}/{이미지}' width=70 height=70 border=1>{/var:이미지}
</a>
</td>
</tr>
<tr><td align=center>{제목}</td></tr>
</table>
</td>
{/mask:목록}
</tr>
</table>
{/mask:main}
그런데 한가지 문제는 이미지가 업로드 않되었을때의 노이미지를 불러내는 것이 어렵군요.....
lib.inc.php의 내용 750라인에 아래의 내용을 추가합니다..
// 겔러리 새글 추출
function newlist1($gb_table, $subject, $rows, $subjectlen='')
{
global $cfg, $absdir, $reldir, $uc1, $uc2, $uc3;
require_once "$reldir/ets.php";
$sql = " select * from $cfg[table_board] where gb_table = '$gb_table' ";
$bd = sql_fetch_array($sql);
if ($subjectlen == '') $subjectlen = $bd[gb_subject_len];
$temp->게시판제목 = $subject;
$temp->게시판 = $gb_table;
$temp->절대경로 = $absdir;
$temp->상대경로 = $reldir;
$temp->스킨디렉토리 = $cfg[dir_skin];
$temp->스킨 = $cfg[skin];
$temp->uc1 = $uc1;
$temp->uc2 = $uc2;
$temp->uc3 = $uc3;
$table = "{$cfg[board_table_prefix]}{$gb_table}";
$result = sql_query_error(" select * from $table where bd_comment = 0 order by bd_id desc limit {$rows} ");
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$temp->목록[$i]->파일아이콘 = false;
if ($row[bd_file1] || $row[bd_file2])
$temp->목록[$i]->파일아이콘 = true;
$temp->목록[$i]->링크아이콘 = false;
if ($row[bd_link1] || $row[bd_link2])
$temp->목록[$i]->링크아이콘 = true;
$temp->목록[$i]->새글아이콘 = false;
if ($row[bd_datetime] >= date("Y-m-d H:i:s", time() - ($cfg['new'] * 3600)))
$temp->목록[$i]->새글아이콘 = true;
$temp->목록[$i]->뜨거운아이콘 = false;
if ($row[bd_hit] >= $cfg[hot])
$temp->목록[$i]->뜨거운아이콘 = true;
$temp->목록[$i]->전투아이콘 = false;
if ($row[bd_commentcnt] >= $cfg[battle])
$temp->목록[$i]->전투아이콘 = true;
$temp->목록[$i]->비밀아이콘 = false;
if ($row[bd_secret])
$temp->목록[$i]->비밀아이콘 = true;
$temp->목록[$i]->코멘트수 = ($row[bd_commentcnt]) ? $row[bd_commentcnt] : null;
$temp->목록[$i]->제목 = get_text(cut_str($row[bd_subject], $subjectlen, '…'));
$temp->목록[$i]->아이디 = $row[bd_id];
$temp->목록[$i]->게시판 = $gb_table;
// 갤러리
$temp->목록[$i]->이미지 = $row[bd_file1];
$temp->목록[$i]->줄바꿈 = false;
if ($i > 0 && ($i % 5 == 0))
$temp->목록[$i]->줄바꿈 = true;
$temp->목록[$i]->파일디렉토리 = $cfg[dir_file];
}
mysql_free_result($result);
printt($temp, "$reldir/$cfg[dir_skin]/$cfg[skin]/newlist1.ets");
}
######newlist1.ets#########내용입니다.....^^
{* 겔러리 새글 추출 *}
{mask:main}
<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"><span style="font-size:9pt;"><font face="돋움"><img src="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_02.gif" width="22" height="29" border="0"></font></span></td>
<td height="22" width="343" background="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_04.gif" ><font face="돋움"><span style="font-size:9pt;"> <b>{게시판제목}</b></span></font></td>
<td height="22" background="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_04.gif" ><p><span style="font-size:9pt;"><font face="돋움"> <a href='{절대경로}/{상대경로}/gblist.php{uc1}gb_table{uc2}{게시판}'><img src="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/more.gif" width="40" height="15" border="0"></a></font></span></p></td>
<td width="22" height="22" ><p align="right"><font style=font-family:verdana;font-size:7pt face="돋움"><span style="font-size:9pt;"><img src="{절대경로}/{상대경로}/{스킨디렉토리}/{스킨}/images/qaz_lost_03.gif" width="22" height="29" border="0"></span></font></td>
</tr>
<!-- 최근글 목록이 나오는 부분 -->
<table width=100% border=0 cellpadding=4 cellspacing=1 style='table-layout:fixed;'>
<tr>
{mask:목록}
{var:줄바꿈}</tr><tr>{/var:줄바꿈}
<td width=20% valign=top>
<table width=100%>
<tr>
<td align=center>
{var:이미지}<a href='{절대경로}/{상대경로}/gbview.php{uc1}gb_table{uc2}{게시판}{uc3}sselect{uc2}{검색선택}{uc3}stext{uc2}{검색어}{uc3}bd_id{uc2}{아이디}{uc3}page{uc2}{페이지}'>
<img src='{절대경로}/{상대경로}/{파일디렉토리}/{이미지}' width=70 height=70 border=1>{/var:이미지}
</a>
</td>
</tr>
<tr><td align=center>{제목}</td></tr>
</table>
</td>
{/mask:목록}
</tr>
</table>
{/mask:main}
그런데 한가지 문제는 이미지가 업로드 않되었을때의 노이미지를 불러내는 것이 어렵군요.....
추천
11
11
댓글 전체
감사합니다.
<? echo newlist1("album", "앨범게시판", 5, 20); ?> 게시판에서 글을 뽑아낼때....
안되는 부분은 팁엔테크 ⓒⓒⓒ님의 글을 참조하세요.....^^
안되는 부분은 팁엔테크 ⓒⓒⓒ님의 글을 참조하세요.....^^