팁텍 블로그형 스킨에서 카테고리 제목별 출력
페이지 정보
본문
side.php에 다음 소스 적용
=================================== 변경전 소스 =======================
<!-- 카테고리 부분 -->
<? if ($is_category) { ?>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>
<TBODY>
<TR align=middle>
<TD bgColor=#cccccc>
<TABLE cellSpacing=1 width=100% border=0>
<TBODY>
<TR align=middle bgColor=#ffffff>
<TD height=22>
<TABLE height=22 cellSpacing=0 cellPadding=0 width=95% border=0>
<TBODY>
<TR><TD vAlign=center align=middle height=3>카테고리</td></tr>
</tbody>
</table>
</td>
</tr>
<TR align=middle bgColor=#e0e0e0>
<TD height=22>
<table width=100%>
<tr>
<form name=fcategory method=get action='<?="./"?>'>
<input type=hidden name=doc value='<?=$doc?>'>
<td width=50% align=center>
<select name=ca_id onchange="location='<?=$category_location?>'+this.value;" class=select style='width:98%'>
<option value=''>전체(<?=nf($total_count)?>)</option>
<?=$category_option?>
</select>
</td>
</form>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<BR>
<BR>
<? } ?>
<!-- 카테고리 끝 -->
====================================================================
=================================== 변경후 소스 =======================
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
function get_category($bo_table)
{
global $cfg, $stext, $board_skin, $doc, $is_image;
$ca_sql = " select * from {$cfg[write_table_prefix]}{$bo_table}_cat order by ca_id ";
$ca_result = sql_query($ca_sql);
$loc = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&sselect=ca_id&stext=";
// 카테고리가 텍스트 일때
if(!$stext){
$str = "<table cellspacing=0 cellpadding=0 width=100% align=center border=0><tr><td align=left width=100% height=20><b> :: <a href=$loc>전체보기</a></b></td></tr>< /table>\n";
} else {
$str = "<table cellspacing=0 cellpadding=0 width=100% align=center border=0><tr><td align=left width=100% height=20><b> :: <a href=$loc>전체보기</a></b></td></tr>< /table>\n";
}
while ($row = mysql_fetch_array($ca_result)) {
if($stext == $row[ca_id]) $str .= "<b>";
$str .= "<table cellspacing=0 cellpadding=0 width=100% align=center border=0><tr><td height=20 width=100%> <a href=$loc$row[ca_id]>".get_category_name("{$cfg[write_table_prefix]}{$bo_table}",$row[ca_id])."</a></td></tr></table>";
if($stext == $row[ca_id]) $str .= "</b>";
$str .= "<table width=100%><tr><td height=1 background='$board_skin/dot.gif'></td></tr></table>\n";
}
mysql_free_result($ca_result);
return $str;
}
?>
<!-- 카테고리 부분 -->
<? if ($is_category) { ?>
<? echo get_category($bo_table); ?>
<br>
<br>
<? } ?>
<!-- 카테고리 끝 -->
====================================================================
[이 게시물은 까만도둑님에 의해 2004-06-06 22:33:24 자료실(으)로 부터 이동됨]
=================================== 변경전 소스 =======================
<!-- 카테고리 부분 -->
<? if ($is_category) { ?>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>
<TBODY>
<TR align=middle>
<TD bgColor=#cccccc>
<TABLE cellSpacing=1 width=100% border=0>
<TBODY>
<TR align=middle bgColor=#ffffff>
<TD height=22>
<TABLE height=22 cellSpacing=0 cellPadding=0 width=95% border=0>
<TBODY>
<TR><TD vAlign=center align=middle height=3>카테고리</td></tr>
</tbody>
</table>
</td>
</tr>
<TR align=middle bgColor=#e0e0e0>
<TD height=22>
<table width=100%>
<tr>
<form name=fcategory method=get action='<?="./"?>'>
<input type=hidden name=doc value='<?=$doc?>'>
<td width=50% align=center>
<select name=ca_id onchange="location='<?=$category_location?>'+this.value;" class=select style='width:98%'>
<option value=''>전체(<?=nf($total_count)?>)</option>
<?=$category_option?>
</select>
</td>
</form>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<BR>
<BR>
<? } ?>
<!-- 카테고리 끝 -->
====================================================================
=================================== 변경후 소스 =======================
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
function get_category($bo_table)
{
global $cfg, $stext, $board_skin, $doc, $is_image;
$ca_sql = " select * from {$cfg[write_table_prefix]}{$bo_table}_cat order by ca_id ";
$ca_result = sql_query($ca_sql);
$loc = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&sselect=ca_id&stext=";
// 카테고리가 텍스트 일때
if(!$stext){
$str = "<table cellspacing=0 cellpadding=0 width=100% align=center border=0><tr><td align=left width=100% height=20><b> :: <a href=$loc>전체보기</a></b></td></tr>< /table>\n";
} else {
$str = "<table cellspacing=0 cellpadding=0 width=100% align=center border=0><tr><td align=left width=100% height=20><b> :: <a href=$loc>전체보기</a></b></td></tr>< /table>\n";
}
while ($row = mysql_fetch_array($ca_result)) {
if($stext == $row[ca_id]) $str .= "<b>";
$str .= "<table cellspacing=0 cellpadding=0 width=100% align=center border=0><tr><td height=20 width=100%> <a href=$loc$row[ca_id]>".get_category_name("{$cfg[write_table_prefix]}{$bo_table}",$row[ca_id])."</a></td></tr></table>";
if($stext == $row[ca_id]) $str .= "</b>";
$str .= "<table width=100%><tr><td height=1 background='$board_skin/dot.gif'></td></tr></table>\n";
}
mysql_free_result($ca_result);
return $str;
}
?>
<!-- 카테고리 부분 -->
<? if ($is_category) { ?>
<? echo get_category($bo_table); ?>
<br>
<br>
<? } ?>
<!-- 카테고리 끝 -->
====================================================================
[이 게시물은 까만도둑님에 의해 2004-06-06 22:33:24 자료실(으)로 부터 이동됨]
댓글목록
등록된 댓글이 없습니다.