News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom Theme for visitors

Started by wolfetundra, December 13, 2011, 02:19:22 PM

Previous topic - Next topic

wolfetundra

Simply put, I'm running an "adult theme" that I don't want visible to visitors. However, I don't want to have to convert each new member to the new theme. Is there a way to set it up so you can only see the "adult theme" when logged in?

kat

Only way that springs to mind is to make a "Non-adult" theme the forum default theme.

Of course, that'll mean that your members will need to select a theme, if they don't want to use that one.

wolfetundra

The only thing that works right now is to run a default "non adult theme" and, as new members join, manually switch members via "profile settings" to the "adult theme".

I've seen a modification that works based on groups ...
Quote from: akabugeyes on October 05, 2006, 05:37:21 PM
Well, a simple way to do this is to edit the LoadTheme() function in Sources/Load.php and do something like this:

Find:
else
$ID_THEME = (int) $ID_THEME;


Add after:

// Override!
if(in_array(<id of group>, $user_info['groups']))
$ID_THEME = <The id of the theme to go with this group>;
else if(in_array(<The id of the theme to go with this group>, $user_info['groups']))
$ID_THEME = <The id of the theme to go with this group>;


Replacing the text inside < > (and including the < >!) with the appropriate ids. If a member is in both groups, they would be given the theme first mentioned in the code above. Members not in these two groups would not have a theme override, but I can help you include more groups if you need to, or make it so that each theme has a range of groups to assign that theme to.

However, I don't know if this would work for me as there is no "group_id" for "visitors/guests". Also, I have multiple groups so I'm not sure how that work work either. This is specifically designed for 2 groups.

Ozzie

if you are running smf2.0.1 load this mod using emulation for rc4 it works perfectly well and allows permissions to be set per user group on each theme so if you set all the one you dont want guests to see it should do as you require it works perfectly well on my site


http://custom.simplemachines.org/mods/index.php?mod=1422

2000+ games available to download

wolfetundra

That worked beautifully!

I had some issues installing it but it worked fine after that.

kat


Advertisement: