Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.
Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

Stats

  • *Total Members: 4319
  • *Latest: thygrim

  • *Total Posts: 15775
  • *Total Topics: 2381
  • *Online Today: 2
  • *Most Online: 157
(27.08.09, 03:54:53)
  • *Users: 0
  • *Guests: 4
  • *Total: 4

Author Topic: Show categories on subforum but hide on main forum  (Read 2192 times)

0 Members and 0 Guests are viewing this topic.

Offline MiY4Gi

  • Innovator
  • Jr. Member
  • **
  • Posts: 64
  • Gender: Male
  • I bleed enthusiasm!
    • MyAnimeClub
Is it possible to hide categories on the main forum and then show those categories on a specific subforum?

I have specific categories which are designed for local (e.g. South African) users, and so I only want to show those categories on the South African subforum za.myforum.tld. However, as it is, the categories also show up on the main forum, something which do not want.

I've considered using Membergroups, but that won't work since I want all members to be able to access a subforum, not just those that are part of that membergroup.

I was thinking that one might need to create a new kind of Permission system that checks whether the user is at a specific subdomain/subforum, and then only serve the allowed board categories. So this permission would look at the current URL, and not at the user's membergroup.
Check out my new anime club. Discuss and share anime, or just fool around with other forumites. Join us at MyAnimeClub.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
Re: Show categories on subforum but hide on main forum
« Reply #1 on: 07.08.12, 21:06:45 »
I do not have a public "main forum" only admin access... all my forums will be subdomains

Maybe you like that way

Offline MiY4Gi

  • Innovator
  • Jr. Member
  • **
  • Posts: 64
  • Gender: Male
  • I bleed enthusiasm!
    • MyAnimeClub
Re: Show categories on subforum but hide on main forum
« Reply #2 on: 07.08.12, 22:29:37 »
I considered having my main forum restricted to admins, but it won't work for me. In my case I actually have a main forum that's designed for the general public, and many subforum's which are designed for smaller specific groups of the public.
Check out my new anime club. Discuss and share anime, or just fool around with other forumites. Join us at MyAnimeClub.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5584
  • Gender: Female
Re: Show categories on subforum but hide on main forum
« Reply #3 on: 09.08.12, 11:24:16 »
Is it possible to hide categories on the main forum and then show those categories on a specific subforum?
That is not possible .. the Main Forum is the "normal" SMF installation.
You can protect the Main forum, that only member with Admin rights have access (check Admin access only in the Subforum configuration).
Many are stubborn in relation to the path, a few in relation to the target.

Offline luuuciano

  • Jr. Member
  • **
  • Posts: 85
  • Gender: Male
Re: Show categories on subforum but hide on main forum
« Reply #4 on: 10.08.12, 03:17:51 »
I considered having my main forum restricted to admins, but it won't work for me. In my case I actually have a main forum that's designed for the general public, and many subforum's which are designed for smaller specific groups of the public.

Well... maybe you can start showing that general forum as a subdomain too...

Offline MiY4Gi

  • Innovator
  • Jr. Member
  • **
  • Posts: 64
  • Gender: Male
  • I bleed enthusiasm!
    • MyAnimeClub
Re: Show categories on subforum but hide on main forum
« Reply #5 on: 11.08.12, 01:09:51 »
If anyone's interested I did it by editing my theme.

Open: /Themes/YOUR_THEME/BoardIndex.template.php

Find:

Code: (find) [Select]
foreach ($context['categories'] as $category)
{

Code: (add after) [Select]
        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.

Demo:     http://myanimeclub.net
Alias 1:    http://za.myanimeclub.net
Alias 2:    http://us.myanimeclub.net
Check out my new anime club. Discuss and share anime, or just fool around with other forumites. Join us at MyAnimeClub.