Theme Changer?
5 posters
Page 1 of 1
Theme Changer?
Hey everyone.Â
Can you guys make an update on the theme changer tutorial? The other topic is quite confusing and I don't know if it even works anymore.Â
One of you guys should try the tutorial yourself; the attachment doesn't really go along with the tutorial that well. It's not being specific enough..Â
Thanks. Hope someone can help..
Can you guys make an update on the theme changer tutorial? The other topic is quite confusing and I don't know if it even works anymore.Â
One of you guys should try the tutorial yourself; the attachment doesn't really go along with the tutorial that well. It's not being specific enough..Â
Thanks. Hope someone can help..
JAD2350- New Member
- Posts : 3
Reputation : 1
Language : English
Re: Theme Changer?
Try this one - http://www.webartzforum.com/t301-forumotion-theme-changer .
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Theme Changer?
Thank you, but I've tried that one, but it requires the power of the owner/creator. At the moment, I'm only an administrator on the forum. Do you have any other advice?
JAD2350- New Member
- Posts : 3
Reputation : 1
Language : English
Re: Theme Changer?
I have this theme changer:
http://www.webartzforum.com/t301-forumotion-theme-changer
I tested it on IE and Google Chrome and it doesn't work. It works only on Mozilla Firefox and I'm satisfied 'cause Firefox is my default browser.
http://www.webartzforum.com/t301-forumotion-theme-changer
I tested it on IE and Google Chrome and it doesn't work. It works only on Mozilla Firefox and I'm satisfied 'cause Firefox is my default browser.
Festina Lente- Forumember
- Posts : 279
Reputation : 20
Language : English
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: Theme Changer?
- Code:
$(function() {
var css = "<style>body {margin-top:50px !important;} select {color: #fff !important; background-color: #000 !important;} option {font-family: verdana; font-size: 10px; color: white;} option.sl {color: #fff !important; background-color: #000;} SELECT{ font-family: verdana; font-size: 10px; color: white; </style>",
select = '<div style="position: absolute; width: 150px; height: 15px; z-index: 1; left: 5px; top: 35px" id="skinselector"><form><select id="changeTheme" onchange="changeskin(this.options[this.selectedIndex].value);">',
//ADD THEMES TO THE themes And it will automatically add it. Don't forget to add the if statement like below in the second note.
themes =["Default","Pink","Blue","Gold","Purple","Dark"];
for(var i=0;i<themes.length;i++){
var options = '<option class="sl" value="'+themes[i]+'">'+themes[i]+' Theme</option>';
select+=options;
}
var head = $('head'),
body = $('body');
head.append(css);
body.append(select);
body.append('<link rel="stylesheet" id="themeChanger" type="text/css" href="" />');
var themeChanger= document.getElementById('themeChanger');
var scheme = getCookie('template1');
var path = window.location.hostname;
if (scheme == 'Default') {
themeChanger.href= path+"/21-ltr.css";
} else if (scheme == 'Pink') {
themeChanger.href=path+"/156736-ltr.css";
} else if (scheme == 'Blue') {
themeChanger.href=path+"/181526-ltr.css";
} else if (scheme == 'Gold') {
themeChanger.href=path+"/198644-ltr.css";
} else if (scheme == 'Purple') {
themeChanger.href=path+"/156869-ltr.css";
} else if (scheme == 'Dark') {
themeChanger.href=path+"/172924-ltr.css";
}//whenever adding another theme add another else if statement with the CSS
$('#changeTheme').change(function() {
var themeName = $(this).val();
var themeChanger= $('#themeChanger');
if (themeName == 'Default') {
themeChanger.attr('href',path+"/21-ltr.css");
} else if (themeName == 'Pink') {
themeChanger.attr('href',path+"/156736-ltr.css");
} else if (themeName == 'Blue') {
themeChanger.attr('href',path+"/181526-ltr.css");
} else if (themeName == 'Gold') {
themeChanger.attr('href',path+"/198644-ltr.css");
} else if (themeName == 'Purple') {
themeChanger.attr('href',path+"/156869-ltr.css");
} else if (themeName == 'Dark') {
themeChanger.attr('href',path+"/172924-ltr.css");
}
});
});
function changeskin(change) {
var scheme = change;
var name = 'template1';
var ExpDate = new Date ();
ExpDate.setTime(ExpDate.getTime() + (180 * 24 * 3600 * 1000));
setCookie(name,scheme,ExpDate);
}
function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) +
((expires === null) ? "" : "; expires=" + expires.toGMTString());
}
The code could probably be written a lot better, this was just something I redesigned for someone, and it was originally a mess. I will look into this more tomorrow and see if I can reredeign this to make it a whole lot better. This will automatically change the theme, and whenever going to another link that is the same domain it will stay the same as I've add the my personal cookie code.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum