Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMFHacks.com Team on April 23, 2012, 06:38:02 PM

Title: SMF Theme Changer
Post by: SMFHacks.com Team on April 23, 2012, 06:38:02 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3356)

SMF Theme Changer

Features:

This mod places a top and/or bottom selection module for SMF themes.
In this way you can easily select any theme.



Title: Re: SMF Theme Changer
Post by: TheListener on April 23, 2012, 06:40:44 PM
Good idea for those not requiring a portal mod.

:)
Title: Re: SMF Theme Changer
Post by: Jessica. on April 23, 2012, 08:09:45 PM
about time someone makes this :)
Title: Re: SMF Theme Changer
Post by: TheListener on April 23, 2012, 08:13:21 PM
oo bossy.

;D
Title: Re: SMF Theme Changer
Post by: Matthew K. on April 24, 2012, 12:20:36 AM
Congratulations! :)
Title: Re: SMF Theme Changer
Post by: OnzeDanny on April 24, 2012, 01:33:48 AM
Thank you all for these nice comments  ;)
Up to the next mod  ;D
Title: Re: SMF Theme Changer
Post by: Bugo on April 29, 2012, 09:18:41 PM
Russian language files.
Title: Re: SMF Theme Changer
Post by: OnzeDanny on April 30, 2012, 01:49:17 AM
Quote from: Bugo on April 29, 2012, 09:18:41 PM
Russian language files.
Thanks to use our Theme Changer and translate the language file Bugo!  ;)
Title: Re: SMF Theme Changer
Post by: Dr3amstor on May 03, 2012, 07:57:26 PM
I've got a problem with this Mod, in the options window i choose to just show the little box with the themes available to be placed at the bottom but the box is also showing at the top.

How can i turn this around.
Title: Re: SMF Theme Changer
Post by: TheListener on May 03, 2012, 08:02:02 PM
Dr3amstor

What is your forums link?
Title: Re: SMF Theme Changer
Post by: Dr3amstor on May 03, 2012, 08:28:38 PM
This one:

http://trocascs.comeze.com
Title: Re: SMF Theme Changer
Post by: TheListener on May 03, 2012, 08:40:42 PM
Quote from: Dr3amstor on May 03, 2012, 08:28:38 PM
This one:

http://trocascs.comeze.com

Ok Without putting my foot in it may I ask the forums language?


Scratch that I helped you with another topic.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi258.photobucket.com%2Falbums%2Fhh258%2F2plus1_bucket%2Ffryingpan-1.jpg&hash=630231227191a6ea8b7a195f0fe8c8260d2afb00)

I may (or may not) be able to ask someone whom speaks the language to have a peep for you.
Title: Re: SMF Theme Changer
Post by: Dr3amstor on May 03, 2012, 08:43:18 PM
Quote from: Old Fossil on May 03, 2012, 08:40:42 PM


Ok Without putting my foot in it may I ask the forums language?

I may (or may not) be able to ask someone whom speaks the language to have a peep for you.

The forum language is Portuguese.

Thank you for your support.
Title: Re: SMF Theme Changer
Post by: NanoSector on May 03, 2012, 08:51:05 PM
There's an ACP option for it I believe, go to Admin > Configuration > Modification Settings

You will notice a panel for the theme changer :)
Title: Re: SMF Theme Changer
Post by: TheListener on May 03, 2012, 08:52:09 PM
Quote from: Yoshi2889 on May 03, 2012, 08:51:05 PM
There's an ACP option for it I believe, go to Admin > Configuration > Modification Settings

You will notice a panel for the theme changer :)

I thought it best if someone whom can read the language had a peep.

Safer that way  :)
Title: Re: SMF Theme Changer
Post by: Dr3amstor on May 03, 2012, 08:57:03 PM
Quote from: Yoshi2889 on May 03, 2012, 08:51:05 PM
There's an ACP option for it I believe, go to Admin > Configuration > Modification Settings

You will notice a panel for the theme changer :)

