MyBB Community Forums
Theme based on user group - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: Theme based on user group (/thread-85841.html)



Theme based on user group - eteanga - 2011-01-08

This might be pushing the limits of MyBB but I dont' know Smile

For non-admin activated users, I want them to see one theme (the navigation bar will, for example, include a Buy Now link).

For activated users, I want them to see another theme (different navigation links available to them).

Is this a configuration I could set up somehow to force different themes based on user group membership?


RE: Theme based on user group - - G33K - - 2011-01-08

Its doable if its between admins, users or guests but other than that you'll need a plugin. You could try the conditionals in templates plugin or request a plugin specific for this.



RE: Theme based on user group - eteanga - 2011-01-08

Ok, I won't approach it that way then.

In my own site, I check if the person is a subscribing member by looking at the PHP $s->user->isLoggedIn().

I guess I could also call that PHP method from within MyBB's templates if I include my initialisation file?


RE: Theme based on user group - - G33K - - 2011-01-08

You could try, it might work as long as it doesn't conflict with MyBB's functions/variables.


RE: Theme based on user group - eteanga - 2011-01-08

(2011-01-08, 11:13 AM)- G33K - Wrote: You could try, it might work as long as it doesn't conflict with MyBB's functions/variables.

Ok, I'm just asking for trouble including my own scripts.

I went back to your original suggestion. I installed the PHP in Templates plugin. Now this following works for me:

<if $mybb->user['usergroup'] == 1 or $mybb->user['usergroup'] == 5 then> 
You're either not logged in, or awaiting activation.
<else>
You're logged in, and you're not awaiting activation.
</if>