ThemeSwitcher by Darren Optimisation
2 posters
Page 1 of 1
ThemeSwitcher by Darren Optimisation
@ https://help.forumotion.com/t71484-add-multi-themes-to-your-forum
I hope after reading this the author edits the original code.
Problems via author's method
1] Not working in IE9
2] Absolute positioning plays havoc with theme
3] Why change css of 'select' tag when we can use the builtin
4]Higher loading time
With customisations:
Opposite of the four above
Plus you can place the dropdown anywhere & not just at the top left corner.
Will only discuss customisations rest you have to follow author's steps
get rid of this block
place all of this in javascript file via js management
place this as html wherever you want the dropdown to appear
You are all set...
In the coming days I hope someone changes the core script to create cookies via FM's builit
I hope after reading this the author edits the original code.
Problems via author's method
1] Not working in IE9
2] Absolute positioning plays havoc with theme
3] Why change css of 'select' tag when we can use the builtin
4]Higher loading time
With customisations:
Opposite of the four above
Plus you can place the dropdown anywhere & not just at the top left corner.
Will only discuss customisations rest you have to follow author's steps
get rid of this block
- Code:
document.write('<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>');
place all of this in javascript file via js management
- Code:
var scheme = getCookie('template1');
if (scheme == 'Defaul') {
document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="(DEFAULT THEME)http://testorial.forumotion.com/169155-ltr.css">');
} else if (scheme == 'Black') {
document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="(CUSTOM THEME 1)http://testorial.forumotion.com/169154-ltr.css">');
} else if (scheme == 'Purple') {
document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="(CUSTOM THEME 2)http://testorial.forumotion.com/168970-ltr.css">');
} else if (scheme == 'Yellow') {
document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="(CUSTOM THEME 3)http://testorial.forumotion.com/168975-ltr.css">');;
}
function changeskin(change) {
var scheme = change;
var name = 'template1';
var pathname = location.pathname;
var myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var ExpDate = new Date ();
ExpDate.setTime(ExpDate.getTime() + (180 * 24 * 3600 * 1000));
setCookie(name,scheme,ExpDate,myDomain);
}
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, path, domain, secure) {
document·cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
place this as html wherever you want the dropdown to appear
- Code:
<script type=text/javascript>document.write('<div style="position: absolute; width: 150px; height: 38px; z-index: 1; left: 5px; top: 10px" id="skinselector"><form><select onchange="changeskin(this.options[this.selectedIndex].value); window.location.reload();"><option class="sl"> Change the Skin </option><option class="sl" value="Defaul"> Default </option><option class="sl" value="Black"> CUSTOM THEME 1</option><option class="sl" value="Purple"> CUSTOM THEME 2</option><option class="sl" value="Yellow"> CUSTOM THEME 3 </option></select></form></div>');</script>
You are all set...
In the coming days I hope someone changes the core script to create cookies via FM's builit
- Code:
my_setCookie()
Re: ThemeSwitcher by Darren Optimisation
why dint you just PM Darren about this?
kirk- Forumaster
- Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn
Re: ThemeSwitcher by Darren Optimisation
you may be right, but I let people play with it & by their feedback even I may know whether I am right, but I wil PM him now
Re: ThemeSwitcher by Darren Optimisation
well copy the post and save it, then when yous have it worked out it can be submitted,
I dont want to leave it here until it's working how it should be.
I dont have the time to test it all myself
I dont want to leave it here until it's working how it should be.
I dont have the time to test it all myself
kirk- Forumaster
- Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn
Re: ThemeSwitcher by Darren Optimisation
well from my side I have tested in all browsers you do get all the benefits I listed. I assure you its not buggy. Keep it here until Darren comes I had PM him
Re: ThemeSwitcher by Darren Optimisation
yeah ok i will for now.
Next time please pm anyone that has a tutorial on here that you may be modifying or have another method for,
Next time please pm anyone that has a tutorial on here that you may be modifying or have another method for,
kirk- Forumaster
- Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum