- function ingresar( $pId, $pTema, $pURL, $pAutor, $pComentario ) {\r
+ function saveNew() {\r
+ return fappendcsv($this->infoCSVConst, array($this->id, $this->tema, $this->url, $this->autor, $this->comentario, $this->ranking, $this->fecha));\r
+ }\r
+\r
+ function saveExisting() {\r
+ if (($f = fopen($this->infoCSVConst, 'r')) == false) return false; // error\r
+ $index = 0;\r
+ $indexSave = 0;\r
+ while (!feof($f))\r
+ {\r
+ $d = fgetcsv($f, 4096);\r
+ $index++;\r
+ if ($d[0] == $this->id)\r
+ {\r
+ fclose($f);\r
+ if (($f = fopen($this->infoCSVConst, 'r+')) == false) return false; // error\r
+ while ($indexSave!=($index-1)) { fgetcsv($f, 4096); $indexSave++; }\r
+ fputcsv($f, array($this->id, $this->tema, $this->url, $this->autor, $this->comentario, $this->ranking, $this->fecha));\r
+ fclose($f);\r
+ return true;\r
+ }\r
+ }\r
+ fclose($f);\r
+ return false;\r
+ }\r
+\r
+ function saveLoadThis( $pId, $pTema, $pURL, $pAutor, $pComentario ) {\r