3 function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj) {
5 global $db,$error,$node, $error_messages;
6 $add_template_id = preg_replace('/\.tpl$/', '', $tpl_name);
8 if (!is_numeric($add_template_id)) {
9 $error = $error_messages['NOT_NUMERIC'];
14 //logging of every template for security reasons FIXME!!! TODO!!!
15 $params['node_creator'] = UBIK_ID;
16 $params['node_parent'] = 2029360;
17 $params['node_name'] = "addTemplate execute: node $add_template_id";
18 $params['node_content'] = mysql_real_escape_string("addTemplate execute: node <a href='$add_template_id'>$add_template_id</a> by user ".$_SESSION['user_name']);
19 nodes::addNode($params);
22 if(!($set=$db->query("select node_content from nodes where node_id='$add_template_id'"))) return false;
24 // populating $tpl_source with actual template contents
25 $tpl_source = stripslashes($set->getString('node_content'));
26 // return true on success, false to generate failure notification
31 function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj)
33 // do database call here to populate $tpl_timestamp
34 // with unix epoch time value of last template modification.
35 // This is used to determine if recompile is necessary.
36 $tpl_timestamp = time(); // this example will always recompile! FIXME!!! TODO!!!
37 // return true on success, false to generate failure notification
41 function db_get_secure($tpl_name, &$smarty_obj)
43 // assume all templates are secure
44 return true; //FIXME!!! TODO!!!
47 function db_get_trusted($tpl_name, &$smarty_obj)
49 // not used for templates
52 // register the resource name "kyberia"
53 $smarty->register_resource('kyberia', array('db_get_template',
This page took 0.298841 seconds and 4 git commands to generate.