Posted on: 09/01/06 02:54pm
By: spatz4000
I want to have a theme switcher for my site. Actually just a switch between two. I have seen the stories with code snippets for a switcher but one comes as not found, and the other, relies on the code from the first.
Any ideas?
Theme Switcher
Posted on: 09/01/06 03:02pm
By: Dirk
Try searching for "theme tester". In fact, we've just been through all this a week or two ago.
bye, Dirk
Theme Switcher
Posted on: 09/01/06 03:19pm
By: spatz4000
is there a way for an admin type person to have this pulldown show up, on their admin page, and the theme then change for all anonymous users?
Cool, thanks. i was thrown off when I searched before because the search results that were recent had "0" replies. But I clicked on the first one and I all is well. Thanks again.
[QUOTE BY= Dirk] Try searching for "theme tester". In fact, we've just been through all this a week or two ago.
bye, Dirk[/QUOTE]
Theme Switcher
Posted on: 09/01/06 03:48pm
By: Dirk
[QUOTE BY= spatz4000] is there a way for an admin type person to have this pulldown show up, on their admin page, and the theme then change for all anonymous users?[/QUOTE]
Hmm, the anonymous users get to see the default theme, which is set in config.php. That would be tricky to do and involve having a writable config.php file, which doesn't sound like a good idea from a security point of view ...
A more doable approach may be to write the admin's selection to the database (to, say, the gl_vars table) and then have a piece of custom code in lib-custom.php that pulls that out of the table again and sets $_USER['theme'] for anonymous users (for which it's not normally set). Not sure if that'll work, but I think it would. Now you only need to find someone implementing it ...
bye, Dirk
Theme Switcher
Posted on: 09/01/06 04:13pm
By: spatz4000
I know a little PHP, so that'll be my project for Tuesday. I'm basically trying to make theme selection as simple as possible ( ie the user won't know how to change the config file ). Thanks for the tips.
[QUOTE BY= Dirk] [QUOTE BY= spatz4000] is there a way for an admin type person to have this pulldown show up, on their admin page, and the theme then change for all anonymous users?[/QUOTE]
Hmm, the anonymous users get to see the default theme, which is set in config.php. That would be tricky to do and involve having a writable config.php file, which doesn't sound like a good idea from a security point of view ...
A more doable approach may be to write the admin's selection to the database (to, say, the gl_vars table) and then have a piece of custom code in lib-custom.php that pulls that out of the table again and sets $_USER['theme'] for anonymous users (for which it's not normally set). Not sure if that'll work, but I think it would. Now you only need to find someone implementing it ...
bye, Dirk[/QUOTE]
Theme Switcher
Posted on: 09/05/06 10:58am
By: spatz4000
Trying to get an idea on what needs done. I would need to add a column to the gl_vars table ( call it default_theme or something )?
[QUOTE BY= spatz4000] I know a little PHP, so that'll be my project for Tuesday. I'm basically trying to make theme selection as simple as possible ( ie the user won't know how to change the config file ). Thanks for the tips.
[QUOTE BY= Dirk] [QUOTE BY= spatz4000] is there a way for an admin type person to have this pulldown show up, on their admin page, and the theme then change for all anonymous users?[/QUOTE]
Hmm, the anonymous users get to see the default theme, which is set in config.php. That would be tricky to do and involve having a writable config.php file, which doesn't sound like a good idea from a security point of view ...
A more doable approach may be to write the admin's selection to the database (to, say, the gl_vars table) and then have a piece of custom code in lib-custom.php that pulls that out of the table again and sets $_USER['theme'] for anonymous users (for which it's not normally set). Not sure if that'll work, but I think it would. Now you only need to find someone implementing it ...
bye, Dirk[/QUOTE][/QUOTE]
Theme Switcher
Posted on: 09/05/06 02:42pm
By: Dirk
[QUOTE BY= spatz4000] I would need to add a column to the gl_vars table ( call it default_theme or something )?[/QUOTE]
A row, not a column. gl_vars is just a table of (name, value) pairs used for all sorts of things.
bye, Dirk
Theme Switcher
Posted on: 09/06/06 01:59pm
By: spatz4000
Ahhhh yeah. It was early, ot late. Or something. Thanks agin
[QUOTE BY= Dirk] [QUOTE BY= spatz4000] I would need to add a column to the gl_vars table ( call it default_theme or something )?[/QUOTE]
A row, not a column. gl_vars is just a table of (name, value) pairs used for all sorts of things.
bye, Dirk[/QUOTE]4
Theme Switcher
Posted on: 09/06/06 03:36pm
By: spatz4000
[QUOTE BY= Dirk]
again and sets $_USER['theme'] for anonymous users (for which it's not normally set). Not sure if that'll work, but I think it would. Now you only need to find someone implementing it ...[/QUOTE]
How or where do I set $_USER['theme']? That's referencing gl_users in the database? or not?
Theme Switcher
Posted on: 09/26/06 09:07am
By: spatz4000
Okay. I have the database being written to, and I can also read from the database, the info I need. Where I am stuck is where, in what file do I need to set $_USER['theme']?
[QUOTE BY= Dirk]
Hmm, the anonymous users get to see the default theme, which is set in config.php. That would be tricky to do and involve having a writable config.php file, which doesn't sound like a good idea from a security point of view ...
A more doable approach may be to write the admin's selection to the database (to, say, the gl_vars table) and then have a piece of custom code in lib-custom.php that pulls that out of the table again and sets $_USER['theme'] for anonymous users (for which it's not normally set). Not sure if that'll work, but I think it would. Now you only need to find someone implementing it ...
bye, Dirk[/QUOTE]