<?php
// Created by Ardora www.webardora.net
//COMENTARIOS-savecomment
session_start();
$slogin_noauthpage = 0;
$slogin_pagetitle = "";
include("cfg.php");include_once("para.php");include_once ("../".uName."/".uName."_lib.php");
session_cache_limiter('nocache,private');
if(empty($_POST["comment"])) die("0");
$comment=$_POST["comment"];
$parent=$_POST["parent"];
$user=$_POST["user"];
$file = new SimpleXMLElement("../".xmlFile, null, true);
$numItems=0;
foreach ($file->entrada as $entrada) {
   if ( (int)$entrada->id > $numItems){
      $numItems=(int)$entrada->id;
   }
}
$numItems++;
$entrada = $file->addChild("entrada");
$entrada->addChild("id",$numItems);
$entrada->addChild("father",$parent);
$entrada->addChild("usr",$user);
$entrada->addChild("comment",trim($comment));
$entrada->addChild("dt",date("d-m-Y H:i:s"));
$file->asXML("../".xmlFile);
echo $numItems;
?>
