Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 03:24 am EST

Geeklog Forums

Theme Switcher ?


anand

Anonymous
Forgive me if it is an obvious question .. How to get the theme switcher inside a block in the main page ? Thanks and Regards...
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You mean putting it inside a story? That is not possible, I'm afraid, since the theme swapper requires some PHP code. bye, Dirk
 Quote

anand

Anonymous
not inside a story. just as it is done on the geeklog site ... as a right block.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

I assume you already have the code? If not, read this story.

Add the function phpblock_themetester() to your lib-custom.php, add the other piece of code in lib-common.php as described, and then just create a new block (of type "PHP block") and tell it to use phpblock_themetester. That's it.

bye, Dirk

 Quote

anand

Anonymous
Thanks a lot. It works now :-)
 Quote

t.bag

Anonymous
Where do I get the theme tester plugin/code? Your link doesn't work (anymore), Dirk.
 Quote

t.bag

Anonymous
tired
Quote by Dirk:add the other piece of code in lib-common.php as described


I don't really understand where this bit of code goes. The readme file says:

2. You also need a bit of code that goes into lib-common.php to make 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.


In the lib-common.php the corresponding bit is:

if( !empty( $HTTP_POST_VARS['usetheme'] ) && is_dir( $_CONF['path_themes']
. $HTTP_POST_VARS['usetheme'] ))
{
$_CONF['theme'] = $HTTP_POST_VARS['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 )


So what am I supposed to do exactly? Sorry, it's late and I can't really think at the moment ...
 Quote

All times are EST. The time is now 03:24 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