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( substr( basename($HTTP_SESSION_VARS[demoreturn]), 0, 5 ) == "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!!!
|