 |
 |
 |
 |
#255709 - 08/05/03 11:07 AM
Re: question about all this "subforums" talk
[Re: bisbell]
|
Addict
Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
|
I've done something like this, to show the forums of selected categories separately with a tiny little hack to ubbthreads.php. Basically, it only shows a set of given categories if they've been specifically asked for in the Cat value in the url. Thus, it is possible to link to a page where this category is shown, without it coming up on the main index.<br /><br />Find this in ubbthreads.php:<br /> if ( ($C) && ($catsonly == "categories") ) {<br /> $catonly = "WHERE Cat_Number = '$C'";<br /> }<br /><br />Add this below:<br /> // -------------------------------------------------------<br />// Hack: Don't show category unless specifically asked for<br /> $catarr = split(",", $Cat);<br /> $nocats = split(",",$config['dontshowcat']);<br /> $dontshow = ""; $sep = "";<br /> while (list($k, $v) = each($nocats)) {<br /> if ( !in_array($v, $catarr) ) {<br /> $dontshow .= $sep . "'$v'";<br /> $sep = ",";<br /> }<br /> }<br /> if ($dontshow != "") {<br /> if ( !$catonly ) {<br /> $catonly = "WHERE";<br /> } else {<br /> $catonly .= " AND";<br /> }<br /> $catonly .= " Cat_Number NOT IN ($dontshow)";<br /> }<br /><br /><br />Then add this to your config file:<br />$config['dontshowcat'] = '3,5';<br /><br />The values of this should be one or more of the numbers of the categories that you don't want shown on the main index, separated by a comma, without any extra spaces.<br />
|
|
Top
|
|
|
|
 |
 |
 |
 |
| |