10 //registration question specification
11 $requests[] = array("senate_request"=>2228983,
12 "function"=>"update_template",
13 "params"=>array("change_node_id"=>791946));
15 function update_template($params) {
17 $node_id = $params['change_node_id'];
18 if (!is_numeric($node_id)) return false;
19 $q = "update node_content set node_content = '".$params['content']."' where node_id=$node_id";
21 $fp = fopen (OWN_TEMPLATE_DIR
.$node_id.".tpl", "w+");
22 fwrite($fp,$params['content']);
24 chown(OWN_TEMPLATE_DIR
.$node_id.".tpl","www");
27 // Use relative address of config file
28 // Change this, if you move you cron directory.
29 $dir=substr(__FILE__
, 0, strrpos(__FILE__
, '/'));
30 require_once($dir.'/../wwwroot/config/config.inc');
32 //connecting to database and creating universal $db object
33 require_once(INCLUDE_DIR
.'/log.inc');
34 require_once(INCLUDE_DIR
.'/database.inc');
35 require_once(INCLUDE_DIR
.'/nodes.inc');
36 $db=new CLASS_DATABASE();
38 foreach ($requests as $request) {
39 $request_id = $request['senate_request'];
40 $set = $db->query("select node_content from nodes left join node_content on nodes.node_id = node_content.node_id where node_parent='$request_id' order by k desc limit 1");
42 $params = $request['params'];
43 $params['content'] = addslashes($set->getString('node_content'));
44 $request["function"]($params);
This page took 0.285944 seconds and 4 git commands to generate.