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.

Multi-Themes

View previous topic View next topic Go down

Multi-Themes

Post by Behaviour??? on June 4th 2010, 4:25 pm

I am having problem with the Multi Themes Darren posted, since he will not be available for some long time, I thought I would make a Topic regarding this

So far, This is the HTML page I have coded using the information from the tutorail

Code:
var type = getCookie('template1');
    var temsel = document.getElementById('temsel');
    temsel.innerHTML ='<select onchange="changeskin(this.options[this.selectedIndex].value);window.location.reload();"><option> Choose your theme  </option><option value="valeur1"> Hogwarts1</option><option value="valeur2">Hogwarts2</option><option value="valeur3"> Hogwarts3 </option><option value="valeur3"> Hogwarts4 </option></select>';




    if (type == 'valeur1')
    {
      document.write('<link rel="stylesheet" type="text/css" href="http://dunegoens.forumotion.com/153448-ltr.css">');
    }
    else if (type == 'valeur2')
    {
      document.write('<link rel="stylesheet" type="text/css" href="http://dungeons.forumotion.com/148641-ltr.css">');
    }
    else if (type == 'valeur3')
    {
      document.write('<link rel="stylesheet" type="text/css" href="http://dungeons.forumotion.com/116414-ltr.css">');
    }
    else if (type == 'valeur4')
    {
      document.write('<link rel="stylesheet" type="text/css" href="    http://dungeons.forumotion.com/142885-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"); }

When i preview it, i do see the theme changer with the following code

Code:

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

The above code appears in the preview page with no Out put produced

Then again, when i add the given code in the templates by the given tutorial, and save and PUBLISH it it doesnot show the theme selector! (I must indeed say that no changes I make in the templates appear, i dont know why it is?')

And on a related Note- i use PhpBB2

This is my problem

Behaviour???
Forumember

Posts : 293
Reputation : 0
Language : English

http://dungeons.forumotion.com/

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