Hiding forums from a specific category

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
Johan-NL
Registered User
Posts: 92
Joined: Thu Aug 07, 2008 8:37 am
Location: Netherlands

Hiding forums from a specific category

Post by Johan-NL » Wed Dec 15, 2010 8:17 pm

Hi there,

For a new project, I've installed two identical forums with the same database. The idea is this: Category 1 (all), category 2 (forum1-only), category 3 (forum2-only), category 4 (all). The thing I have problems with is hiding category 2 from the second forum, and hiding category 3 from the first forum.

What I did so far:
In ./includes/function_display.php I added

Code: Select all

'FORUM_PARENT_ID'        => $row['parent_id'], 
to the correct function. To test it, I made the forums in ./styles/prosilver/template/forumlist_body.html display the parent ID. The variable worked.

When I put it in an IF-statement, like <!-- IF forumrow.FORUM_PARENT_ID != 5 --> Test <!-- ENDIF --> it worked. Note: I put those code at the end of the forum description, the forums in the cat with ID 5 weren't displaying it, the others were.

However, now I tried to put it around the code where the forums are generated in the forumlist_body.html, it still displays the forums with the parent ID of 5.

forumlist_body.html:
http://pastebin.com/Lpd2tnxj

User avatar
Johan-NL
Registered User
Posts: 92
Joined: Thu Aug 07, 2008 8:37 am
Location: Netherlands

Re: Hiding forums from a specific category

Post by Johan-NL » Fri Dec 17, 2010 12:33 pm

JimA helped me over Live Messenger:


OPEN
./includes/functions_display.php

FIND

Code: Select all

		$root_data = array('forum_id' => 0);
		$sql_where = '';
REPLACE WITH

Code: Select all

		$root_data = array('forum_id' => 0);
		$sql_where = 'f.forum_id <> 5';
(5 should be replaced with the forum_id of the category which shouldn't be shown :)



Many thanks to JimA <3

Locked

Return to “[3.0.x] MOD Writers Discussion”