Introducing Item Switcher...

Not absolutely clear explained, can you explain step by step!

  1. I created a directory on the server and now I have two folders site.com and themes.site.com - is that correct?
  2. In new directory themes.site.com i must past this files from archive - themeselector? and make redirect or what? but all my themes in folder site.com!

Can you help, how to show only mine Iframe? Not bothā€¦

manserro5 said

Can you help, how to show only mine Iframe? Not bothā€¦

I am also having this issue. Maybe it used to close automatically and Envato changed something about their iframe and itā€™s not closing anymore? Does anyone have a solution?

Did you guys follow step 3 with the redirect?

sevenspark said

Did you guys follow step 3 with the redirect?

Oops somehow I ended up using just the ?theme= and forgot to add the redirect.php in front, thanks!

This is awesome! Def a brilliant piece of code ill be using!

Finally found what I was looking for!

Just wanted to add a big THANKS!

This is pure magic. :slight_smile:

arrowthemes said

Thanks for the code, George :wink:

Hereā€™s my modified version: http://demo.arrowthemes.com/redirect.php?theme=clarke-joomla

If youā€™ve noticed when you first load the preview, the styles are loaded nicely and the user can switch between theme styles. However if the user selects a different theme, Iā€™m not able to load the php array list of the selected theme via js.

What Iā€™ve done for the styles is add it as part of the array of the theme list - that kinda makes it hard for me to pull the list using javascript, obviously due to my limited knowledge in php/js. At the moment am just setting the styles list of the selected theme to blank to avoid the previous list from being visible.

Iā€™d appreciate some help from any one on how to load the list of styles from the php array to the javascript on click event.

Hereā€™s my PHP array code:

http://snippi.com/s/hs4yzx4

Hereā€™s my js click event for the theme switcher:

http://snippi.com/s/xqn66qe

many thanks,
Joel

hi mate can you share you code ???

thanks a lot for sharing his files,.
:slight_smile: :smiley:
greetings.

thanksā€¦ will be helpful a lot

Did mine too, changed the graphics quite a bit, but thanks for the code! http://demo.teothemes.com/

Hi guys,
Great code, but I can see that a lot of authors use toolbar theme switcher with test for responsive design. Would be fantastic to add this option.

Thanks.

I canā€™t believe this was free, this is better than any paid coding Iā€™ve ever used. I searched and searched and searched and couldnā€™t find anything like this before finally stumbling upon this. AMAZING piece of work. THANKS SO MUCH FOR SHARING!!!

-Eric

Hi guys, can I get some help here please?

Iā€™ve placed the code as requested in folder.something.com and done everything right. The first method listed here here was working, but the hover thing is amazing so I must have that as well. Problem is that while everything works great, it doesnā€™t actually display anything the first time around, so kind of a big prob.

Code:

$theme_array = array (
 
'wd'	=>	array (
"id" => "WD Responsive",
'type'	=> "Email Template",
"url" => "http://www.am-themes.com/wd_email",
"themeforest" => "http://themeforest.net/item/wd-email-clearn-responsive-email-template/4495512?ref=am_themes",
"preview"	=> "http://3.s3.envato.com/files/53628906/01_preview.__large_preview.png",
"mobile_redirect" => true,
),

and the redirected site looks like this:

http://labs.am-themes.com/?theme=wd

help?

Looks like you havenā€™t set a theme based on your ?theme parameter.

For example, you grab that ID

$current_theme = isset($_GET['theme']) ? $_GET['theme'] : 'wd';

then you pull the URL for that ID out of your themes array, so you have a $current_theme_url

$current_theme_url = $theme_array[$current_theme]['url'];

Then you use that theme url to load the iframe in index.php

< iframe id="iframe" src="< ?php echo $current_theme_url; ?>" frameborder="0" width="100%">

Right now your iframe src is empty, so the $current_theme_url wasnā€™t set properly

Hope that gets you pointed in the right direction :slight_smile:

sevenspark said

Looks like you havenā€™t set a theme based on your ?theme parameter.

For example, you grab that ID

$current_theme = isset($_GET['theme']) ? $_GET['theme'] : 'wd';

then you pull the URL for that ID out of your themes array, so you have a $current_theme_url

$current_theme_url = $theme_array[$current_theme]['url'];

Then you use that theme url to load the iframe in index.php

< iframe id="iframe" src="< ?php echo $current_theme_url; ?>" frameborder="0" width="100%">

Right now your iframe src is empty, so the $current_theme_url wasnā€™t set properly

Hope that gets you pointed in the right direction :slight_smile:

Thanks a lot for your help, youā€™re the best! I Owe you 1!

Thanks bro :slight_smile:

@ThemeProvince, @sevenspark
Thanks a lot, you are great :slight_smile:

Hi guys!

I use a subdomain in TechnoTailor.net. Itā€™s http://themes.technotailor.net. I copy the files, the theme selector works perfectly, but I got an error message in the header. Itā€™s say:

Notice: Undefined index: theme in /home/technota/domains/technotailor.net/public_html/themes/index.php on line 38 Notice: Undefined variable: redirect in /home/technota/domains/technotailor.net/public_html/themes/index.php on line 56

What can I do to fix this?

Thanks!

Nevermind! I fix it!

I add this line in the index.php file and the notice message is gone!

error_reporting(E_ALL ^ E_NOTICE);