51ff3226 |
1 | <?php |
2 | function configure_content() { |
3 | global $db,$error,$node; |
4 | $node_id = $node['node_id']; |
5 | |
6 | if ($node['node_permission']!=('owner' || 'master' || 'op')) { |
7 | $error = $error_messages['EVENT_PERMISSION_ERROR']; |
8 | return false; |
9 | } |
10 | |
11 | $node_content = nodes::processContent($_POST['node_content']); |
12 | |
13 | if ($_POST['code']) { |
14 | $params['node_creator'] = UBIK_ID; |
15 | $params['node_parent'] = WARNING_ZONE; |
16 | $params['node_name'] = "node $node_id configured as code"; |
17 | $params['node_content'] = mysql_real_escape_string("node <a href=/id/$node_id>$node_id</a> added as code by user ".$_SESSION['user_name']); |
18 | unset($_POST['code']); |
19 | nodes::addNode($params); |
20 | } |
21 | |
22 | if (!$node_content) { |
23 | return false; |
24 | } |
25 | |
26 | $db->update("update nodes set node_updated=NOW() where node_id='$node_id'"); |
27 | $user_id = $_SESSION['user_id']; |
28 | $qtiamat = "insert into tiamat (node_id,node_name,node_parent,node_vector, |
29 | node_external_access,node_system_access,node_children_count,node_creator,node_created,lastchild_created,k, |
30 | node_views,node_destructor,node_content,node_descendant_count,lastdescendant_created,template_id,update_performed) |
31 | select node_id,node_name,node_parent,node_vector,node_external_access,node_system_access, |
32 | node_children_count,node_creator,node_created,lastchild_created,k,node_views,'$user_id',node_content, |
33 | node_descendant_count,lastdescendant_created,template_id, NOW() |
34 | from nodes where node_id = '$node_id'"; |
35 | $db->query($qtiamat); |
c2adde90 |
36 | |
6b8c2d44 |
37 | $qu = "update nodes set node_content = '".mysql_real_escape_string($node_content)."' where node_id = '$node_id'"; |
51ff3226 |
38 | $result = $db->update($qu); |
6b8c2d44 |
39 | $qu2 = "update node_content set node_content = '".mysql_real_escape_string($node_content)."' where node_id = '$node_id'"; |
51ff3226 |
40 | $result = $db->update($qu2); |
41 | |
42 | return true; |
43 | } |
44 | ?> |