SunChase |
|
---|---|
Trying to make the lists show the subcategories.
Took some things from an old news plugin and inserted them in the list: $jj = 0; $mtch = $sed_cat[$c]['path']."."; $mtchlen = strlen($mtch); $catsub = array(); $catsub[] = $c; foreach($sed_cat as $i => $x) { if (substr($x['path'], 0, $mtchlen)==$mtch && sed_auth('page', $i, 'R')) { $catsub[] = $i; } } and else { sed_die(empty($sed_cat[$c]['title']) && !$usr['isadmin']); $sql = sed_sql_query("SELECT COUNT(*) FROM $db_pages WHERE page_cat='$c' AND (page_state='0' OR page_state='2')"); $totallines = sed_sql_result($sql, 0, 0); $sql = sed_sql_query("SELECT p.*, u.user_name ".$join_ratings_columns." FROM $db_pages as p ".$join_ratings_condition." LEFT JOIN $db_users AS u ON u.user_id=p.page_ownerid WHERE page_state=0 AND page_cat NOT LIKE 'system' AND page_cat IN ('".implode("','", $catsub)."') ORDER BY page_$s $w LIMIT $d,".$cfg['maxrowsperpage']); } The subcategories are shown,but the LIST_ROWCAT_... tags stoped working + dont know how to edit the $catpath so it would show the proper category name. Tried to edit the sql so it would get the category name from the structure_title field : $sql = sed_sql_query("SELECT p.*, u.user_name ,s.structure_code ,s.structure_title ".$join_ratings_columns." FROM $db_pages p , $db_users u ,$db_structure s WHERE page_state=0 AND page_cat NOT LIKE 'system' AND p.page_cat=s.structure_code AND u.user_id=p.page_ownerid AND page_cat IN ('".implode("','", $catsub)."') ORDER BY page_$s $w LIMIT $d,".$cfg['maxrowsperpage']); "CAT" => $row['structure_title'], but dont know how to do it correctly. This is the first time i'm trying to edit something massive as list.php. [url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
|