conf = new configuration(); } function addPost($fieldsArray) { if ($this->insertarDeFormulario($this->conf->tablePrefix."data", $fieldsArray)) { return true; } else { return false; } } function saveMP3($remoteFileName) { if (getMP3File($remoteFileName)) { return true; } else { return false; } } function savePhoto($remoteFileName) { if (getPhotoFile($remoteFileName)) { return true; } else { return false; } } 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 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 .= "\n"; return $formatedText; } function getVideoPlayer($url) { if (isYoutubeVideo($url)) { $id_video = getYoutubeVideoUrl($url); return "\t\t\t
\n"; } elseif (isVimeoVideo($url)) { $id_video = getVimeoVideoUrl($url); return "\t\t\t
\n"; } else { return "This URL is not a supported video (YouTube or Vimeo)"; } } function getMp3Player($url) { if (isMP3($url)) { $playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url; return "\t\t\t
\n"; } else { return "This URL is not a supported video (YouTube or Vimeo)"; } } function getPostsNumber() { $this->ejecutarConsulta("select count(*) as total from ".$this->conf->tablePrefix."data"); $row = mysql_fetch_assoc($this->mid_consulta); return $row['total']; } } ?>