I know that and I've chose the box to be placed at the bottom but shows on both, top and bottom.
Title: Re: SMF Theme Changer
Post by: NanoSector on May 03, 2012, 08:59:57 PM
Quote from: Dr3amstor on May 03, 2012, 08:57:03 PM
Quote from: Yoshi2889 on May 03, 2012, 08:51:05 PM
There's an ACP option for it I believe, go to Admin > Configuration > Modification Settings

You will notice a panel for the theme changer :)

I know that and I've chose the box to be placed at the bottom but shows on both, top and bottom.
Did you uncheck the other check box?
Title: Re: SMF Theme Changer
Post by: Dr3amstor on May 03, 2012, 09:05:07 PM
Yes, just the box "Place at the bottom" was checked.

Thank you guys but looks that is sorted, removed the Mod and installed back and now the option to chose the Theme is where I chose it to be.

Thank you  for the support. ;)
Title: Re: SMF Theme Changer
Post by: OnzeDanny on May 04, 2012, 02:16:25 AM
Strange situation, there this modification writes directly to the database: _settings and set the values:
change_theme_check_top   1 or 0
change_theme_check_bot   1 or 0
1 is checked and 0 is unchecked ... and checked is display the selector
;)
Title: Re: SMF Theme Changer
Post by: Celine Geneau on May 27, 2012, 07:02:32 AM
hey^^

is there any chance to place the changer on an other point of the board? I'm using an table on the left site and i want to have it there^^ *need help*

thx
Title: Re: SMF Theme Changer
Post by: Matthew K. on June 08, 2012, 01:15:10 PM
Very sorry to see that Danny...
Title: Re: SMF Theme Changer
Post by: abhirupmanna on June 11, 2012, 07:47:28 AM
Useful feature. Anyone having a demo or screenshot of this ?
Title: Re: SMF Theme Changer
Post by: Matthew K. on June 11, 2012, 12:10:33 PM
There's a screenshot of this on the mod site.
Title: Re: SMF Theme Changer
Post by: Adrek on June 11, 2012, 12:32:15 PM
which does not work :)
Title: Re: SMF Theme Changer
Post by: Matthew K. on June 11, 2012, 12:38:23 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmf.klikveilig.be%2Fcgi-bin%2Fpro-theme-changer.png&hash=10e5d00886f4b78104d71b67c58d87e45092733a)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmf.klikveilig.be%2Fcgi-bin%2FCLS-THEME-ADMIN.png&hash=5a8945d357604e1e2bc8fc370b88e93043015de4)
Works for me ;)
Title: Re: SMF Theme Changer
Post by: Adrek on June 11, 2012, 12:42:31 PM
maybe clear your cache in web browser  ::)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg221.imageshack.us%2Fimg221%2F1348%2Fsmfklikveiligbecgibinpr.png&hash=fd1ca5b022ffe2d9c216ce905ff2c51e39afc7bc)

screens were from http://smf.klikveilig.be and this site is closed :/

//edit:

I see that SMFHacks.com Team took over this mod, so I guess they will update screens/demo soon
Title: Re: SMF Theme Changer
Post by: Matthew K. on June 11, 2012, 12:49:59 PM
I am a programmer for SMFHacks. I'll upload one of their screenshots to tinypic and attach it here for now.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi50.tinypic.com%2F2h3otoi.png&hash=b6272d58b14446d37672e5c349385dde74c670ef)
Title: Re: SMF Theme Changer
Post by: SMFHacks.com Team on June 11, 2012, 03:05:46 PM
Nice very handy! I maybe time to start a theme demo site again!
Title: Re: SMF Theme Changer
Post by: abhirupmanna on June 11, 2012, 08:14:41 PM
Ah thank you so much
Title: Re: SMF Theme Changer
Post by: shazoo! on August 08, 2012, 07:45:01 AM
Getting an error in my log:

8: Undefined index: change_theme_check_top

That is what shows in the file:

elseif($modSettings['change_theme_check_top']=='0'){}

What is causing the error?
Title: Re: SMF Theme Changer
Post by: NanoSector on August 08, 2012, 08:38:19 AM
Change that line to:

elseif (!empty($modSettings['change_theme_check_top']) && $modSettings['change_theme_check_top']=='0'){}
Title: Re: SMF Theme Changer
Post by: Matthew K. on August 08, 2012, 11:23:56 AM
Actually...that's a little bit backwards...contradicting yourself there.

Try this instead:
elseif (isset($modSettings['change_theme_check_top']) && $modSettings['change_theme_check_top'] == 0) {}
Title: Re: SMF Theme Changer
Post by: flamechica on February 20, 2013, 09:43:48 PM

8: Undefined index: change_theme_check_top (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.rsdlaughter.com%2Fnew%2FThemes%2FOrange_with_Flamed_Background%2Fimages%2Ffilter.gif&hash=a206efc73f89a350eb98ac96f494774d7f16eb7b) (http://www.rsdlaughter.com/new/index.php?action=admin;area=logs;sa=errorlog;desc;filter=file;value=L2hvbWUvcnNkbGF1Z2gvcHVibGljX2h0bWwvbmV3L1NvdXJjZXMvY2xzLnBocA==)  File: /home/rsdlaugh/public_html/new/Sources/cls.php (http://www.rsdlaughter.com/new/index.php?action=admin;area=logs;sa=errorlog;file=L2hvbWUvcnNkbGF1Z2gvcHVibGljX2h0bWwvbmV3L1NvdXJjZXMvY2xzLnBocA==;line=93)
Line: 93

Getting this error. Any help would be appreciated. I also got the error that shazoo had as well, but was able to fix that with the info that Labradoodle posted. THANKS! Now, if I can just get rid of this one....

Using SMF 2.0.4 and I am only using the theme changer on the bottom.
Title: Re: SMF Theme Changer
Post by: danielwmoore on November 22, 2013, 11:02:02 AM
It has been a while since there was a post here, however, I am very interested in this mod.

My problem is, while is "works", it does not work in a fashion that suits my needs. There seems to be nothing that does.

All my themes use Variants, which SMF has supported for a long time.  Two of my sites have a theme that has over 50 variant color schemes for the theme, with over 50 CSS3 style sheets, which can create different effects as far as curved or square borders, spacing, colors, gradients, 3D effects, and the whole ball of wax.

This does not allow me to access any of that, as it will only show the theme name, without any choices to the many variants that all of my sites offer.

I noticed that the last modified date of the mod was October 2, 2013, which gives me hope this mod is still being actively developed.

I would like to respectfully request that theme variants be supported. Please respond as to whether or not you will consider this as a future option. If not, I may have to create my own mod.

As a secondary request, I'd like to have an option to add "permissions" so that the ability to see this theme changer can be set as a permission per group. That way, I can disable it for guests, or, on some sites, enable it only for the "Maintenance" group that handles theme creation and mods so it will be easier to test themes and how certain mods work with those themes.

I believe these requests are reasonable, and would make the final outcome of this mod a valuable resource for every SMF 2 forum out there.
Title: Re: SMF Theme Changer
Post by: Arantor on November 22, 2013, 01:37:16 PM
I'm not actually sure it's directly possible for this mod to support variants. There is, as far as I know, no central standardised way for a theme to declare its variants such that this mod could actually read it.
Title: Re: SMF Theme Changer
Post by: danielwmoore on November 22, 2013, 02:01:58 PM
Thank you, Arantor, for giving an answer that not only answers my query of "will someone do this," but also gives the answer, "why it hasn't been done."

Your answer is much appreciated, even though it doesn't solve my issue.  Now I can just work on implementing something myself.

Even though there is no "centralized" way of reading variants, all the ones in use by forums I work with use the same theme designer, and thus, have the exact same way of declaring variants. I'll use the rules in use by this developer to create a bit of something, though it would be no good for anyone else, apparently.
Title: Re: SMF Theme Changer
Post by: Steve on January 29, 2014, 10:13:05 AM
Is this mod supposed to work across browser sessions or am I doing something wrong?

I can change themes with no problem but if I close the browser and then re-open it, the theme goes back to what it was in my profile originally.

Any help would be appreciated. :)
Title: Re: SMF Theme Changer
Post by: shazoo! on April 22, 2014, 09:53:50 AM
If I need to move the dropdown to a different area, how would I do that?
I found a theme whose top header is very very small and it gets cut off
Title: Re: SMF Theme Changer
Post by: roshaoar on May 03, 2015, 07:41:27 PM
Hello,

