RE:RE caching problem

From: Date: Wed, 27 Feb 2002 21:10:46 +0000
Subject: RE:RE caching problem
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2882@lists.php.net to get a copy of this message
But, may the problem is here: Thats the really index.php file. You can see there is a function wich include some code depending of a variable. <?php function include_main_code(){ global $link; if($link == "phparchive"){ include("sitefiles/phparchive.htm"); } else if($link == "forum"){ include("../phorum-3.3/admin/settings/forums.php"); } else{ $link_db=1; include("phparchive/php_a_config.php"); } } require("smarty/Smarty.class.php"); $smarty = new Smarty; $smarty->caching=true; $smarty->compile_check = true; $smarty->debugging = false; $GLOBALS['REQUEST_URI']; $tpl ="index.tpl"; echo $REQUEST_URI;//--test if request changed for differnt db calls if(!$smarty->is_cached($tpl,$REQUEST_URI)){ if($link) $smarty->assign("home", "<a href=\"index.php\"> Home</a>"); else $smarty->assign("home", "Home"); if($link != "phparchive") $smarty->assign("phparchive_project","<a href=\"$PHP_SELF?link=phparchive\">php_archive</a>"); else $smarty->assign( "phparchive_project","<font color=\"#663366\"><b>php_archive</b></font>"); if($link != "maketable") $smarty->assign("maketable","<a href=\"$PHP_SELF?link=maketable\">maketable</a>"); else $smarty->assign( "maketable","<font color=\"#663366\"><b>maketable</b></font>"); if($link != "addtag") $smarty->assign("addtag","<a href=\"$PHP_SELF?link=addtag\">addtag</a>"); else $smarty->assign( "addtag","<font color=\"#663366\"><b>addtag</b></font>"); if($link != "forum") $smarty->assign("forum","<a href=\"$PHP_SELF?link=forum\">forum</a>"); else $smarty->assign( "forum","<font color=\"#663366\"><b>forum</b></font>"); $smarty->register_function("include_main","include_main_code"); $smarty->assign( "phpbuilder",implode("",(@file("include/phpbuilder.com.php")))); $smarty->assign( "xmlcom",implode("",(@file("include/xml.com.php")))); $smarty->assign( "w3org",implode("",(@file("include/w3.org.php")))); $smarty->assign( "wired",implode("",(@file("include/wired.com.php")))); $smarty->assign( "bbc",implode("",(@file("include/bbc.com.php")))); } $smarty->display($tpl,$REQUEST_URI); ?>

« previous php.smarty.general (#2882) next »