Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 02:00 am EDT

Geeklog Forums

Change themes only avaliable to certain users?


Status: offline

timatlee

Forum User
Newbie
Registered: 06/06/04
Posts: 14
Hello

Not sure that this can be done with a plug-in, but I'm not really certain either .. Smile

I'm trying to make the theme changing ability avaliable only to certain users (say of a certain group). I'm trying to develop a theme, but don't want to murder my entire site while I'm working on it!

Any thoughts on how I could approach this? It's a short-term thing while I work on the theme, and would even be OK with with forcing a certain user ID or group members to HAVE to use the development theme, and not having a choice ...

Any help or direction would be great Smile
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You could hack it into the theme selector in usersettings.php.

Search for 'allow_user_themes' there. It loops over the directories in the layout directory. Simply hard-code a test for your new theme's name and only add it to the list if the user is in a certain group:

if (SEC_inGroup ('Theme Testers')) { ...

bye, Dirk
 Quote

Status: offline

timatlee

Forum User
Newbie
Registered: 06/06/04
Posts: 14
Thanks, works like a charm!

Kinda did it backwards to what you suggested:
Text Formatted Code
            if ($theme == $_CONF['theme'] || SEC_inGroup('Theme Testers')) {

 


so that a regular user will not be able to select any other theme but the default.

Thanks for your help!
 Quote

All times are EDT. The time is now 02:00 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content