index.php 의 178줄 부분이다. 다음과 같이 고치면 본 블로그 카테고리와 같이 글의 갯수를 보여 준다.
if (strpos($d1, "")) {
//전체 갯수를 구해옴
$sql = "select count(*) from t3_".$dbid." where is_public = '1'";
$result_1 = @mysql_query($sql);
$temp_1=mysql_fetch_array($result_1);
$total_1=$temp_1[0];
$rtval = array("label"=>"분류 전체보기 ($total_1)", "link"=>"location.href='index.php?nc=1';");
$g_array = array();
$m_array = array();
$sql = "select no, sortno, label from t3_".$dbid."_&&&ct1 order by sortno asc";
$result = @mysql_query($sql);
while(list($pno, $psortno, $plabel) = @mysql_fetch_array($result)) {
$sql = "select no, sortno, label from t3_".$dbid."_ct2 where pno = $pno order by sortno asc";
$result2 = @mysql_query($sql);
while(list($no, $sortno, $label) = @mysql_fetch_array($result2)) {
//카테고리2의 갯수 세기
$sql_2 = "select count(*) from t3_".$dbid." where is_public = '1' and category2='$no'";
$result_2 = @mysql_query($sql_2);
$temp_2 = mysql_fetch_array($result_2);
$total_2=$temp_2[0];
array_push($m_array, array("num"=>$no, "label"=>"$label ($total_2)" , "link"=>"location.href='index.php?&&&ct1=$pno&ct2=$no';"));
}
//카테고리1의 갯수 세기
$sql_1 = "select count(*) from t3_".$dbid." where is_public = '1' and category1='$pno'";
$result_1 = @mysql_query($sql_1);
$temp_1 = mysql_fetch_array($result_1);
$total_1=$temp_1[0];
array_push($g_array, array("num"=>$pno, "label"=>"$plabel ($total_1)", "link"=>"location.href='index.php?&&&ct1=$pno';", "items"=>$m_array));
$m_array = array();
}
if (count($g_array)) {
ob_start();
print_tree($rtval, $g_array, $p_tree_limit, $s_tree_path.$p_tree."/",0);
$tree_str = ob_get_contents();
ob_end_clean();
}
$d1 = str_replace("", $tree_str, $d1);
}
Comments
Got something to add? You can just leave a comment.
Your Reaction Time!