Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
change theme / template
Old 07-07-2005, 05:56 PM change theme / template
Novice Talker

Posts: 5
Trades: 0
Just wondering if anyone can help, I have this php system which is like a cms. You can have templates for it and download them etc

Im having a problem with a snippet of code which I have been given, which basically changes the theme of the site by switching templates.

Could you explain the code to me so I maybe then can understand where Im going wrong.

I have put this into a seperate php file -

PHP Code:
<?php
session_start
();
$HTTP_SESSION_VARS[demohomepage] = "index$templatenumber".php";
$HTTP_SESSION_VARS[demoheader] = "topmenu$templatenumber".php";
$HTTP_SESSION_VARS[demofooter] = "footer$templatenumber".html";
$HTTP_SESSION_VARS[demometa] = "meta$templatenumber".html";
if( 
$templatenumber )
    
$HTTP_SESSION_VARS[tabstyle] = "tngtabs1-$templatenumber".css";
else
    
$HTTP_SESSION_VARS[tabstyle] = "tngtabs1.css";
//tab style sheets must have tngtab.png graphics = tngtab-1.php, tngtab-2.php

if( substrbasename($HTTP_SESSION_VARS[demoreturn]), 0) == "index" $HTTP_SESSION_VARS[demoreturn] = "index$templatenumber".php";
header"Location: " $HTTP_SESSION_VARS[demoreturn] );
?>

now basically within index.php I call this via a href -


Code:
link - settemplate.php?templatenumber=2


Basically it seems to call it but doesnt change the template / theme.

Thank you immensely for any help!!!
judas_1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-08-2005, 03:21 AM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Where you having any error output ???
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 07-08-2005, 05:22 AM
Novice Talker

Posts: 8
Trades: 0
Maybe register globals is off

change this statement from

if( $templatenumber )

to

if( $_GET['templatenumber'] )

And see if that works. (just a thought) everything else seems ok
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
andrade is offline
Reply With Quote
View Public Profile
 
Old 07-08-2005, 08:29 AM
Novice Talker

Posts: 5
Trades: 0
I changed that, and no help.

I have set the settemplate.php into the root dir and then called all the other templates - index1.php, index2.php etc etc is this correct?

Any thoughts?

thank you so much!
judas_1 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to change theme / template
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.68796 seconds with 12 queries