The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Multitheme code

View previous topic View next topic Go down

Multitheme code

Post by intricity on September 12th 2010, 9:46 pm

http://help.forumotion.com/tricks-tips-f32/add-multi-themes-to-your-forum-by-darren-t71484.htm

Refering to that topic, how exactly am I supposed to copy that image since there is no writen code of it anywhere -.-

intricity
New Member

Posts : 8
Reputation : 0
Language : Serb

Back to top Go down

Re: Multitheme code

Post by KingOfSports on September 12th 2010, 11:07 pm

What image?
avatar
KingOfSports
Hyperactive

Male Posts : 2487
Reputation : 38
Language :
Location :

Back to top Go down

Re: Multitheme code

Post by intricity on September 13th 2010, 9:33 pm


intricity
New Member

Posts : 8
Reputation : 0
Language : Serb

Back to top Go down

Re: Multitheme code

Post by Sanket on September 13th 2010, 9:36 pm

Those images i think are there to explain the code given above the images.
avatar
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2827
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

Re: Multitheme code

Post by Adam360 on September 13th 2010, 9:44 pm

@Sanket wrote:Those images i think are there to explain the code given above the images.

Confirmed!
avatar
Adam360
Forumember

Male Posts : 866
Reputation : 11
Language : English
Location : England

http://GameBase.betaboard.net

Back to top Go down

Re: Multitheme code

Post by Darren1 on September 14th 2010, 6:44 am

Naughty Darren

Here is the Code for the HTML Page
Code:
ar type = getCookie('template1');
var temsel = document.getElementById('temsel');
temsel.innerHTML =' Changer le style 1 YOUR NEW SKIN NAME HERE2 YOUR NEW SKIN NAME HERE 3 YOUR NEW SKIN NAME HERE ';




if (type == 'valeur1')
{
  document.write('');
}
else if (type == 'valeur2')
{
  document.write('');
}
else if (type == 'valeur3')
{
  document.write('');
}


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,'/');
}
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");
}

I'm 90% certain that is the correct code, otherwise Ill have to go re-fetch it from a long lost folder.
Make sure you follow the tut exactly as it says, and if you encounter any problems, were all here to help Wink
avatar
Darren1
Helper
Helper

Male Posts : 11853
Reputation : 563
Language : English

Back to top Go down

Re: Multitheme code

Post by intricity on September 18th 2010, 3:48 pm

Section 2.2 Making the script ours
Reminder: We can only edit section 1 and 2 of the script

This is where the problems start, I'm not really sure what script does the guide talk about, if it's the one you wrote above then I can't locate "<option> Choose your theme </option>" if that's not it then what exactly is it?

intricity
New Member

Posts : 8
Reputation : 0
Language : Serb

Back to top Go down

Re: Multitheme code

Post by Darren1 on September 19th 2010, 3:24 am

Sorry, my mistake, here's the full code, I must of given you the incomplete one ><

Code:
var type = getCookie('template1');
var temsel = document.getElementById('temsel');
temsel.innerHTML ='<select onchange="changeskin(this.options[this.selectedIndex].value);window.location.reload();"><option> Changer le style </option><option value="valeur1"> Kagamine - Kingyo.Akki </option><option value="valeur2"> School Time - Quierra </option><option value="valeur3"> Web 2.2 rose - Capucine </option></select>';




if (type == 'valeur1')
{
    document.write('<link rel="stylesheet" type="text/css" href="http://themeselect.forumactif.com/143387-ltr.css">');
}
else if (type == 'valeur2')
{
    document.write('<link rel="stylesheet" type="text/css" href="http://themeselect.forumactif.com/143694-ltr.css">');
}
else if (type == 'valeur3')
{
    document.write('<link rel="stylesheet" type="text/css" href="http://themeselect.forumactif.com/131817-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,'/');
}
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");

That should do it.
avatar
Darren1
Helper
Helper

Male Posts : 11853
Reputation : 563
Language : English

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum