2 /* This program is free software. It comes without any warranty, to
3 * the extent permitted by applicable law. You can redistribute it
4 * and/or modify it under the terms of the Do What The Fuck You Want
5 * To Public License, Version 2, as published by Sam Hocevar. See
6 * http://sam.zoy.org/wtfpl/COPYING for more details. */
8 function configure_content() {
10 global $db,$error,$node;
11 $node_id=$node['node_id'];
13 if ($node['node_permission']!=('owner' OR 'master' OR 'op')) {
14 $error=$error_messages['EVENT_PERMISSION_ERROR'];
20 //warning - not forget!!! - if self-presentation of content (template form) than save as file into OWN_TEMPLATE folder
21 if ($node['template_id']==$node['node_id']) {
22 $node_content=stripslashes($_POST['node_content']);
23 $template_id=$node['template_id'];
24 $fp = fopen (OWN_TEMPLATE_DIR.$template_id.".tpl", "w+");
25 fwrite($fp,$node_content);
27 $external_link=OWN_TEMPLATE_DIR.$template_id.".tpl";
28 chown(OWN_TEMPLATE_DIR.$template_id.".tpl","www");
29 $q="update nodes set external_link='$external_link' where node_id='".$node['node_id']."'";
33 $node_content=nodes::processContent($_POST['node_content']);
38 $db->update("update nodes set node_updated=NOW() where node_id='$node_id'");
40 $result=$db->update("update node_content set node_content='$node_content' where node_id='$node_id'");
42 $result=$db->query("insert into node_content set node_content='$node_content',node_id='$node_id'");