X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Fsmarty%2Fresource.kyberia.php;h=1e4a7c1cc79ed32aaa2d0a06ab85115adb84e73b;hb=de8e1dde86dc65e8afcb8f569bbbebd8d7259468;hp=71670c9d105017986ffd60731be6146e9a3774e0;hpb=94c8f5b3e574715cc692f8a92f8d332e0c55804a;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/smarty/resource.kyberia.php b/wwwroot/inc/smarty/resource.kyberia.php index 71670c9..1e4a7c1 100644 --- a/wwwroot/inc/smarty/resource.kyberia.php +++ b/wwwroot/inc/smarty/resource.kyberia.php @@ -18,11 +18,14 @@ function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj) { $params['node_content'] = mysql_real_escape_string("addTemplate execute: node $add_template_id by user ".$_SESSION['user_name']); nodes::addNode($params); */ - + /* if(!($set=$db->query("select node_content from nodes where node_id='$add_template_id'"))) return false; $set->next(); + */ // populating $tpl_source with actual template contents - $tpl_source = stripslashes($set->getString('node_content')); + //$tpl_source = stripslashes($set->getString('node_content')); + $tpl_source = nodes::getNodeById($add_template_id,$_SESSION['user_id']); + $tpl_source = $tpl_source['node_content']; // return true on success, false to generate failure notification return true; } @@ -33,7 +36,9 @@ function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj) // do database call here to populate $tpl_timestamp // with unix epoch time value of last template modification. // This is used to determine if recompile is necessary. - $tpl_timestamp = time(); // this example will always recompile! FIXME!!! TODO!!! + $recompile = 100; //recompile every N seconds + $tpl_timestamp = floor(time()/$recompile)*$recompile; + // this example will recompile even unchanged templates! XXX!!! FIXME!!! TODO!!! // return true on success, false to generate failure notification return true; }