Page 1 of 1

phpBB 2 forums Question

Posted: Sat Sep 25, 2004 6:43 am
by Calimero
For all those who have this forum:

In the forum index page - when it loads, you can see categories > forums listing, but they are all expanded, and when you click on one category, other shrink and you get the one you need (point is that the space is preserved - for better overview of the categories - for those who havent met with this type of forum before)


Is there a way (and in what file) - to add this Javascript or php code.

I am administering this forum for the fist time, and havent find a spot/place - where to insert this code.

This is the idea for the code - If not good, do comment:
So basicaly - in computer mind I would tell him not to load forums (because he does it right now - I pressume), and then when clicked on some of them - just to tell him to do as it does right now - to open only that category.

Thanks Ahead !

Posted: Sat Sep 25, 2004 8:51 am
by John Cartwright
your more likely to get a better response @ phpbb2.com

Posted: Sat Sep 25, 2004 10:40 am
by feyd

Code: Select all

$viewcat = ( !empty($HTTP_GET_VARSїPOST_CAT_URL]) ) ? $HTTP_GET_VARSїPOST_CAT_URL] : -1;

Code: Select all

//
		// Should we display this category/forum set?
		//
		$display_forums = false;
		for($j = 0; $j < $total_forums; $j++)
		{
			if ( $is_auth_aryї$forum_dataї$j]ї'forum_id']]ї'auth_view'] && $forum_dataї$j]ї'cat_id'] == $cat_id )
			{
				$display_forums = true;
			}
		}

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if ( $display_forums )
		{
			$template->assign_block_vars('catrow', array(
				'CAT_ID' => $cat_id,
				'CAT_DESC' => $category_rowsї$i]ї'cat_title'],
				'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
			);

			if ( $viewcat == $cat_id || $viewcat == -1 )
			{
				for($j = 0; $j < $total_forums; $j++)
				{
					if ( $forum_dataї$j]ї'cat_id'] == $cat_id )
					{
						$forum_id = $forum_dataї$j]ї'forum_id'];

						if ( $is_auth_aryї$forum_id]ї'auth_view'] )
						{
							if ( $forum_dataї$j]ї'forum_status'] == FORUM_LOCKED )
							{
								$folder_image = $imagesї'forum_locked']; 
								$folder_alt = $langї'Forum_locked'];
							}
							else
							{

....

Posted: Mon Sep 27, 2004 2:25 am
by Calimero
Haven't tested it yet,

But Thanks a lot.

Posted: Mon Sep 27, 2004 2:47 am
by feyd
there's nothing to test in that.. it's just straight copy and paste from the phpbb source code.

..

Posted: Mon Sep 27, 2004 2:52 am
by Calimero
oh,
Okay ! :D