Topic: Only display one Category
Hello
First, sorry for my English
I made a little modification that can interest someone ! (I am a newbie in php code)
You can display only the category of your choice while clicking on it !
You can see it in action here
Edit 'index.php'
Search
// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
Replace with
if (isset($c))
$extra = $_GET['c'];
else
$c = 0;
if ($c == 0)
// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
else
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE c.id='.$extra.' AND (fp.read_forum IS NULL OR fp.read_forum=1) ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
Search
<div id="idx<?php echo $cat_count ?>" class="blocktable">
<h2><span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span></h2>
Replace with
<div id="idx<?php echo $cat_count ?>" class="blocktable">
<h2><span><?php if ($c == 0) echo '<a href="index.php?c='.$cur_forum['cid'].'">'.pun_htmlspecialchars($cur_forum['cat_name']).'</a>'; else echo '<a href="index.php">'.pun_htmlspecialchars($cur_forum['cat_name']).'</a>'; ?></span></h2>
Et voilà
Multy Forums Free (Multi PunBB Project) (on stand by)
http://multy.forums.free.fr/forum_demo/