DIR Return Create A Forum - Home
---------------------------------------------------------
Create A Forum - Support Forums
HTML https://support.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Style Support
*****************************************************
#Post#: 2350--------------------------------------------------
Re: Just a quick question
DIR By: Alex P.
Date: August 21, 2011, 9:31 pm
---------------------------------------------------------
If any of you would like this, feel free to make a topic in the
suggestions board. ;)
#Post#: 2351--------------------------------------------------
Re: Just a quick question
DIR By: simply sibyl
Date: August 21, 2011, 10:12 pm
---------------------------------------------------------
--- Quote from: xboi209 link ---
>
> [quote author=Seldom Fail link=topic=611.msg2339#msg2339
date=1313880371]
> [quote author=xboi209 link=topic=611.msg2323#msg2323
date=1313798870]
> I doubt that'll be possible in the future
>
--- End Quote ---
not necessarily true. If someone can come up with a style
changer code that works with CAF, then it would be possible.
[/quote]
Yes but the chances of someone doing that for CaF is pretty low.
This is unless Createaforum himself tries to find a way but I'm
pretty sure he's busy
[/quote]
Actually the chances are not low at all. One of the style
changer codes that is used with the SMF for Free forums WILL
work with the forums with Createaforum with just a small edit to
the code. I have it working on my CreateaForum test forum.
The thing is though that there are few styles posted here and
those that are are not all updated to work properly with smf 2.0
so for right now the codes pretty senseless for me to bother
posting.
I'll go ahead and post it if anyone wants to play around with it
but as I said there arent many styles to use with it at the
moment.
This code is a combination of Agent Moose's dropdown code and
some tweaks by me
A. Set your forum to the Default Style
B. Find other styles you want to use. Add each of them in
Style Manager.
C. For each of those stylesheets edit these lines in the code:
(add more if you need them, delete those you do not need)
--- Code ---
Skin[n++] = ["STYLE
NAME","
HTML http://www.createaforum.com/styles/FORUM<br
/>NAME/STYLE.css?fi11"];
--- End Code ---
1. Replace "STYLE NAME" with the name of the style
(this is how the name will show in the dropdown box)
2. Replace "FORUM NAME" with the name of your forum.
3. Replace "STYLE" with the name of the style.
(the name you named the style when you created it in
manage styles)
Do this for each one you want to use.
D. When done with the edits the code goes in your Header and
will center the dropdown box at the top of your forum.
--- Code ---
<script>
var n = 0;var Skin = new Array();
Skin[n++] = ["STYLE
NAME","
HTML http://www.createaforum.com/styles/FORUM<br
/>NAME/STYLE.css?fi11"];
Skin[n++] = ["STYLE
NAME","
HTML http://www.createaforum.com/styles/FORUM<br
/>NAME/STYLE.css?fi11"];
Skin[n++] = ["STYLE
NAME","
HTML http://www.createaforum.com/styles/FORUM<br
/>NAME/STYLE.css?fi11"];
Skin[n++] = ["STYLE
NAME","
HTML http://www.createaforum.com/styles/FORUM<br
/>NAME/STYLE.css?fi11"];
//Created by Agent Moose (smcodes.smfforfree3.com)
document.write("<center><select id='SkinChooser'><option
value='default'>Choose Style</option>");
for(i=0;i<Skin.length;i++){
document.write("<option value='" + Skin[i][1] + "'>" +
Skin[i][0] + "</option>");
};
document.write("</select> <input type='button' value='Change'
onclick='setSkin();' /></center>");
function setCookie(name, value, expires){
var deCookie = name + "=" + escape(value);
if(expires){
expires= expires.toGMTString();
deCookie += "; expires=";
deCookie += expires;
};
document.cookie = deCookie;
};
function getCookie(name){
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1){
begin = dc.indexOf(prefix);
if (begin != 0) return false;
}else begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
};
function delCookie(name){
expires = new Date(1807,1,1);
expires = expires.toGMTString();
deCookie = name;
deCookie += "=delete; expires=";
deCookie += expires;
document.cookie = deCookie;
};
function changeSkin(Agent){
document.write("<link rel='stylesheet' type='text/css' href='"
+ Agent + "' />");
};
var Omi = "default";
document.getElementById("SkinChooser").onchange = function(){
if(Skin[parseInt(document.getElementById("SkinChooser").selectedIndex)-1]){
Omi =
Skin[parseInt(document.getElementById("SkinChooser").selectedIndex)-1][1]
}else{
Omi = "default";
};};
function setSkin(){
if(Omi == "default") delCookie("Skin");
if(Omi != "default") setCookie("Skin",Omi,new Date(9999,1,1));
window.location.reload();
};
changeSkin(getCookie("Skin"));
</script>
--- End Code ---
#Post#: 2355--------------------------------------------------
Re: Just a quick question
DIR By: xboi209
Date: August 21, 2011, 10:44 pm
---------------------------------------------------------
Cool, I got an idea on what to do with this code now :D
And does it really have to use cookies?
#Post#: 2356--------------------------------------------------
Re: Just a quick question
DIR By: simply sibyl
Date: August 22, 2011, 9:58 am
---------------------------------------------------------
xboi - yes. That is how it knows what style you have chosen.
Otherwise you will have to keep choosing it when you visit the
forum. Of course if you have your browser remove cookies
upon closing it, or use a program that cleans up cookies for
you, you'll have to do so each time too. The code does not
access your Look & Layout settings preferences for themes. It
merely gives you an option of which style to use (styles only
change the look of the default theme) and via cookies remembers
your choice.
#Post#: 2413--------------------------------------------------
Re: Just a quick question
DIR By: Pyro
Date: August 25, 2011, 6:12 pm
---------------------------------------------------------
Alright! That is awesome! :)
Thank you so much! :D
#Post#: 22972--------------------------------------------------
Re: Just a quick question
DIR By: mickjav
Date: April 8, 2020, 6:38 am
---------------------------------------------------------
Just wanted to ask is this code/method approved or has a user
option been added as have been trying to find a way ofallowing
some users to select there prefered style.
thanks keep safe mick
#Post#: 22973--------------------------------------------------
Re: Just a quick question
DIR By: mickjav
Date: April 8, 2020, 7:21 am
---------------------------------------------------------
Just thought I would give the code a try but don't seem to work
on Modzilla.
edit must be me the forum in OP works so must work
*****************************************************
Page 2 of 2
DIR Previous Page