Should this remember user theme settings when they log out and back in?

Thank you
Title: Re: SMF Theme Changer
Post by: tanawat on March 16, 2017, 12:18:57 PM
i use prettyurl mod

it must change theme at home page.

if change another page it error

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fupic.me%2Fi%2F99%2Fys404.png&hash=ce686a02b13f3a19c25dd7ffbfad4df0144b3631) (http://upic.me/show/60489478)

can You help me plese.
Title: Re: SMF Theme Changer
Post by: vbgamer45 on March 16, 2017, 03:06:15 PM
What link is in your url?
Title: Re: SMF Theme Changer
Post by: tanawat on March 17, 2017, 12:08:19 AM
ex:
http://pordoo.com/b67/
when change theme it come to 
http://pordoo.com/b67/index.php?theme=1
(Not Found
The requested URL /b67/index.php?theme=1 was not found on this server.)


my web site www.pordoo.com
Title: Re: SMF Theme Changer
Post by: vbgamer45 on March 17, 2017, 12:16:38 AM
This mod doesn't work with pretty urls other url rewrite mods

You would have to make changes to cls.tc.js for this mot to work.
Title: Re: SMF Theme Changer
Post by: tanawat on March 17, 2017, 03:07:18 AM
 :D

If given all page redirect to homepage (when change theme) together with new theme change,
how to modify code ?
Title: Re: SMF Theme Changer
Post by: felizycontento on September 14, 2017, 03:45:37 PM
I get no change when switching the theme. You can check in https://acspain.es

Thanks
Title: Re: SMF Theme Changer
Post by: vbgamer45 on September 14, 2017, 04:14:16 PM
You are missing this file
https://acspain.es/Themes/default/scripts/cls.tc.js
Title: Re: SMF Theme Changer
Post by: felizycontento on September 14, 2017, 04:30:20 PM
Quote from: vbgamer45 on September 14, 2017, 04:14:16 PM
You are missing this file
https://acspain.es/Themes/default/scripts/cls.tc.js

The file is there, I can see it through ftp, but it is not shown in a browser. Can it be something about the server configuration?
Title: Re: SMF Theme Changer
Post by: vbgamer45 on September 14, 2017, 05:17:47 PM
Yes file permissions or file owernship issue.

try 755 permissions
Title: Re: SMF Theme Changer
Post by: felizycontento on September 15, 2017, 04:39:02 AM
Quote from: vbgamer45 on September 14, 2017, 05:17:47 PM
Yes file permissions or file owernship issue.

try 755 permissions

I have set 755 permissions for all these three files

/home/admin/web/acspain.es/public_shtml/Themes/default/languages/cls.english.php   
/home/admin/web/acspain.es/public_shtml/Themes/default/languages/cls.dutch.php   
/home/admin/web/acspain.es/public_shtml/Themes/default/scripts/cls.tc.js   

It keeps doing nothing at all
Title: Re: SMF Theme Changer
Post by: Shambles on September 15, 2017, 07:08:31 AM
Quote/home/admin/web/acspain.es/public_shtml/Themes/default/scripts/cls.tc.js

Is public_shtml the root of your forum? Do you have a public_html 'folder'?

The named files do not exist, as confirmed by "view page source" and browser console.
Title: Re: SMF Theme Changer
Post by: felizycontento on September 15, 2017, 08:26:13 AM
Quote from: Shambles on September 15, 2017, 07:08:31 AM
Quote/home/admin/web/acspain.es/public_shtml/Themes/default/scripts/cls.tc.js

Is public_shtml the root of your forum? Do you have a public_html 'folder'?

The named files do not exist, as confirmed by "view page source" and browser console.

Yes I have a public_html folder and is there where my domain is pointing  >:(

Dont know why the mod has been instaled in the public_shtml

I moved it and working fine. Thanks
Title: Re: SMF Theme Changer
Post by: vbgamer45 on September 15, 2017, 08:40:23 AM
Glad you have it working!
Title: Re: SMF Theme Changer
Post by: mickie on October 27, 2017, 11:05:44 AM
Hi, I am curious if there is an easy way to add text to the left of this mod?
Something like :
"To view all available themes us this drop down -->"
It is small (Which I like) but I am not sure everyone will notice it.
Title: Re: SMF Theme Changer
Post by: vbgamer45 on October 27, 2017, 11:22:31 AM
Possibly look at the code and give it a shot.
Title: Re: SMF Theme Changer
Post by: mickie on December 17, 2017, 02:16:31 PM
Quote from: vbgamer45 on October 27, 2017, 11:22:31 AM
Possibly look at the code and give it a shot.

I have gone through every one of the files.
I can not see a place to create any kind of customizing or styling of this
Title: Re: SMF Theme Changer
Post by: pocttopus on February 15, 2018, 04:06:26 AM
Hello,

This mod is not working after installing prettyUrls.
http://forum.mkreef.com/forum/

I looked for public_shtml but I don't have that folder.
Any advice please? :(

Thanks! :)
Title: Re: SMF Theme Changer
Post by: pocttopus on February 20, 2018, 03:28:58 PM
nobody?  ???
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 12:36:05 PM
Installed this mod on 2.0.17 forum last night, tested it and worked fine, theme setting was changed in user profile and it stuck.  Today it's not working fine, theme changes when you're logged in, but reverts back to default if you logout/login.  Setting doesn't stick. >:(
Title: Re: SMF Theme Changer
Post by: Antechinus on February 28, 2020, 03:56:41 PM
Yes, it would do that. When you are logged in it saves the setting to your user settings. Guests have no user settings, so when you are logged out it will think you are just another guest. This is common with anything that relies on user settings. The default header upshrink is an example. Collapsed categories are another.
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 09:49:47 PM
No, that's not what I said.  When I first installed the mod, you could change the theme while logged in, logout and see default theme, log back in and see theme you changed it to.  It updated the member setting, same as if you did it manually in profile.  Now it doesn't do that, you see the new theme until you log out, log back in and you're back to default theme.  Doesn't save the setting.

Title: Re: SMF Theme Changer
Post by: Antechinus on February 28, 2020, 10:15:08 PM
Ah. I see the problem. It's not doing anything with user settings or cookies. It's just appending the selected theme id to the current url. That's not persistent, ergo the problem.

What you're after is one that a/ sets a cookie, or a browser local storage value, for guests and b/ sets a proper user setting for logged in members.

I suppose you could even go belt and braces, and do both for logged in members. That way if they visit the site again without bothering to log in their selected theme would stay the same.

But OTOH you have to wonder if there's much point having a theme changer for logged in members, since they can always go into the profile and change their selected theme anyway. Theme changers are really more useful for guests.
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 10:32:19 PM
Odd thing is, it was working when I first installed yesterday, then tested it on my 7" tab last night and it wasn't keeping the setting, same thing on pc today.
Title: Re: SMF Theme Changer
Post by: Antechinus on February 28, 2020, 10:33:11 PM
Makes perfect sense. It depends on sessions, and each session is tied to the device you logged in with.
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 10:42:11 PM
Well, yes, if that's how it's supposed to work, but I'm pretty sure that it updated profile setting first time I tested it, now it doesn't.  Looking at the code, I see it reads the database for available themes, but don't see it updating member setting -



// ClickSafe Read database
function cls_read_db()
{
  global $context, $settings, $txt, $modSettings, $smcFunc;
$request = $smcFunc['db_query']('', '
SELECT id_theme, variable, value
FROM {db_prefix}themes
WHERE variable IN ({string:name}, {string:theme_dir}, {string:theme_url}, {string:images_url})
AND id_member = {int:no_member}
      AND id_theme IN ({array_string:known_themes})',
array(
'no_member' => 0,
'name' => 'name',
'theme_dir' => 'theme_dir',
'theme_url' => 'theme_url',
'images_url' => 'images_url',
      'known_themes' => explode(',', $modSettings['knownThemes']),
)
);
$context['cls_themes'] = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
if (!isset($context['cls_themes'][$row['id_theme']]))
$context['cls_themes'][$row['id_theme']] = array(
'id' => $row['id_theme'],
);
$context['cls_themes'][$row['id_theme']][$row['variable']] = $row['value'];
}
$smcFunc['db_free_result']($request);
}


Title: Re: SMF Theme Changer
Post by: Antechinus on February 28, 2020, 10:45:04 PM
No, it doesn't touch member settings or cookies. All it does is a session-dependent change of url, so if you thought it was holding across sessions/login/logout you must have been hallucinating.
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 10:50:12 PM
Well, that's always a possibilty.  Don't see any easy way to make it do what I want.
Title: Re: SMF Theme Changer
Post by: Antechinus on February 28, 2020, 10:58:41 PM
Exactly* what do you want it to do?

*This word is important.
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 11:11:14 PM
Same thing as changing theme in Profile -> Look and Layout.  Think I'll try adding button in header that does this -



https://www.simplemachines.org/community/index.php?action=theme;sa=pick


Title: Re: SMF Theme Changer
Post by: Antechinus on February 28, 2020, 11:18:46 PM
Ok, if that's the only functionality you want then it makes sense to use the default functionality. But, obviously that's not available for guests, so they will be stuck with whatever is the site default. Which is why people invented theme changers.
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 28, 2020, 11:25:13 PM
I'm not concerned about guests, just need a simple way for members to change their theme.  Stuck a button in header here (http://www.thekrashsite.com/mlc), looks kind of crappy but it works.
Title: Re: SMF Theme Changer
Post by: Antechinus on February 29, 2020, 12:11:53 AM
if ($context['user']['is_logged'])
{
echo '


Will save a lot of error messages from guests and spiders. ;)
Title: Re: SMF Theme Changer
Post by: Sir Osis of Liver on February 29, 2020, 12:43:03 AM
Good idea. 

Also did a crappy hack in Themes.template.php to remove 'Forum or Board Default' so each theme is listed only once -



// Just go through each theme and show its information - thumbnail, etc.

foreach ($context['available_themes'] as $theme)
{
if($loop == null) {
$loop = 1;
continue;
}
echo '
<div class="cat_bar">
<h3 class="catbg">
<a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $theme['name'], (!empty($theme['variants']) ? ';vrt=' . $theme['selected_variant'] : ''), '</a>
</h3>



Got a feeling it's not a great idea, but makes things less confusing for dopey users (it's always confused me :P).
Title: Re: SMF Theme Changer
Post by: Deaks on February 25, 2022, 01:31:16 PM
Any plans to make this work for 2.1?? :D
Title: Re: SMF Theme Changer
Post by: Shades. on October 12, 2022, 12:15:41 AM
@vbgamer45 I could really use this mod for SMF 2.1.2! Any chance you can update it? O:)  8)
Title: Re: SMF Theme Changer
Post by: vbgamer45 on October 12, 2022, 07:04:01 PM
Updated for SMF 2.1.x!
Title: Re: SMF Theme Changer
Post by: Shades. on October 12, 2022, 08:04:58 PM
Thank you for updating! :)

