Results 1 to 6 of 6

Thread: Switch template for index

  1. #1
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default Switch template for index

    Hi i was just on your online demo and saw Switch template.

    I would like to know how to do it for index.html, i think be a cool feature to have for users.


  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    The way it's done is not a good way to do it, plus it doesn't work for all browsers. There is no code available so you would need to figure out how it's done, I have ideas as to how it can be done, but have no code for it.

  3. #3
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    I jsut did a quick test, seems its pretty simple to do with a little hack to application.php - this is in no way a workign example, just a concept that seems to work. You need to make a template switcher that sets a cookie, and then change the code here to a cookie checking code. I did this quick-and-dirty to see if it worked.

    If your interested in this, i could probably write an article on my site, but its going to be a few weeks i got tons of stuff lined up now!

    Okay so check it out :
    http://indexu.co.uk/demoSVN/index.php?usertheme=momo
    and
    http://indexu.co.uk/demoSVN/index.php?usertheme=kosmos

    notice i can overwrite the default theme easily. In application.php the code i have is :

    Code:
    //theme checker. 
    $usertheme = $_REQUEST['usertheme'];
    if ($usertheme !='') {
    $active_theme = $usertheme;
    }
    else {
      $active_theme           = 'kosmos';
    }
    // end theme checker.
    and thats it ... i would need to replace the application.php code to check for a cookie instead ( $_COOKIE['usertheme'] instead of $_REQUEST ) and i would need to build a theme changer that set the cookie

    I havent had time to see whats messed up with the momo theme, i jsut dont think its completed... i havent uploaded any other alternative themes so i jsut used that as it was already available

    okay hope that sparks some ideas.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  4. #4
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    okay, probably need to add the cookie checking code in a couple more php files, but doesnt look too difficult.. dont have time to check further though.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  5. #5
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Smile

    OK il give this thread sometime since i am a total noob in this lol.

    Il just keep checking every so often.

    But thanks to look into it.

  6. #6
    Join Date
    Feb 2008
    Posts
    22

    Default

    Well, I dont think this will be useful for most users.
    But if you're selling templates, then this is a must have mods.

    I have this kind of mods, but it is not free mods.
    I'm not sure that if mods will for work all browsers, but I have test it on IE, FF, Opera and no problem so far.

    Let me know if you interested.

Similar Threads

  1. How to Switch Themes In Indexu54?
    By sissy in forum v5.x
    Replies: 2
    Last Post: 01-01-2008, 11:42 AM
  2. 3 New Template Available + Template Price reduced!!
    By sikumbang in forum Templates
    Replies: 9
    Last Post: 07-23-2007, 09:27 AM
  3. switch DB?
    By inspireme in forum v5.x
    Replies: 4
    Last Post: 08-29-2006, 02:24 PM
  4. switch to smarty template engine
    By dody in forum v5.x
    Replies: 20
    Last Post: 01-10-2005, 04:58 PM
  5. Replies: 3
    Last Post: 04-24-2003, 04:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •