} // Smarty $smarty = new Smarty(); $smarty->template_dir = $rootPath . ADMIN_TPL_DIR; $smarty->compile_dir = $rootPath . SMARTY_COMPILE_DIR . "admin/"; $gallery = isset($_GET["gallery"]) && is_numeric($_GET["gallery"]) ? intval($_GET["gallery"]) : false; // Items Class $items = new Photos(); // Assign Page properties $page["rootpath"] = $config["folder"]; $page["admpath"] = $page["rootpath"] . ADMIN_DIR; $page["incpath"] = $page["rootpath"] . INC_DIR; $page["title"] = "Администрирование - " . $items->ItemConfig["itemNames"]; $page["meta"] = "\n\t" . '<script src="/' . ADMIN_DIR . 'js/functions.js" type="text/javascript"></script>'; $page["onload"] = ""; if ($gallery) { $galleryObj = new Gallery(); $smarty->assign("gallery", $galleryObj->GetItem($gallery)); $where = $gallery ? " AND {$items->DbAlias}.gallery_id = {$gallery} " : ""; } if (!isset($_GET["quantity"])) { $_GET["quantity"] = 100; } ### Include controller file ### include_once "base.php"; $page["info"] = $items->Info; $page["error"] = $items->Error; $smarty->assign("page", $page); $smarty->assign("config", $config); $smarty->display($items->ItemConfig["adminTpl"]); $db->sql_close();
$smarty->assign("articleItem", $articleItem); } else { $page["title"] = "Статьи"; $smarty->assign("allarticles", $articles->GetItems(false, false, "", "", "", "", true)); } } // Gallery if ($pageItem[0]["page_module"] == 2) { require_once $rootPath . INC_DIR . "class.gallery.php"; require_once $rootPath . INC_DIR . "class.photos.php"; $gallery = new Gallery(); $photos = new Photos(); if (isset($_GET["gallery"])) { $galleryId = intval($_GET["gallery"]); $smarty->assign("photos", $photos->GetItems(false, false, "", "", "", " AND {$photos->DbAlias}.gallery_id = {$galleryId} ", true)); $selectedGallery = $gallery->GetItem($galleryId); $page["title"] = $selectedGallery["gallery_name"] . " - Фотогалерея - " . $config["site_name"]; $smarty->assign("selectedGallery", $selectedGallery); } else { $galleryItems = $gallery->GetItems(false, false, "", "", "", "", true); if ($galleryItems) { foreach ($galleryItems as $key => $value) { $galleryItems[$key]["photos"] = $photos->GetItems(1, 7, "", "", "", " AND {$photos->DbAlias}.gallery_id = {$value['gallery_id']} ", true); } $smarty->assign("galleries", $galleryItems); } } } } else { header("HTTP/1.1 404 Not Found"); header("Location: /404.php");
$page["title"] = "Статьи"; $smarty->assign("allarticles", $articles->GetItems(false, false, "", "", "", "", true)); } } // Gallery if ($pageItem[0]["page_module"] == 3) { $page["meta"] .= "\n\t\t" . '<script src="' . $page["rootpath"] . INC_JQUERY_PLUGINS . 'jquery.fancybox-2.1.5/jquery.fancybox.pack.js" type="text/javascript"></script>'; $page["meta"] .= "\n\t\t" . '<link href="' . $page["rootpath"] . INC_JQUERY_PLUGINS . 'jquery.fancybox-2.1.5/jquery.fancybox.css" type="text/css" rel="stylesheet" />'; $page["meta"] .= "\n\t\t" . '<script src="' . $page["rootpath"] . INC_JQUERY_PLUGINS . 'jquery.fancybox-2.1.5/helpers/jquery.fancybox-buttons.js?v=1.0.5" type="text/javascript"></script>'; $page["meta"] .= "\n\t\t" . '<script src="' . $page["rootpath"] . INC_JQUERY_PLUGINS . 'jquery.fancybox-2.1.5/helpers/jquery.fancybox-media.js?v=1.0.6" type="text/javascript"></script>'; $page["meta"] .= "\n\t\t" . '<link href="' . $page["rootpath"] . INC_JQUERY_PLUGINS . 'jquery.fancybox-2.1.5/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" rel="stylesheet" />'; require_once $rootPath . INC_DIR . "class.gallery.php"; $gallery = new Gallery(); if (isset($_GET["gallery"])) { $galleryId = intval($_GET["gallery"]); $smarty->assign("gallery", $galleryItem = $gallery->GetItem($galleryId)); $page["title"] = $galleryItem["gallery_name"] . " - Фотогалерея - " . $config["site_name"]; } else { $galleryItems = $gallery->GetItems(false, false, "", "", "", "", true); if ($galleryItems) { foreach ($galleryItems as $key => $value) { $galleryItems[$key]["image_more"] = $gallery->GetImagesMore($value["gallery_id"], 7); } //var_dump($galleryItems); $smarty->assign("galleries", $galleryItems); } } } // Video if ($pageItem[0]["page_module"] == 4) { require_once $rootPath . INC_DIR . "class.video.php";