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.
Good idea for those not requiring a portal mod.
:)
about time someone makes this :)
oo bossy.
;D
Congratulations! :)
Thank you all for these nice comments ;)
Up to the next mod ;D
Russian language files.
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! ;)
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.
Dr3amstor
What is your forums link?
This one:
http://trocascs.comeze.com
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.
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.
There's an ACP option for it I believe, go to Admin > Configuration > Modification Settings
You will notice a panel for the theme changer :)
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 :)
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.
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?
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. ;)
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
;)
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
Very sorry to see that Danny...
Useful feature. Anyone having a demo or screenshot of this ?
There's a screenshot of this on the mod site.
which does not work :)
(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 ;)
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
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)
Nice very handy! I maybe time to start a theme demo site again!
Ah thank you so much
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?
Change that line to:
elseif (!empty($modSettings['change_theme_check_top']) && $modSettings['change_theme_check_top']=='0'){}
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) {}
| 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.
|
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.
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.
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.
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. :)
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
Hello,
Should this remember user theme settings when they log out and back in?
Thank you
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.
What link is in your url?
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
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.
:D
If given all page redirect to homepage (when change theme) together with new theme change,
how to modify code ?
I get no change when switching the theme. You can check in https://acspain.es
Thanks
You are missing this file
https://acspain.es/Themes/default/scripts/cls.tc.js
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?
Yes file permissions or file owernship issue.
try 755 permissions
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
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.
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
Glad you have it working!
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.
Possibly look at the code and give it a shot.
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
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! :)
nobody? ???
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. >:(
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.
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.
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.
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.
Makes perfect sense. It depends on sessions, and each session is tied to the device you logged in with.
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);
}
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.
Well, that's always a possibilty. Don't see any easy way to make it do what I want.
Exactly* what do you want it to do?
*This word is important.
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
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.
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.
if ($context['user']['is_logged'])
{
echo '
Will save a lot of error messages from guests and spiders. ;)
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).
Any plans to make this work for 2.1?? :D
@vbgamer45 I could really use this mod for SMF 2.1.2! Any chance you can update it? O:) 8)
Updated for SMF 2.1.x!
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. ;)
Fixed above error^
2.0 Added caching support less db queries per page load.
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)
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
That works!
Is there a way to change the default to show "Change the theme" instead of showing the first theme?
Untested you can add after in sources/cls.php
<optgroup label="', $txt['cls-head'], '">
add
<option value="0">Change the Theme</option>
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.
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.
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)
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?
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)
Thanks, it is working now.
@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)
2.1 released
!Fixed bug with pretty urls if rewriting board urls/actions.