psql db schema test
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / addAjax.inc
CommitLineData
51ff3226 1<?php function addAjax() {
2global $db,$error,$node, $error_messages;
3$add_ajax_id=$_POST['add_ajax_id']; if (!is_numeric($add_ajax_id)) {
4$error=$error_messages['NOT_NUMERIC'];
5return false; }
6$set=$db->query("select node_content,node_name from nodes left join node_content on node_content.node_id=nodes.node_id where nodes.node_id='$add_ajax_id'");
7$set->next();
8$node_content=$set->getString('node_content');
9$class_name=$set->getString('node_name');
10$fp = fopen (AJAX_DIR.$class_name.".php","w+");
11fwrite($fp,$node_content);
12fclose($fp);
13chown(AJAX_DIR.$class_name,"www");
14$q="update nodes set external_link='' where node_name='$class_name' and external_link='ajax://$class_name'";
15$db->query($q);
16$q="update nodes set external_link='ajax://$class_name' where node_id='".$add_ajax_id."'";
17$db->query($q);
18return true; }
19?>
This page took 0.248379 seconds and 4 git commands to generate.