本文整理汇总了PHP中system::HTTPGet方法的典型用法代码示例。如果您正苦于以下问题:PHP system::HTTPGet方法的具体用法?PHP system::HTTPGet怎么用?PHP system::HTTPGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system
的用法示例。
在下文中一共展示了system::HTTPGet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
function login()
{
system::setParam("page", "auth");
$authRes = false;
//print_r($this->get);
$through = system::HTTPGet("through");
if ($through) {
$up = user::socialLogin($through);
if ($up) {
$userID = user::socialRegister($through, $up);
}
if (isset($userID)) {
$authRes = user::userLogin($userID, '-', $through);
}
}
if (isset($_POST["email"])) {
system::checkFields(array("email" => "E-mail", "password" => "Пароль"));
if (!system::checkErrors()) {
$authRes = user::userLogin();
}
if (!$authRes) {
return system::redirect("/user/passwordRestore");
}
}
if ($authRes) {
if (isset($_GET["to"]) && $_GET["to"]) {
system::redirect(urldecode($_GET["to"]), 5, "Вы вошли как <strong>{$_SESSION["user"]["nick"]}</strong>.");
} else {
system::redirect("/", 5, "Вы вошли как <strong>{$_SESSION["user"]["nick"]}</strong>.");
}
}
}
示例2: posts
function posts()
{
switch (system::HTTPGet("posts")) {
case "edit":
$this->editPost();
break;
case "write":
$this->writePost();
break;
default:
system::setParam("page", "posts");
blog::buildList("content", "blog");
break;
}
}
示例3: pagination
public static function pagination($allCount, $offset = 1)
{
$offset = intval(system::HTTPGet("offset"));
if ($offset == 0) {
$offset = 1;
}
$smarty = array();
$smarty["itemsOnPage"] = intval(system::param("itemsOnPage"));
$smarty["offset"] = $offset;
$smarty["allCount"] = $allCount;
$pageCompose = new pagination($allCount);
$pageCompose->setPerPage($smarty["itemsOnPage"]);
$pageCompose->readInputData($offset);
$mysqlLimits = $pageCompose->calculateOffset();
$smarty["pages"] = $pageCompose->genPages();
$smarty["pagesTotal"] = count($smarty["pages"]);
system::$core->smarty->assign("pagination", $smarty);
return $mysqlLimits;
}
示例4: offset
function offset()
{
$offset = system::HTTPGet("offset");
if (!$offset) {
return system::redirect('/');
}
$cacheID = "MAINPAGE|offset_{$offset}";
$this->smarty->setCacheID($cacheID);
if (!$this->smarty->isCached($cacheID)) {
$sqlData = index::mainPage();
$this->smarty->assign("posts", $sqlData);
}
}