=========================== */ ?> conf = new configuration(); } function saveSettings($fieldsArray) { if ($this->modificarDeFormulario($this->conf->tablePrefix."config", $fieldsArray)) { header("Location: ".$this->conf->urlGelato."/admin/settings.php?modified=true"); die(); } else { header("Location: ".$this->conf->urlGelato."/admin/settings.php?error=1&des=".$this->merror); die(); } } function saveOption($value, $name) { $sqlStr = "UPDATE ".$this->conf->tablePrefix."options SET val='".$value."' WHERE name='".$name."' LIMIT 1"; if ($this->ejecutarConsulta($sqlStr)) { return true; } else { return true; } } function addPost($fieldsArray) { if ($this->insertarDeFormulario($this->conf->tablePrefix."data", $fieldsArray)) { return true; } else { return false; } } function modifyPost($fieldsArray, $id_post) { if ($this->modificarDeFormulario($this->conf->tablePrefix."data", $fieldsArray, "id_post=$id_post")) { header("Location: ".$this->conf->urlGelato."/admin/index.php?modified=true"); die(); } else { header("Location: ".$this->conf->urlGelato."/admin/index.php?error=2&des=".$this->merror); die(); } } function deletePost($idPost) { $this->ejecutarConsulta("DELETE FROM ".$this->conf->tablePrefix."data WHERE id_post=".$idPost); } function getPosts($limit="10", $from="0") { $sqlStr = "select * from ".$this->conf->tablePrefix."data ORDER BY date DESC LIMIT $from,$limit"; $this->ejecutarConsulta($sqlStr); return $this->mid_consulta; } function getPost($id="") { $this->ejecutarConsulta("select * from ".$this->conf->tablePrefix."data WHERE id_post=".$id); return mysql_fetch_array($this->mid_consulta); } function getPostsNumber() { $this->ejecutarConsulta("select count(*) as total from ".$this->conf->tablePrefix."data"); $row = mysql_fetch_assoc($this->mid_consulta); return $row['total']; } function getType($id) { if ($this->ejecutarConsulta("select type from ".$this->conf->tablePrefix."data WHERE id_post=".$id)) { if ($this->contarRegistros()>0) { while($registro = mysql_fetch_array($this->mid_consulta)) { return $registro[0]; } } } else { return "0"; } } function formatConversation($text) { $formatedText = ""; $odd=true; $lines = explode("\n", $text); $formatedText .= "