bd7d1ce932192f4f27a6f5db74e15e953de8df3f
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / addClass.inc
1 <?php
2 function addClass() {
3
4 global $db,$error,$node, $error_messages;
5 $add_class_id=$_POST['add_class_id'];
6
7 if (!is_numeric($add_class_id)) {
8 $error=$error_messages['NOT_NUMERIC'];
9 return false;
10 }
11
12 $set=$db->query("select node_content,node_name from nodes left join node_content
13 on node_content.node_id=nodes.node_id where nodes.node_id='$add_class_id'");
14 $set->next();
15 $node_content=$set->getString('node_content');
16 $class_name=$set->getString('node_name');
17 $fp = fopen (INCLUDE_DIR.$class_name,"w+");
18 fwrite($fp,$node_content);
19 fclose($fp);
20 chown(INCLUDE_DIR.$class_name,"www");
21
22 $q="update nodes set external_link='' where node_name='$class_name' and external_link='include://$class_name'";
23 $db->query($q);
24 $q="update nodes set external_link='include://$class_name' where node_id='".$add_class_id."'";
25 $db->query($q);
26
27 return true;
28 }
29
30 ?>
31
32
33
34
This page took 0.249826 seconds and 3 git commands to generate.