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