mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 19:30:25 +02:00
content: added template require function, notice removal
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_class.php,v $
|
||||
| $Revision: 1.16 $
|
||||
| $Date: 2007-04-13 10:05:45 $
|
||||
| $Revision: 1.17 $
|
||||
| $Date: 2007-04-16 20:41:01 $
|
||||
| $Author: lisa_ $
|
||||
+---------------------------------------------------------------+
|
||||
*/
|
||||
@@ -558,6 +558,36 @@ class content{
|
||||
return "(^|,)(".str_replace(",", "|", $var).")(,|$)";
|
||||
}
|
||||
|
||||
//function to check and require the template file
|
||||
//$var: array of all variables that need to be global'ed
|
||||
//$var[0]: holds the primary var to check isset on (if the template var exists ($MYTEMPLATE))
|
||||
//$file: the actual filename (template.php)
|
||||
function gettemplate($var, $file=''){
|
||||
global $content_pref, $tp;
|
||||
|
||||
if(is_array($var)){
|
||||
$check = $$var[0];
|
||||
foreach($var as $t){
|
||||
global $$t;
|
||||
}
|
||||
}else{
|
||||
$check = $var;
|
||||
global $var;
|
||||
}
|
||||
|
||||
if(!isset($check)){
|
||||
if(!$content_pref["content_theme"]){
|
||||
require_once(e_PLUGIN."content/templates/default/".$file);
|
||||
}else{
|
||||
if( is_readable($tp->replaceConstants($content_pref["content_theme"]).$file) ){
|
||||
require_once($tp->replaceConstants($content_pref["content_theme"]).$file);
|
||||
}else{
|
||||
require_once(e_PLUGIN."content/templates/default/".$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCategoryTree($id, $parent, $classcheck=TRUE, $cache=true){
|
||||
//id : content_parent of an item
|
||||
global $plugintable, $datequery, $agc;
|
||||
|
Reference in New Issue
Block a user