메인화면에 최신글에 코멘트 나오는 문제점 정보
메인화면에 최신글에 코멘트 나오는 문제점본문
latest.skin.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style type="text/css">
<!---
BODY
A:link { TEXT-DECORATION: none;}
A:visited { TEXT-DECORATION: none;}
A:active { TEXT-DECORATION: none;}
A:hover { TEXT-DECORATION: none;}
--->
</style>
<table width=100% cellpadding=0 cellspacing=0 border=0 align="center">
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style type="text/css">
<!---
BODY
A:link { TEXT-DECORATION: none;}
A:visited { TEXT-DECORATION: none;}
A:active { TEXT-DECORATION: none;}
A:hover { TEXT-DECORATION: none;}
--->
</style>
<table width=100% cellpadding=0 cellspacing=0 border=0 align="center">
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td height=25 style='padding-top:3px;'><font style="font-size:8pt;" color="#999999"><img src='<?=$latest_skin_path?>/img/la_icon.gif' align=absmiddle>
<?
$style = "font-family:돋움; font-size:9pt; color:#393939;";
if ($list[$i][icon_new])
$style = " style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],34)."</span>"; //제목 글자수 자르기 - 꼭 여기서 지정하세요.
<tr>
<td height=25 style='padding-top:3px;'><font style="font-size:8pt;" color="#999999"><img src='<?=$latest_skin_path?>/img/la_icon.gif' align=absmiddle>
<?
$style = "font-family:돋움; font-size:9pt; color:#393939;";
if ($list[$i][icon_new])
$style = " style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],34)."</span>"; //제목 글자수 자르기 - 꼭 여기서 지정하세요.
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}' title='{$list[$i][subject]}'>";
if ($list[$i][is_notice])
echo "<strong>{$subject}</strong></a>";
else
echo "{$subject}</a>";
echo "<a href='{$list[$i][href]}' title='{$list[$i][subject]}'>";
if ($list[$i][is_notice])
echo "<strong>{$subject}</strong></a>";
else
echo "{$subject}</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
echo " " . $list[$i][icon_new];
?></font>
</td>
<td width=30 style='padding-top:4px;' align='center'><span style="color:rgb(170,191,234);"><font size="2" color="#999999"><?=$list[$i][datetime2]?></font></span></td>
</tr>
<tr><td height=1 colspan=2 bgcolor='#E1EBD3'></td></tr>
<? } ?>
?></font>
</td>
<td width=30 style='padding-top:4px;' align='center'><span style="color:rgb(170,191,234);"><font size="2" color="#999999"><?=$list[$i][datetime2]?></font></span></td>
</tr>
<tr><td height=1 colspan=2 bgcolor='#E1EBD3'></td></tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td align=center height=100><font color=#6A6A6A size="2">게시물이 없습니다.</font></td>
<td><font size="2"> </font></td>
</tr><? } ?>
<td><font size="2"> </font></td>
</tr><? } ?>
</table>
latest.lib.php
<?
if (!defined('_GNUBOARD_')) exit;
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40)
{
global $config;
global $g4;
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40)
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$board = sql_fetch($sql);
$tmp_write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment >-1 and wr_reply = '' order by wr_id desc limit 0, $rows ";
// $sql = " select * from $tmp_write_table where wr_comment >-1 and wr_reply = '' order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
$sql = " select * from $tmp_write_table where wr_is_comment >-1 and wr_reply = '' order by wr_id desc limit 0, $rows ";
// $sql = " select * from $tmp_write_table where wr_comment >-1 and wr_reply = '' order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
function latest_schedule($skin_dir='', $bo_table)
{
global $config;
global $g4;
global $year, $month;
}
function latest_schedule($skin_dir='', $bo_table)
{
global $config;
global $g4;
global $year, $month;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin_path = "./$g4[path]/skin/latest/$skin_dir";
}
if ($skin_dir) {
$latest_skin_path = "./$g4[path]/skin/latest/$skin_dir";
}
$write_table = $g4[write_prefix] . $bo_table;
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
<p> </p>
}
?>
<p> </p>
댓글 전체
(1) <-- 요걸 없애야 한다는 말씀인지....
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
공백라인이 있다는 말씀인지..??
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
공백라인이 있다는 말씀인지..??
아마도 답변글에 대한 최신글 같군요
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/682 여기 참고하시길
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/682 여기 참고하시길
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
이부분을 주석처리하면 됩니다.
/*
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
*/
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
이부분을 주석처리하면 됩니다.
/*
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:9pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
*/
예전그누에는 wr_is_comment >-1 로 했었나 보내요...내공이 워낙 얇아서;;;
요즘은 wr_is_comment = 0 으로 하지 않나요? 이러면 코멘트는 걸르죠
wr_reply = '' 는 답글도 제외죠. 정확히 멀 원하시는지가 더 궁금하다는...-_-;
요즘은 wr_is_comment = 0 으로 하지 않나요? 이러면 코멘트는 걸르죠
wr_reply = '' 는 답글도 제외죠. 정확히 멀 원하시는지가 더 궁금하다는...-_-;