이하 gblog.index.php 전체내용...
-----------------------------------------------------------
<?
include_once("./_common.php");
include_once("$g4[path]/lib/blog.lib.php");
include_once("./_common.php");
include_once("$g4[path]/lib/blog.lib.php");
$g4['title'] = "블로그 메인";
//include_once("./_head.php");
include_once("./gblog.head.php");
?>
//include_once("./_head.php");
include_once("./gblog.head.php");
?>
<table width="100%" cellpadding=0 cellspacing=0>
<tr>
<td valign=top width=454>
<img src='<?=$gb4['blog_path']?>/img/new_text.gif' border=0>
<!-- 신규포스트 시작 -->
<table width="454" height="284" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" width="454">
<table width=95% cellpadding=0 cellspacing=0 align=center>
<?
$sql = " select * from {$gb4['post_table']} where secret=1 order by id desc limit 7 ";
$result = sql_query($sql);
for($i=0;$row=sql_fetch_array($result);$i++) {
if ($i>0) {
//echo "<tr><td height=5></td></tr>";
//echo "<tr><td height=1 bgcolor=#d2d2d2></td></tr>";
//echo "<tr><td height=5></td></tr>";
}
<tr>
<td valign=top width=454>
<img src='<?=$gb4['blog_path']?>/img/new_text.gif' border=0>
<!-- 신규포스트 시작 -->
<table width="454" height="284" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" width="454">
<table width=95% cellpadding=0 cellspacing=0 align=center>
<?
$sql = " select * from {$gb4['post_table']} where secret=1 order by id desc limit 7 ";
$result = sql_query($sql);
for($i=0;$row=sql_fetch_array($result);$i++) {
if ($i>0) {
//echo "<tr><td height=5></td></tr>";
//echo "<tr><td height=1 bgcolor=#d2d2d2></td></tr>";
//echo "<tr><td height=5></td></tr>";
}
$sql2 = " select mb_id, writer from {$gb4['blog_table']} where id = '$row[blog_id]' ";
$row2 = sql_fetch($sql2);
$row2 = sql_fetch($sql2);
$sql3 = " select category_name from {$gb4['category_table']} where id = '$row[category_id]' ";
$row3 = sql_fetch($sql3);
$row3 = sql_fetch($sql3);
if( empty($row3[category_name]) ) $row3[category_name] = '전체';
$title = $row[title];
$title = cut_str($title, 35);
$content = $row[content];
$content = strip_tags($content);
$content = cut_str($content, 230);
//$yymmdd = date("y-m-d", strtotime($row[post_date]));
$yymmdd2 = date("y-m-d", strtotime($row[real_date]));
$yymmdd2 = date("y-m-d", strtotime($row[real_date]));
$sql4 = " select * from {$gb4['file_table']} where post_id = '$row[id]' ";
$row4 = sql_fetch($sql4);
$row4 = sql_fetch($sql4);
//섬네일 관련 설정
$thumb2_width=100;//섬네일 최대폭
$thumb2_height=100;//섬네일 최대높이
$image = $row4[save_name]; // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
if(!is_file('$g4[path]/data/blog/file/$row2[mb_id]/thumb2_$image')){
include_once "$g4[path]/thumbEngine/dq_thumb_engine2.php";
$thumbsource="$g4[path]/data/blog/file/$row2[mb_id]/" . $image;
$thumbimg="$g4[path]/data/blog/file/$row2[mb_id]/thumb2_" . $image;
make_thumb($thumb2_width,$thumb2_height,$thumbsource,$thumbimg);
@chmod($thumbimg, 0606);
}
}
echo "<tr><td height=30 valign=middle>";
echo "<img src='$gb4[blog_path]/img/ico_list.gif' border=0> <span class='cloudy small'>[ </span><a style='cloudy small' href='".get_blog_url($row2[mb_id])."'>$row2[writer]님 Blog </a><span class='cloudy small'> / </span><a class='cloudy small' href='".get_category_url($row3[category_name], $row[mb_id])."'>$row3[category_name]</a><span class='cloudy small'> ]</span> ";
echo "<span style='font-weight:bold;letter-spacing:-1px;'><a href='".get_post_url($row[id],$row2[mb_id])."'>$title</a> <span class='small cloudy'>$yymmdd2</td></tr>";
//echo "<tr><td height=15 valign=middle>";
//echo "<span class='small cloudy'><img src='$gb4[blog_path]/img/update2.gif' border=0> $yymmdd2 <img src='$gb4[blog_path]/img/update.gif' border=0> $yymmdd </span> ";
//echo " <span class='small cloudy'><img src='$gb4[blog_path]/img/ico_hit.gif' border=0> $row[hit] <img src='$gb4[blog_path]/img/ico_reply.gif' border=0> $row[comment_count] <img src='$gb4[blog_path]/img/ico_tb.gif' border=0> $row[trackback_count] </span>";
//echo "</td></tr>";
echo "<img src='$gb4[blog_path]/img/ico_list.gif' border=0> <span class='cloudy small'>[ </span><a style='cloudy small' href='".get_blog_url($row2[mb_id])."'>$row2[writer]님 Blog </a><span class='cloudy small'> / </span><a class='cloudy small' href='".get_category_url($row3[category_name], $row[mb_id])."'>$row3[category_name]</a><span class='cloudy small'> ]</span> ";
echo "<span style='font-weight:bold;letter-spacing:-1px;'><a href='".get_post_url($row[id],$row2[mb_id])."'>$title</a> <span class='small cloudy'>$yymmdd2</td></tr>";
//echo "<tr><td height=15 valign=middle>";
//echo "<span class='small cloudy'><img src='$gb4[blog_path]/img/update2.gif' border=0> $yymmdd2 <img src='$gb4[blog_path]/img/update.gif' border=0> $yymmdd </span> ";
//echo " <span class='small cloudy'><img src='$gb4[blog_path]/img/ico_hit.gif' border=0> $row[hit] <img src='$gb4[blog_path]/img/ico_reply.gif' border=0> $row[comment_count] <img src='$gb4[blog_path]/img/ico_tb.gif' border=0> $row[trackback_count] </span>";
//echo "</td></tr>";
//echo "<tr><td height=5></td></tr>";
if ($image) {
echo "</table><table width=95% cellpadding=0 cellspacing=0 align=center>";
echo "<tr><td width=100 style='border:1px solid #CCCCCC; padding:3px'><img src='{$thumbimg}'></td><td width=10></td><td valign=top><span style='small'>{$content}</span></td></tr></table><table width=95% cellpadding=0 cellspacing=0 align=center>";
}
else {
echo "<tr><td><span style='small'>{$content}</span></td></tr>";
}
echo "<tr><td height=10></td></tr>";
echo "<tr><td height=1 bgcolor=#d2d2d2></td></tr>";
//echo "<tr><td height=10></td></tr>";
}
if ($image) {
echo "</table><table width=95% cellpadding=0 cellspacing=0 align=center>";
echo "<tr><td width=100 style='border:1px solid #CCCCCC; padding:3px'><img src='{$thumbimg}'></td><td width=10></td><td valign=top><span style='small'>{$content}</span></td></tr></table><table width=95% cellpadding=0 cellspacing=0 align=center>";
}
else {
echo "<tr><td><span style='small'>{$content}</span></td></tr>";
}
echo "<tr><td height=10></td></tr>";
echo "<tr><td height=1 bgcolor=#d2d2d2></td></tr>";
//echo "<tr><td height=10></td></tr>";
}
if ($i==0) {
echo "<tr><td height=100>새로 올라온 글이 아직 없습니다.</td></tr>";
}
?>
</table>
</td>
</tr>
</table>
<!-- 신규포스트 끝 -->
</td>
<td width=20> </td>
<td valign=top width=210>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td><img src='<?=$gb4['blog_path']?>/img/new_blogger.gif' border=0></td>
</tr>
<tr>
<td height=5></td>
</tr>
<tr>
<td><img src='<?=$gb4['blog_path']?>/img/new_blogger_head.gif' border=0></td>
</tr>
<tr>
<td bgcolor=#f7f7f7>
<table width=90% cellpadding=0 cellspacing=0 align=center>
<?
$sql = " select * from {$gb4['blog_table']} order by id desc ";
$result = sql_query($sql);
for($i=0;$row=sql_fetch_array($result);$i++) {
echo "<tr><td height=20><span class='cloudy'>·</span> ";
echo "<a href='".get_blog_url($row[mb_id])."'>";
echo $row[blog_name];
echo "</a> <span class='small cloudy'>(".(int)$row[post_count].")</span>";
echo "</td></tr>";
}
?>
</table>
</td>
</tr>
<tr>
<td><img src='<?=$gb4['blog_path']?>/img/new_blogger_tail.gif' border=0></td>
</tr>
</table>
</td>
</tr></table>
echo "<tr><td height=100>새로 올라온 글이 아직 없습니다.</td></tr>";
}
?>
</table>
</td>
</tr>
</table>
<!-- 신규포스트 끝 -->
</td>
<td width=20> </td>
<td valign=top width=210>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td><img src='<?=$gb4['blog_path']?>/img/new_blogger.gif' border=0></td>
</tr>
<tr>
<td height=5></td>
</tr>
<tr>
<td><img src='<?=$gb4['blog_path']?>/img/new_blogger_head.gif' border=0></td>
</tr>
<tr>
<td bgcolor=#f7f7f7>
<table width=90% cellpadding=0 cellspacing=0 align=center>
<?
$sql = " select * from {$gb4['blog_table']} order by id desc ";
$result = sql_query($sql);
for($i=0;$row=sql_fetch_array($result);$i++) {
echo "<tr><td height=20><span class='cloudy'>·</span> ";
echo "<a href='".get_blog_url($row[mb_id])."'>";
echo $row[blog_name];
echo "</a> <span class='small cloudy'>(".(int)$row[post_count].")</span>";
echo "</td></tr>";
}
?>
</table>
</td>
</tr>
<tr>
<td><img src='<?=$gb4['blog_path']?>/img/new_blogger_tail.gif' border=0></td>
</tr>
</table>
</td>
</tr></table>
<?
//include_once("./_tail.php");
include_once("./gblog.tail.php");
?>
//include_once("./_tail.php");
include_once("./gblog.tail.php");
?>
-----------------------------------------------------------
질문하신 분이 계셔서 공개합니다...
적용하시면 스샷처럼 바뀝니다...
#적용 방법
1.위 목록아이콘을 그누보드/blog/img에 업로드...
2.썸네일엔진 경로대로 업로드
[그누보드/thumbEngine]
3.gblog.index.php 덮어 씌우기...
#설정 예
몇개의 포스트를 뽑아올 것인가?? (7개인 경우의 예)
----------------------------------------
$sql = " select * from {$gb4['post_table']} where secret=1 order by id desc limit 7 ";
----------------------------------------
----------------------------------------
생성되는 썸네일 크기설정 관련...
----------------------------------------
$thumb2_width=100;//섬네일 최대폭
$thumb2_height=100;//섬네일 최대높이
$thumb2_height=100;//섬네일 최대높이
----------------------------------------
사용서버의 gd 썸네일의 버젼에 따라 썸네일이 제대로 생성되지 않을수도 있으며 이에대한 질문은 받지 않겠습니다...
댓글을 작성하시려면 로그인이 필요합니다.
댓글 1개
공개하여 주셨군요...
너무 감사 드립니다....
적용방법을 몰라서 상기 소스를 tag.php로 맹글고 인클루더로 왔으니 쩝~~~
참 한심한 꽃집남자 입니다 ㅜㅜ...
빨리 태스트 해보렵니다^^;;
행복하세요^^;;