PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Payam Khaninejad  >  Smarty Template Engine Theme Selection Class  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Local example page
Class: Smarty Template Engine Theme Selection Class
Load a Smarty template theme defined in XML
Author: By
Last change:
Date: 4 years ago
Size: 1,983 bytes
 

Contents

Class file image Download
<?php
/*
=============================================================
Script Name : Smarty Template Engine Loader
Auther : Payam khaninejad
Contact : Progvig@yahoo.com
Follow me on twitter : http://twitter.com/khaninejad
Location : Iran-Azarbayjan
Year : 2011-02-25
Version : 1.0
=============================================================
*/
// include theme loader
require_once("load-theme.class.php");
// include smarty class. You can download smarty from http://www.smarty.net/download
require_once("class/smarty/Smarty.class.php");
$smarty = new Smarty;
$my=new load_theme;
// Check whether the theme has changed?!
if(isset($_GET['thm']))
{
   
$my->default_theme=$_GET['thm'];
}
if(isset(
$_GET['del']))
{
   
// with deleting default theme, you will get error
   
if(!$my->delete_theme($_GET['del'])){
    echo
"dir dosn't exits";
    }
}

// read installed theme
$my->read_dir();

// disable debugging in smarty
$smarty->debugging = false;
// disable caching
$smarty->caching = false;
///////////////////////////////////////////////
// default theme title
$title="smarty simple 2";
// simple text
$welcome="Smarty Template Engine Theme Selection Class";
// it used to find header place in server
$header_theme_path=dirname ( __FILE__ )."/theme/".$my->default_theme."/header.tpl";
//get them installed url
$theme_path=$my->theme_url_path.$my->default_theme;
$theme_box=$my->theme_box;
///////////////////////////////////////////////
// assign variable
$smarty->assign("title", $title);
$smarty->assign("header_theme_path", $header_theme_path);
$smarty->assign("welcome", $welcome);
$smarty->assign("theme_path", $theme_path);
$smarty->assign("theme_box", $theme_box);
// display theme using smarty
$smarty->display(dirname ( __FILE__ )."/theme/".$my->default_theme.'/index.tpl');
// show theme selection box


?>