Posted on: 05/06/02 01:38pm
By: Tony
If haven't noticed, we've added a handy little theme swapper inside of a block here. This is handy for testing or for giving your users an easier alternative to changing themes. Get the code for it
here[*1]
Didn't you forget something?
Posted on: 05/07/02 12:59am
By: Dirk
It seems you forgot to mention that you also need a bit of code that goes into lib-common.php to makt this work:
if (!empty($usetheme) AND is_dir($_CONF['path_themes'] . $usetheme)) {
$_CONF['theme'] = $usetheme;
$_CONF['path_layout'] = $_CONF['path_themes'] . $_CONF['theme'] . '/';
$_CONF['layout_url'] = $_CONF['site_url'] . '/layout/' . $_CONF['theme'];
}
else if ($_CONF['allow_user_themes'] == 1) {
Only that last line (minus the "else") is already there ... Add this and then it will work.
bye, Dirk
Yes
Posted on: 05/07/02 06:24am
By: Tony
Sorry, yes, you are right. A small but important amount of code.
ignoring default theme?
Posted on: 05/07/02 08:55am
By: squatty
Theme swapper appears to be ignoring my default theme ($_CONF['theme'] = 'clean'

.
When I set the allow_user_themes = 1 and enable the theme swapper block, users are directed to the DotCom theme instead of the Clean theme?
Any ideas on what's going on?
Thnx!
Didn't you forget something?
Posted on: 05/07/02 02:44pm
By: Anonymous (Anonymous)
can you specific, where there are put this codec? or how is install, this?
Didn't you forget something?
Posted on: 05/07/02 03:09pm
By: Tony
You put this in lib-common.php. It'll be at the top. You notice some of the existing code in the snippet above. If you can read PHP code, it should be really obvious.
Didn't you forget something?
Posted on: 01/06/03 11:11pm
By: saltlakejohn
1) take the code snippet from
http://www.geeklog.net/article.php?story=20020506133826910 and put it
into lib-common.php. All that code replaces the single line of code:
if ($_CONF['allow_user_themes'] == 1) {
(Watch out for the curly braces, don't get them wrong.)
2) Then take the cleaned up code from
http://www.geeklog.net/phpblocks/themetester.phps and put it into
lib-custom.php
3) Login as admin and make a php block for homeonly. Read there that
when you call a phpblock function that you do NOT use the parentheses.
----- John