<?php
//Created by ARDORA www.webardora.net
//COMENTARIOS-index.php
include("php/cfg.php");
   error_reporting(E_ALL^E_NOTICE);
   session_cache_limiter("nocache,private");
   require "php/functions.php";
$file = simplexml_load_file(xmlFile);
   $comments=array();
   $js_history='';
   foreach ($file->entrada as $entrada) {
      $valor = array(
      "id" => $entrada -> id,
      "parent" => $entrada -> father,
      "usr" => $entrada -> usr,
      "comment" => $entrada ->comment,
      "dt" => $entrada -> dt,
   );
   if($valor["parent"]==0){
      $comments[$valor["id"]-1] = $valor;
   } else
   {
      if(!$comments[$valor["parent"]-1]) continue;
         $comments[$valor["parent"]-1]["replies"][] = $valor;
      }
         $js_history.='addHistory({id:"'.$valor["id"].'"});'.PHP_EOL;
   }
   $js_history='<script type="text/javascript">'.$js_history.'</script>';
?>

<!DOCTYPE html>
<html lang="es">
<head><meta charset="utf-8"/><title>.: Chuvia de ideas :: A clasificación dos seres vivos :.</title>
<link rel="stylesheet" type="text/css" href="css/ardoraComentarios.css" />
<!--CSS--><link type="text/css" href="ardoraFiles/ui-themes/ardoraBasico03_lar/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="ardoraFiles/js/jquery.js"></script>
<script type="text/javascript" src="ardoraFiles/js/jquery-ui.min.js"></script>
<script src="ardoraFiles/js/jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="js/ardoraComentarios.js"></script>
<?php echo $js_history; ?>
</head><body>
<div id="cabeceira">
	<h1>Chuvia de ideas</h1>
       <p><SPAN style="font-size:14px; color:#000000">Cando temos que escribir un texto e non sabemos moi ben que dicir unha boa axuda pode ser anotar, en pouco tempo, todas aquelas ideas que sobre ese tema se nos podan ocorrer. Logo, de todo o recollido, poderemos escoller as mellores ideas, ordealas e empezar a crear o texto.</SPAN><br>
<SPAN style="font-size:14px; color:#000000">Nexte caso vamos a crear un texto sobre <b></SPAN><SPAN style="font-size:14px; color:#000000">un</b></SPAN><SPAN style="font-size:14px; color:#000000"> <b></SPAN><SPAN style="font-size:14px; color:#000000">dos planetas</b></SPAN><SPAN style="font-size:14px; color:#000000"> do <b></SPAN><SPAN style="font-size:14px; color:#000000">Sistema Solar</b></SPAN><SPAN style="font-size:14px; color:#000000">, para elo cada un e cada unha deberá de aportar un minimo dunha idea (que non escribira xa un compañeiro ou compañeira) sobre este tema.</SPAN><br>
</p>
</div>

<div class="ui-widget-header ui-corner-all ui-helper-clearfix"> </div>
<div id="divFull">
<div id="main">
<div class="fg-toolbar ui-widget-header ui-corner-all ui-helper-clearfix">
   <div class="fg-buttonset ui-helper-clearfix">
   <a href="php/introDatos.php" class="fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Engadir idea"><span class="ui-icon ui-icon-pencil"></span>Engadir idea</a>
   <a href="index.php" class="fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Recargar"><span class="ui-icon ui-icon-refresh"></span>Recargar</a>
<a id="ButFull" class="fg-button ui-state-default fg-button-icon-solo  ui-corner-all" title="Pantalla completa"><span class="ui-icon ui-icon-extlink"></span>Pantalla completa</a>
    </div>
</div>
     <div id="wave">
         <div id="commentArea">
            <?php foreach($comments as $c){ showComment($c,"");}?>
         </div>
     </div>
</div>
</div>
</body></html>
