public static function start() { system::$display = false; header("Content-Type: text/xml, charset=utf-8"); // IE cache fix header("Cache-Control: no-store, no-cache, must-revalidate"); header("Pragma: no-cache"); }
function rss() { system::$display = false; rss::setHTTPHeaders(); $this->smarty->setCacheID("RSS|ARTICLES"); if (!$this->smarty->isCached()) { $sqlData = rss::getLastPostsWithType("article"); $items = $sqlData->fetchAll(); $this->smarty->assign("items", $items); } echo $this->smarty->fetch(TPL_PATH . "/rss/rssMain.tpl", "RSS|ARTICLES"); }
function editPageAjax() { $id = intval($_GET["contentID"]); $fill = $_POST; if ($_POST) { // echo '<pre>'.print_r($_POST,1).'</pre>'; if (isset($_POST['x1']) && isset($_POST['y1']) && isset($_POST['w1']) && isset($_POST['h1']) && $_POST['x1'] != '' && $_POST['y1'] != '' && $_POST['w1'] != '' && $_POST['h1'] != '') { $data = array('x1' => $_POST['x1'], 'y1' => $_POST['y1'], 'w1' => $_POST['w1'], 'h1' => $_POST['h1'], 'width' => 200, 'height' => 200); unset($_POST['x1'], $_POST['y1'], $_POST['w1'], $_POST['h1']); photo::cropImage($_POST['picture'], $data, '200x200'); } if (isset($_POST['x2']) && isset($_POST['y2']) && isset($_POST['w2']) && isset($_POST['h2']) && $_POST['x2'] != '' && $_POST['y2'] != '' && $_POST['w2'] != '' && $_POST['h2'] != '') { $data = array('x1' => $_POST['x2'], 'y1' => $_POST['y2'], 'w1' => $_POST['w2'], 'h1' => $_POST['h2'], 'width' => 200, 'height' => 140); unset($_POST['x2'], $_POST['y2'], $_POST['w2'], $_POST['h2']); photo::cropImage($_POST['picture'], $data, '200x140'); } $_POST['type'] = 'news'; photo::updatePost($_POST, $id); system::$display = false; return true; } $fill = photo::getPost($id); $this->smarty->setCaching(false); $this->smarty->assign("fill", $fill); system::$display = false; $cache_id = 'PHOTO_AJAX_ADD'; $file = MODULES_PATH . "/photo/backend/tpl/editAjax.tpl"; echo $this->smarty->fetch($file, $cache_id); }
public static function addNewCat($type = "news") { system::$display = false; if (isset($_POST["catName"])) { $catName = htmlspecialchars($_POST["catName"]); if (isset($_POST["catSlug"]) && $_POST["catSlug"]) { $catSlug = core::generateSlug($_POST["catSlug"]); } else { $catSlug = core::generateSlug($_POST["catName"]); } self::$db->query("INSERT INTO `categories` SET `catName`='?', catSlug='?', catType='?'", $catName, $catSlug, $type); return self::$db->insert_id(); } return false; }
function resize() { if (!system::HTTPArg(1) && !system::HTTPArg(2) && !system::HTTPArg(3)) { return system::redirect("/"); } system::$display = false; $req = preg_replace("/[^0-9x]/", '', system::HTTPArg(3)); $userID = intval(system::HTTPArg(1)); if (!$req || !$userID) { return system::redirect("/"); } $file = preg_replace(self::image_filter, '', system::HTTPArg(2)); $fp = CONTENT_PATH . "/screenshots/{$userID}/{$file}"; if (!file_exists($fp)) { return system::redirect("/"); } $data = explode("x", trim($req)); $data = array_map("trim", $data); $image = screenshot::scaleImage($fp, $data[0], $data[1]); echo $image; }
function start() { system::$display = false; }