How can I go about restricting forum user privileges based on the URL of the current page? I use different URL aliases for my forum and I want each alias to serve different content, such as boards, categories, menu items, etc. Specifically, I want the main site to hide certain categories, and then have those hidden categories displayed at a different site alias/subdomain. I just can't figure out how to hide categories from the main site purely based on the site's URL.
E.g. myforum.tld would display the forum categories 1 and 2 (where 3 and 4 are hidden), while za.myforum.tld would display the forum categories 1, 2, 3 and 4.
I assume I'll need to create a new variable which looks at the current URL, and if the URL matches a certain predefined pattern, then if(variable) would return true, or something along those lines. I'm not really sure what to do, so I'm just thinking up random suggestions that feel like they might work.
Is there already a SMF function that can check the current URL?
Nevermind. I did it using my theme.
Open: /Themes/YOUR_THEME/BoardIndex.template.php
Find:
foreach ($context['categories'] as $category)
{
if($_SERVER['SERVER_NAME'] == 'myanimeclub.net' && in_array($category['id'], array(2,3))) continue;
Note that the above code is what I use on my forum (SMF 2.0.2) so you'll need to replace myanimeclub.net with your site's domain, and the 2,3 in array(2,3) with the ID's of the categories you'd like to hide at the site domain you specified.