View Single Post
Old 01-19-2004   #4 (permalink)
Order
Local Biorust Beast
 
Order's Avatar
 
Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,253

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
Skinning sites, real simple, all it involves is a cookie! Here is the php code to handle it, you will have to figure out how to make use though..

PHP Code:
<?php

  
if(!$_POST['skin'])
  {
    die(
"No Form Input");
  }
  else
  }
   if(
file_exists("templates/" $_POST['skin'] . "/header.php"))
   {
    
setcookie("skin"$_POST['skin']);
   }
    else
   {
     die(
"Template Does Not Exist");
   }
  }

?>
That can be added to, basically it looks in a folder called templates, and if there is a folder with the skins name, which will hold your header and footer files (header.php and footer.php).

And just add this bit of code into your pages:

PHP Code:
<?php

  
if(!$_COOKIE['skin'])
  {
    include(
"templates/default/header.php");
  }
  else
  {
    include(
"templates/" $_COOKIE['skin'] . "/header.php");
  }

?>

Normal page info here...

<?php

  
if(!$_COOKIE['skin'])
  {
    include(
"templates/default/footer.php");
  }
  else
  {
    include(
"templates/" $_COOKIE['skin'] . "/footer.php");
  }

?>

And you have a decent Skinning System. If m0g wants to convert this into a tutorial, he can.. lmao
__________________
Order is offline