本文整理汇总了PHP中Pages::GetItems方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::GetItems方法的具体用法?PHP Pages::GetItems怎么用?PHP Pages::GetItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::GetItems方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
$item = $pages->GetItem($pageId);
if ($item) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: /" . $item["page_alias"]);
return;
} else {
header("HTTP/1.1 404 Not Found");
header("Location: /404.php");
return;
}
}
if ($pageAlias) {
if ($pageAlias[strlen($pageAlias) - 1] == "/") {
$pageAlias = substr($pageAlias, 0, strlen($pageAlias) - 1);
}
$pageItem = $pages->GetItems(false, false, "", "", "", " AND {$pages->DbAlias}.page_alias = '{$pageAlias}' ", true);
if ($pageItem) {
$page["title"] = $pageItem[0]["page_title"] ? $pageItem[0]["page_title"] : $pageItem[0]["page_name"];
$page["description"] = $pageItem[0]["page_description"];
$page["keywords"] = $pageItem[0]["page_keywords"];
$page["content"] = $pageItem[0]["page_text"];
$page["module"] = $pageItem[0]["page_module"];
$page["id"] = $pageItem[0]["page_id"];
// Articles
if ($pageItem[0]["page_module"] == 1) {
require_once $rootPath . INC_DIR . "class.articles.php";
$articles = new Articles();
$id = isset($_GET["id"]) && is_numeric($_GET["id"]) ? intval($_GET["id"]) : false;
if ($id) {
$articleItem = $articles->GetItem($id);
if ($articleItem) {
示例2: header
$item = $pages->GetItem($pageId);
if ($item) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: /" . $item["page_alias"]);
return;
} else {
header("HTTP/1.1 404 Not Found");
header("Location: /404.php");
return;
}
}
if ($pageAlias) {
if ($pageAlias[strlen($pageAlias) - 1] == "/") {
$pageAlias = substr($pageAlias, 0, strlen($pageAlias) - 1);
}
$pageItem = $pages->GetItems(false, false, "", "", "", " AND {$pages->DbAlias}.page_alias = '{$pageAlias}' ", true);
if ($pageItem) {
$page["title"] = $pageItem[0]["page_title"] ? $pageItem[0]["page_title"] : $pageItem[0]["page_name"];
$page["description"] = $pageItem[0]["page_description"];
$page["keywords"] = $pageItem[0]["page_keywords"];
$page["content"] = $pageItem[0]["page_text"];
} else {
header("HTTP/1.1 404 Not Found");
header("Location: /404.php");
return;
//var_dump($pageAlias);
}
}
// Assign Template Values
$smarty->assign("page", $page);
$smarty->assign("config", $config);
示例3: Pages
$smarty->template_dir = SMARTY_TEMPLATES_DIR;
$smarty->compile_dir = SMARTY_COMPILE_DIR;
// Page Values
$page["error"] = "";
$page["info"] = "";
$page["description"] = "";
$page["keywords"] = "";
$page["title"] = "";
$page["onload"] = "";
$page["rootpath"] = $config["folder"];
$page["tplpath"] = $page["rootpath"] . SMARTY_TEMPLATES_DIR;
$page["meta"] = "\n\t" . '<script src="' . $page["rootpath"] . INC_JQUERY . 'jquery.min.js" type="text/javascript"></script>';
$pages = new Pages();
$pageItem = $pages->GetItem(1);
if ($pageItem) {
$page["title"] = $pageItem["page_title"] ? $pageItem["page_title"] : $page["title"];
$page["description"] = $pageItem["page_description"];
$page["keywords"] = $pageItem["page_keywords"];
$page["content"] = $pageItem["page_text"];
$page["module"] = $pageItem["page_module"];
$page["id"] = $pageItem["page_id"];
}
$news = new News();
$smarty->assign("news", $news->GetItems(1, 4, "news_date", "DESC", "", "", true));
// Assign Template Values
$smarty->assign("page", $page);
$smarty->assign("config", $config);
$smarty->assign("menu", $pages->GetItems(false, false, "", "", "", " AND {$pages->DbAlias}.page_show = 1 "));
// Display Template
$smarty->display("index.tpl");
$db->sql_close();
示例4: Smarty
// Includes
require_once $rootPath . "common.php";
require_once $rootPath . INC_DIR . "class.pages.php";
// Smarty
$smarty = new Smarty();
$smarty->template_dir = SMARTY_TEMPLATES_DIR;
$smarty->compile_dir = SMARTY_COMPILE_DIR;
// Page Values
$page["description"] = "";
$page["keywords"] = "";
$page["title"] = $config["site_name"];
$page["onload"] = "";
$page["rootpath"] = $config["folder"];
$page["tplpath"] = $page["rootpath"] . SMARTY_TEMPLATES_DIR;
$page["meta"] = "\n\t" . '<script src="' . $page["rootpath"] . INC_JQUERY . 'jquery.min.js" type="text/javascript"></script>';
$search = isset($_GET["search"]) ? trim($_GET["search"]) : false;
$pages = new Pages();
if ($search) {
$searchItems = $pages->GetItems(false, false, "", "", $search, "", true);
$smarty->assign("searchItems", $searchItems);
$smarty->assign("searchItemsCount", $searchItems ? count($searchItems) : 0);
} else {
$page["error"] = "Строка поиска не задана";
}
// Assign Template Values
$smarty->assign("page", $page);
$smarty->assign("config", $config);
$smarty->assign("menu", $pages->GetItems(false, false, "", "", "", " AND {$pages->DbAlias}.page_show = 1 "));
// Display Template
$smarty->display("search.tpl");
$db->sql_close();