X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Feventz%2Fadd.inc;h=e4b68d03f65cc2e975ab867cf9a30c1f44b868a5;hb=d2cf0fe02b06534a460bd8f9dc814007dc66ac41;hp=36986a76cbb467672ff1292b62b952107ee1af83;hpb=78f1a5f44941de2459b71c375e36cf88227c689c;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/eventz/add.inc b/wwwroot/inc/eventz/add.inc index 36986a7..e4b68d0 100644 --- a/wwwroot/inc/eventz/add.inc +++ b/wwwroot/inc/eventz/add.inc @@ -92,23 +92,6 @@ function add() { $node_content=nodes::processContent($node_content); - if ($node_system_access=='crypto') { - - require(INCLUDE_DIR.'crypto.inc'); - - if ($_SESSION['crypto'][$node_parent]) { - $key=$_SESSION['crypto'][$node_parent]; - } - else { - $key = substr(md5(uniqid(rand(), true)),0,8); - } - - $node_content=crypto::crypto($node_content,$key); - - - - } - $params['node_name']=$node_name; $params['template_id']=$template_id; $params['node_parent']=$node_parent; @@ -116,7 +99,23 @@ function add() { $params['node_creator']=$_SESSION['user_id']; $params['node_content']=db_escape_string($node_content); $params['external_link']=$external_link; - nodes::addNode($params); + $node_id=nodes::addNode($params); + + if (!$node_id) { + return false; + } + + if ($_FILES['data_file']['tmp_name']) { + require(INCLUDE_DIR.'filez.inc'); + filez::upload_data_file($node_id); + } + + //substitute @@@ token by a node_id of a newly created node + $nc=preg_replace('/@@@/',$node_id,$params['node_content']); + if ($nc!=$params['node_content']) { + $db->update("update nodes set node_content='$nc' where node_id=$node_id"); + } + return true; }