한줄처리한 카테고리 클릭시 외부 검색 입력폼에 숫자가 표시 되어집니다.
카테고리를 한줄처리하였고
루트님의 카테고리 개수를 한줄에 4개가 아닌 다른 갯수로 수정
http://www.sir.co.kr/?doc=bbs/gnuboard.php&bo_table=qa&wr_id=13446
저의 developer.lib.php 소스입니다.
===================================
// 개발자(사용자) 라이브러리
function get_category_list($table,$loc)
{
global $cfg, $stext;
$sql = " select * from {$table}_cat order by ca_id ";
$result = sql_query($sql);
if(!$stext){
$str = "<b>[ <a href=$loc>전체 </a> ]</b> ";
} else {
$str = "[ <a href=$loc>전체</a> ] ";
}
//=============추가 카테고리임의개수지정
$cnt = 1;
$colnum = 5; // 한줄에 보여주고 싶은 카테고리 개수
while ($row = mysql_fetch_array($result)) {
$brchk = $cnt++%$colnum;
if($stext == $row[ca_id]) $str .= "<b><font color=red>";
$str .= " [ <a href=$loc$row[ca_id]><font color=0099cc>".get_category_name($table,$row[ca_id])."</font></a> ] ";
if($stext == $row[ca_id]) $str .= "</font></b>";
if($brchk == $colnum-1) $str .= "<br>";
//===========추가끝
}
mysql_free_result($result);
return $str;
}
==============================================================
저의 gblist.skin.php에서 카테고리 한줄처리를 위해 수정한부분
=======================================================
<!--<? if ($is_category) { ?>
<select name=ca_id onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option>
<?=$category_option?>
</select>
<? } ?> -->//이부분주석처리
<? //카테고리 한줄처리
if ($is_category) {
echo "<input type=hidden name=ca_id>";
echo get_category_list("$cfg[write_table_prefix]$bo_table",$category_location);
} ?>
=================================================================================
글목록에 가면 한줄처리가 잘되었습니다.
카테고리를 왼쪽부터 [전체]-[일부]-[예제]-[등등] 클릭을 하면
상단 외부검색입력폼에 숫자가 나와버립니다.
전체 =>0, 일부=>1, 예제=>2, 등등=>3 이렇게 차례대로 나오는데요
도대체 이게 왜 나오는건지 도저히 모르겠네요
루트님의 카테고리 개수를 한줄에 4개가 아닌 다른 갯수로 수정
http://www.sir.co.kr/?doc=bbs/gnuboard.php&bo_table=qa&wr_id=13446
저의 developer.lib.php 소스입니다.
===================================
// 개발자(사용자) 라이브러리
function get_category_list($table,$loc)
{
global $cfg, $stext;
$sql = " select * from {$table}_cat order by ca_id ";
$result = sql_query($sql);
if(!$stext){
$str = "<b>[ <a href=$loc>전체 </a> ]</b> ";
} else {
$str = "[ <a href=$loc>전체</a> ] ";
}
//=============추가 카테고리임의개수지정
$cnt = 1;
$colnum = 5; // 한줄에 보여주고 싶은 카테고리 개수
while ($row = mysql_fetch_array($result)) {
$brchk = $cnt++%$colnum;
if($stext == $row[ca_id]) $str .= "<b><font color=red>";
$str .= " [ <a href=$loc$row[ca_id]><font color=0099cc>".get_category_name($table,$row[ca_id])."</font></a> ] ";
if($stext == $row[ca_id]) $str .= "</font></b>";
if($brchk == $colnum-1) $str .= "<br>";
//===========추가끝
}
mysql_free_result($result);
return $str;
}
==============================================================
저의 gblist.skin.php에서 카테고리 한줄처리를 위해 수정한부분
=======================================================
<!--<? if ($is_category) { ?>
<select name=ca_id onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option>
<?=$category_option?>
</select>
<? } ?> -->//이부분주석처리
<? //카테고리 한줄처리
if ($is_category) {
echo "<input type=hidden name=ca_id>";
echo get_category_list("$cfg[write_table_prefix]$bo_table",$category_location);
} ?>
=================================================================================
글목록에 가면 한줄처리가 잘되었습니다.
카테고리를 왼쪽부터 [전체]-[일부]-[예제]-[등등] 클릭을 하면
상단 외부검색입력폼에 숫자가 나와버립니다.
전체 =>0, 일부=>1, 예제=>2, 등등=>3 이렇게 차례대로 나오는데요
도대체 이게 왜 나오는건지 도저히 모르겠네요
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 1개
검색어 검색 숫자
옵션 AND