public function __construct() { $this->Db = $this->db(); $this->helpers(); $this->language = whichLanguage(); $this->table = "tags"; }
public function __construct() { $this->Db = $this->db(); $helpers = array("alerts", "router", "time", "string"); $this->helper($helpers); $this->language = whichLanguage(); $this->table = "comments"; }
public function __construct() { $this->Db = $this->db(); $this->helpers(); $this->language = whichLanguage(); $this->table = "blog"; $this->Data = $this->core("Data"); $this->Data->table($this->table); }
public function __construct() { $this->Db = $this->db(); $this->helpers(); $this->table = "videos"; $this->language = whichLanguage(); $this->application = whichApplication(); $this->YouTube = $this->library("youtube", "Youtube", NULL, "videos"); $this->Data = $this->core("Data"); }
/** * __() * * Returns the translation of a specific text * * @param string $text * @return string value */ function __($text) { if (get("translation") === "gettext") { global $Gettext_Reader; if (is_null($Gettext_Reader)) { return $text; } return $Gettext_Reader->translate($text); } else { global $Load, $phrase; $language = whichLanguage(); if (file_exists("www/lib/languages/" . strtolower($language) . ".php")) { include_once "www/lib/languages/" . strtolower($language) . ".php"; } $position = strtolower(str_replace(" ", "_", $text)); return isset($phrase[$position]) ? $phrase[$position] : $text; } }
public function showImage() { $data = $this->Gallery_Model->getByID(segment(3), TRUE); if (!$data) { redirect(_webBase . _sh . getXMLang(whichLanguage()) . _sh . _gallery); } if ($data["Album"] !== "None") { $this->count = $this->Gallery_Model->getCount($data["Album_Nice"]); } else { $this->count = $this->Gallery_Model->getCount(); } //Código para comentarios: /* if(isset($_POST["publishComment"])) { $this->Set("Comment"); } if($this->Users_Model->isMember()) { $vars["publish"] = TRUE; } if(isset($error) and is_array($error)) { $vars["error"] = $error; } $comments = $this->Gallery_Model->getComments($this->record["ID"]); if($comments == FALSE) $vars["comments"] = FALSE; else $vars["comments"] = $comments; */ $vars["count"] = $this->count; $vars["picture"] = $data; if (_webGalleryComments === TRUE) { $vars["view"][0] = $this->view("image", $this->application, TRUE); $vars["view"][1] = $this->view("comments", $this->application, TRUE); } else { $vars["view"] = $this->view("image", $this->application, TRUE); } $this->template("content", $vars); $this->Render(); }
<?php if (!defined("ACCESS")) { die("Error: You don't have permission to access here..."); } date_default_timezone_set(DEFAULT_TIMEZONE); set("webLang", whichLanguage(false)); if (_get("translation") === "gettext") { $languageFile = DIR . "/lib/languages/gettext/" . whichLanguage(true, true) . ".mo"; if (file_exists($languageFile)) { $Load->library("streams", null, null, "gettext"); $Gettext_Reader = $Load->library("gettext", "Gettext_Reader", array($languageFile), "gettext"); $Gettext_Reader->load_tables(); } }
function getLocal($lang = false) { if (!$lang) { $lang = whichLanguage(); } $languages = array("Arabic" => "ar_AR", "Basque" => "eu_ES", "Belarusian" => "be_BY", "Bulgarian" => "bg_BG", "Catalan" => "ca_ES", "Chinese" => "zh_CN", "Croatian" => "hr_HR", "Czech" => "cs_CZ", "Danish" => "da_DK", "Dutch" => "nl_NL", "English" => "en_US", "Estonian" => "et_EE", "Finnish" => "fi_FI", "French" => "fr_FR", "Galician" => "gl_ES", "German" => "de_DE", "Greek" => "el_GR", "Hebrew" => "he_IL", "Hungarian" => "hu_HU", "Indonesian" => "id_ID", "Italian" => "it_IT", "Japanese" => "ja_JP", "Kurdish" => "ku_TR", "Lithuanian" => "lt_LT", "Macedonian" => "mk_MK", "Persian" => "Persian", "Polish" => "pl_PL", "Portuguese" => "pt_BR", "Romanian" => "ro_RO", "Russian" => "ru_RU", "Serbian" => "sr_RS", "Slovak" => "sk_SK", "Slovenian" => "sl_SI", "Spanish" => "es_LA", "Swedish" => "sv_SE", "Thai" => "th_TH", "Turkish" => "tr_TR", "Ukrainian" => "uk_UA", "Vietnamese" => "vi_VN"); foreach ($languages as $language => $locale) { if ($language === $lang) { return $locale; } } }
public function add() { if (!$this->isAdmin) { $this->login(); } $this->title("Add"); $this->CSS("forms", "cpanel"); $this->CSS("categories", $this->application); $this->vars["apps"] = getApplicationsArray(array(3, 9, 18)); $this->vars["appsCategories"] = $this->Categories_Model->getSomeCategories(NULL, whichLanguage()); if (POST("save")) { $this->vars["alert"] = $this->{$this}->{"{$this->Model}"}->cpanel("save"); } elseif (POST("cancel")) { redirect("cpanel"); } $this->vars["view"] = $this->view("add", TRUE, $this->application); $this->render("content", $this->vars); }
function display($content = null, $environment = true, $language = true) { if ($content and ($environment === true or _get("environment") === $environment) and $language === true) { return $content; } elseif ($content and ($environment === true or _get("environment") === $environment) and $language === whichLanguage()) { return $content; } return null; }
<?php /** * Access from index.php: */ if (!defined("_access")) { die("Error: You don't have permission to access here..."); } set("webLang", whichLanguage(FALSE)); if (get("translation") === "gettext") { $languageFile = _dir . "/lib/languages/gettext/" . whichLanguage(TRUE, TRUE) . ".mo"; if (file_exists($languageFile)) { $Load->library("streams", NULL, NULL, "gettext"); $Gettext_Reader = $Load->library("gettext", "Gettext_Reader", array($languageFile), "gettext"); $Gettext_Reader->load_tables(); } }
public function getCategories() { $data = $this->Db->call("getCategoriesByApplication('gallery', '" . whichLanguage() . "')"); return $data; }
function now($format, $hour = FALSE, $language = NULL) { if (is_null($language)) { $language = whichLanguage(); } if ($hour) { $time = time() + 7200; $hours = (int) date("H", $time); $minutes = date("i", $time); $seconds = date("s", $time); if ($hours > 12) { $hour = $hours === 13 ? "01" : $hours; $hour = $hours === 14 ? "02" : $hours; $hour = $hours === 15 ? "03" : $hours; $hour = $hours === 16 ? "04" : $hours; $hour = $hours === 17 ? "05" : $hours; $hour = $hours === 18 ? "06" : $hours; $hour = $hours === 19 ? "07" : $hours; $hour = $hours === 20 ? "08" : $hours; $hour = $hours === 21 ? "09" : $hours; $hour = $hours === 22 ? "10" : $hours; $hour = $hours === 23 ? "11" : $hours; $hour = $hours === 00 ? "12" : $hours; return "{$hour}:{$minutes} P.M."; } return "{$hours}:{$minutes} A.M."; } if ($format === 1) { return date("d") . _sh . date("m") . _sh . date("y"); } elseif ($format === 2) { $day = __(_(date("l"))); $month = __(_(date("F"))); if ($language === "English") { return "{$day}, {$month} " . date("d") . ", " . date("Y"); } elseif ($language === "Spanish") { return "{$day}, " . date("d") . " de {$month} de " . date("Y"); } elseif ($language === "French") { return "{$day}, " . date("d") . " {$month} " . date("Y"); } else { return "{$day}, {$month} " . date("d") . ", " . date("Y"); } } elseif ($format === 3) { return date("d/m/Y H:i:s", time()); } elseif ($format === 4) { return time(); } elseif ($format === 5) { return strtotime($hour); } elseif ($format === 6) { return date("d/m/Y H:i:s", $hour); } elseif ($format === 7) { return date("Y-m-d H:i:s"); } else { return date("d/m/Y", $format); } }
private function setTopic() { $nice = segment(2); $language = whichLanguage(segment(0)); if (segment(4)) { $action = "edit"; $ID = segment(3); } else { $action = "save"; } if (SESSION("ZanUserID") > 0) { $this->js("tiny-mce", NULL, "basic"); $this->js("validations", $this->application); if (POST("cancel")) { redirect($this->application . _sh . $nice); } if (!POST("doAction")) { if ($action === "save") { $forum = $this->Forums_Model->getIDByForum($nice, $language); } elseif ($action === "edit") { $forum = $this->Forums_Model->getTopicByID($ID); $vars["ID_Post"] = $ID; } if ($forum) { $vars["ID"] = $forum[0]["ID_Forum"]; $vars["title"] = isset($forum[0]["Title"]) ? $forum[0]["Title"] : ""; $vars["content"] = isset($forum[0]["Content"]) ? $forum[0]["Content"] : ""; $vars["action"] = $action; $vars["hrefURL"] = path($this->application . _sh . $nice . _sh); if ($action === "save") { $vars["href"] = path($this->application . _sh . $nice . _sh . "new"); } else { $vars["href"] = path($this->application . _sh . $nice . _sh . $ID . _sh . "edit"); } $vars["view"] = $this->view("newtopic", $this->application, TRUE); $this->template("content", $vars); } } else { if (!POST("title")) { $alert = getAlert("You must to write a title"); } elseif (isEmptyTiny(POST("content", "decode", FALSE))) { $alert = getAlert("You must to a write a content"); } elseif (strlen(POST("title")) < 4) { $alert = getAlert("You must to write a valid title"); } elseif (!POST("content")) { $alert = getAlert("You must to a write a content"); } elseif (strlen(POST("content")) < 4) { $alert = getAlert("You must to write a valid content"); } elseif (isInjection(POST("content", "decode", FALSE))) { $alert = getAlert("The content is invalid"); } elseif (isVulgar(strtolower(POST("title")))) { $alert = getAlert("The title is vulgar"); } elseif (isVulgar(strtolower(POST("content")))) { $alert = getAlert("The content is vulgar"); } elseif (isSPAM(POST("content"))) { $alert = getAlert("The content has spam"); } if (isset($alert)) { $vars["alert"] = $alert; $vars["ID"] = POST("ID_Forum"); $vars["title"] = POST("title"); $vars["content"] = cleanTiny(POST("content", "decode", FALSE)); $vars["action"] = $action; $vars["hrefURL"] = path($this->application . _sh . $nice . _sh); if ($action === "save") { $vars["href"] = path($this->application . _sh . $nice . _sh . "new"); } else { $vars["href"] = path($this->application . _sh . $nice . _sh . $ID . _sh . "edit"); } $vars["view"] = $this->view("newtopic", $this->application, TRUE); $this->template("content", $vars); } else { if ($action === "save") { $success = $this->Forums_Model->setTopic(); if ($success > 0) { $topic = $this->Forums_Model->addUserTopic(); $vars["href"] = path($this->application . _sh . $nice . _sh . $success . _sh); } } elseif ($action === "edit") { $success = $this->Forums_Model->editTopic(); $vars["href"] = path($this->application . _sh . $nice . _sh . $ID . _sh); } $vars["success"] = $success; $vars["action"] = $action; $vars["href"] = path($this->application . _sh . $nice); $vars["view"] = $this->view("newtopic", $this->application, TRUE); $this->template("content", $vars); } } } else { redirect($this->application . _sh . $nice); } }
<?php print $categories; ?> </div> <div class="add-categories"> <p> <span style="font-size: 0.8em;"><?php print __(_("New category")); ?> </span> <br /> <input id="category" name="category" type="text" class="required" style="width: 95%" /><br /> <?php print getLanguagesInput(whichLanguage(), "language_category", "select"); ?> </p> <span class="bold"><?php print __(_("Parent category")); ?> :</span> <div id="div-categories-radio" class="add-categories-wrapper"> <?php print $categoriesRadio; ?> </div> <input name="add-category" value="<?php