I'm getting the same error as I was getting when I tried to use the old version. But it only happens when I put the theme changer up top. If I move it down to the bottom, no errors.

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: forum_width
File
/home/******/public_html/******/Sources/cls.php
Line
97
URL of page causing the error
https://******.com/index.php?action=admin;area=modsettings;sa=cls;

Backtrace information
#0: smf_error_handler()
Called from /home/******/public_html/******/Sources/cls.php on line 97
#1: cls_change_theme_top()
Called from /home/******/public_html/******/Sources/Subs.php on line 4546
#2: template_header()
Called from /home/******/public_html/******/Sources/Subs.php on line 4150
#3: obExit()
Called from /home/******/public_html/******/index.php on line 194

SMF 2.1.2 Fresh install, No mods other than this one. ;)
Title: Re: SMF Theme Changer
Post by: vbgamer45 on October 12, 2022, 08:27:10 PM
Fixed above error^

2.0 Added caching support less db queries per page load.
Title: Re: SMF Theme Changer
Post by: Shades. on October 12, 2022, 09:54:57 PM
Quote from: vbgamer45 on October 12, 2022, 08:27:10 PMFixed above error^

2.0 Added caching support less db queries per page load.
Works great now thank you! :)  8)
Title: Re: SMF Theme Changer
Post by: Shades. on October 12, 2022, 11:08:03 PM
I moved the Theme Changer over to the top left. Just wondering if this was the correct way to do it? It works and I'm not seeing any errors.

