팁텍 최신글 스킨에 답변글 RE 아이콘 나오게 하기
페이지 정보
본문
lib 폴더에 있는
latest.lib.php의 소스중 // 코멘트 카운트 부분에 다음 내용을 추가 합니다.
$list[$i][re] = "";
if ($row[wr_reply] == "A") {
$list[$i][re] = "<img src='$latest_skin/icon_reply.gif' align=absmiddle>";
}
그리고 최신글 스킨에latest.skin.php 을 수정합니다
<?=$list[$i][subject]?> 앞에다가 <?=$list[$i][re]?>를 넣어 줍니다.
<?=$list[$i][re]?><?=$list[$i][subject]?> 게 되겠죠?
그림 re 아이콘이 나옵니다..
그리고 최신글 스킨 폴더에 icon_reply.gif 이미지를 넣습니다..
간단팁이지만... 좋은 팁이 되었으면 좋겠네요 ^^*
아래는 수정한 파일소스 입니다.
----------------------- 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][re] = "";
if ($row[wr_reply] == "A") {
$list[$i][re] = "<img src='$latest_skin/icon_reply.gif' align=absmiddle>";
}
$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 ----------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% bgcolor=#FFFFFF cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=10></td></tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i) { echo "<tr><td colspan=2 height=1 background='$latest_skin/dot_line.gif'></td></tr>"; } ?>
<tr>
<td width=30 align=center><img src='<?=$latest_skin?>/icon_li.gif'></td>
<td width='' height=20><a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=content><?=$list[$i][re]?><?=$list[$i][subject]?> <span style='font-size:8pt;'><?=$list[$i][commentcnt]?></span></span></a> <?=$list[$i][icon_new]?></td>
</tr>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td colspan=2 align=center height=50>자료가 없습니다.</td></tr>"; } ?>
<tr><td colspan=2 height=5></td></tr>
</table>
//와우맨님
출처는 아래 링크.......
latest.lib.php의 소스중 // 코멘트 카운트 부분에 다음 내용을 추가 합니다.
$list[$i][re] = "";
if ($row[wr_reply] == "A") {
$list[$i][re] = "<img src='$latest_skin/icon_reply.gif' align=absmiddle>";
}
그리고 최신글 스킨에latest.skin.php 을 수정합니다
<?=$list[$i][subject]?> 앞에다가 <?=$list[$i][re]?>를 넣어 줍니다.
<?=$list[$i][re]?><?=$list[$i][subject]?> 게 되겠죠?
그림 re 아이콘이 나옵니다..
그리고 최신글 스킨 폴더에 icon_reply.gif 이미지를 넣습니다..
간단팁이지만... 좋은 팁이 되었으면 좋겠네요 ^^*
아래는 수정한 파일소스 입니다.
----------------------- 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][re] = "";
if ($row[wr_reply] == "A") {
$list[$i][re] = "<img src='$latest_skin/icon_reply.gif' align=absmiddle>";
}
$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 ----------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% bgcolor=#FFFFFF cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=10></td></tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i) { echo "<tr><td colspan=2 height=1 background='$latest_skin/dot_line.gif'></td></tr>"; } ?>
<tr>
<td width=30 align=center><img src='<?=$latest_skin?>/icon_li.gif'></td>
<td width='' height=20><a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=content><?=$list[$i][re]?><?=$list[$i][subject]?> <span style='font-size:8pt;'><?=$list[$i][commentcnt]?></span></span></a> <?=$list[$i][icon_new]?></td>
</tr>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td colspan=2 align=center height=50>자료가 없습니다.</td></tr>"; } ?>
<tr><td colspan=2 height=5></td></tr>
</table>
//와우맨님
출처는 아래 링크.......
관련링크
댓글목록
등록된 댓글이 없습니다.