foxed K cron script
[mirrors/Kyberia-bloodline.git] / cron / ps.php
CommitLineData
b42b2bf9
H
1#!/usr/local/bin/php
2<?php
3//registration question specification
4$requests[] = array("senate_request"=>2228983,
5"function"=>"update_template",
6"params"=>array("change_node_id"=>791946));
7
8function update_template($params) {
9 global $db;
10 $node_id = $params['change_node_id'];
11 if (!is_numeric($node_id)) return false;
12 $q = "update node_content set node_content = '".$params['content']."' where node_id=$node_id";
13 $db->query($q);
14 $fp = fopen (OWN_TEMPLATE_DIR.$node_id.".tpl", "w+");
15 fwrite($fp,$params['content']);
16 fclose($fp);
17 chown(OWN_TEMPLATE_DIR.$node_id.".tpl","www");
18}
19
20require('../config/config.inc');
21//connecting to database and creating universal $db object
22require(SYSTEM_ROOT.'/inc/log.inc');
23require(SYSTEM_ROOT.'/inc/database.inc');
24require(SYSTEM_ROOT.'/inc/nodes.inc');
25require(SYSTEM_ROOT.'/inc/senate.inc');
26$db=new CLASS_DATABASE();
27
28foreach ($requests as $request) {
29 $request_id = $request['senate_request'];
30 $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");
31 $set->next();
32 $params = $request['params'];
33 $params['content'] = addslashes($set->getString('node_content'));
34 $request["function"]($params);
35}
36
37
38?>
This page took 0.222082 seconds and 4 git commands to generate.