In cls.php around lines 109 & 133 I changed:
               <!-- START ClickSafe SMF Change Theme TOP -->                     
              <div style="margin: auto; text-align:right; width:'.$settings['forum_width'].'; font-size:12px;">

To:
               <!-- START ClickSafe SMF Change Theme TOP -->                     
              <div style="margin: auto; text-align:left; margin: 5px 100px 0; width:'.$settings['forum_width'].'; font-size:12px;">

Does that look correct? Not sure if I need that zero at the end of "margin: 5px 100px 0;" or even if this is the correct way to do it. I was just playing around with it and it worked. :o  ;D

You can check it out on my site. ;)

themeselect.png
Title: Re: SMF Theme Changer
Post by: vbgamer45 on October 12, 2022, 11:15:08 PM
That works!
Title: Re: SMF Theme Changer
Post by: Shades. on October 12, 2022, 11:21:08 PM
Is there a way to change the default to show "Change the theme" instead of showing the first theme?
Title: Re: SMF Theme Changer
Post by: vbgamer45 on October 12, 2022, 11:39:41 PM
Untested you can add after in sources/cls.php
<optgroup label="', $txt['cls-head'], '">

add
<option value="0">Change the Theme</option>
Title: Re: SMF Theme Changer
Post by: Shades. on October 12, 2022, 11:53:00 PM
I changed it in all 3 different places (? ? ?) in the file but the first theme still shows as default and when I click to choose it shows the "Change the Theme" twice.
Title: Re: SMF Theme Changer
Post by: vbgamer45 on October 12, 2022, 11:58:45 PM
It's this code that needs to be removed then too
(($settings['theme_id'] == $theme['id']) ? ' selected="selected"' : '')

