SimplePortal

Customization => Themes and Graphics => Topic started by: openminds on September 13, 2011, 11:04:27 PM

Title: Display Box according to theme used.
Post by: openminds on September 13, 2011, 11:04:27 PM
Is there any way to display a box according o the theme being used by members? I have one box that uses a <iframe to call pages from another website. I have the ability  to change the other web pages, duplicating and recoloring to match current theme. But, this would only work if I could select which box to display according to the theme a user is using on my SM/SP site.
Title: Re: Display Box according to theme used.
Post by: ccbtimewiz on September 13, 2011, 11:34:23 PM
You can access the members table (prefix_members) for their theme ID (theme_id).
Title: Re: Display Box according to theme used.
Post by: Chen Zhen on September 14, 2011, 04:18:24 PM
Is there any way to display a box according o the theme being used by members? I have one box that uses a <iframe to call pages from another website. I have the ability  to change the other web pages, duplicating and recoloring to match current theme. But, this would only work if I could select which box to display according to the theme a user is using on my SM/SP site.

You can do it by theme names I suppose.

Code: [Select]
global $settings;
$check = $settings['theme_url'];
$themes = array('theme-name1', 'theme-name2', 'theme-name3');

foreach ($themes as $theme)
{
if (strpos($check,$theme) && $theme == $themes[0])
{
/* Put needed code for the first theme here */

}
elseif (strpos($check,$theme) && $theme == $themes[1])
{
/* Put needed code for the second theme here */

}
elseif (strpos($check,$theme) && $theme == $themes[2])
{
/* Put needed code for the third theme here */

}

/* More theme names in the array .. etc.. etc ... */

}
Title: Re: Display Box according to theme used.
Post by: AngelinaBelle on September 15, 2011, 09:04:38 AM
openminds --
I don't know your prior coding experience, so my apologies if I am explaining things you already understand.
1) Decide what the different stuff is you want to show, depending on the theme.  Maybe it is straight HTML content.  Maybe it is the entire contents of a block.
2) Create this block suggested by underdog. It will pick one or the other options. What you put in the "code for the first theme" is up to you. Either just echo 'hi. you have chosen theme 1'; or even calling a whole block, using blocks-in-blocks calls (as in http://simpleportal.net/index.php?topic=5332.0 (http://simpleportal.net/index.php?topic=5332.0))
 
Does that solve your problem?
SimplePortal 2.3.8 © 2008-2024, SimplePortal