That will stop it from being preselected.
Title: Re: SMF Theme Changer
Post by: Shades. on October 13, 2022, 12:16:30 AM
That did it but had to remove the comma at the end of it too! ;D

(($settings['theme_id'] == $theme['id']) ? ' selected="selected"' : ''),
Took me a minute to figure that out! :laugh:

Great job, I love it! 8)
Title: SMF Theme Changer, unable to select items
Post by: Recursos on October 25, 2022, 08:08:00 AM
I have a problem, selection is not working:

(https://i.postimg.cc/rdNMDn3q/Android-Theme-Change.jpg) (https://postimg.cc/rdNMDn3q)

Theme "DefaultCopy (unchanged)" was selected from "Manage and Install themes", and from "Manage and Install themes" I can select any of the 4 themes.
But "SMF Theme Changer" does not allow me to selected another one of the 4 items.
I uninstalled mod, deleted and installed "Last Updated October 22, 2022, 06:42:26 AM" to no avail.

Where should I look?
Title: Re: SMF Theme Changer
Post by: Shades. on October 25, 2022, 10:40:16 AM
Quote from: Recursos on October 25, 2022, 08:08:00 AMWhere should I look?
Right above where it says "Overall forum default:" look for "Themes that the user is able to select:" and click on "[ Show the list of themes ]" and make sure all the themes you want to be able to be selected are checked. Hope that helps! 8)
Title: Re: SMF Theme Changer
Post by: Recursos on October 25, 2022, 02:01:06 PM
Thanks, it is working now.
Title: Re: SMF Theme Changer
Post by: Shades. on March 15, 2023, 09:05:28 PM
@vbgamer45 could you add permissions to this mod in the future so that guests cannot change theme when forum is in maintenance mode? Or would that take a complete overhaul?

Thanks,
Shades 8)
Title: Re: SMF Theme Changer
Post by: vbgamer45 on November 08, 2023, 04:18:31 PM
2.1 released
!Fixed bug with pretty urls if rewriting board urls/actions.