本文整理汇总了PHP中parent::PAGE_META_ROBOTS方法的典型用法代码示例。如果您正苦于以下问题:PHP parent::PAGE_META_ROBOTS方法的具体用法?PHP parent::PAGE_META_ROBOTS怎么用?PHP parent::PAGE_META_ROBOTS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parent
的用法示例。
在下文中一共展示了parent::PAGE_META_ROBOTS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Load
public function Load()
{
parent::$PAGE_TITLE = __(ERROR_USER_BANNED) . " - " . __(SITE_NAME);
parent::$PAGE_META_ROBOTS = "noindex, nofollow";
$can_use_captacha = true;
if (WspBannedVisitors::isBannedIp($this->getRemoteIP())) {
$last_access = new DateTime(WspBannedVisitors::getBannedIpLastAccess($this->getRemoteIP()));
$duration = WspBannedVisitors::getBannedIpDuration($this->getRemoteIP());
$dte_ban = $last_access->modify("+" . $duration . " seconds");
if ($dte_ban > new DateTime()) {
$can_use_captacha = false;
}
}
$obj_error_msg = new Object(new Picture("wsp/img/warning.png", 48, 48, 0, "absmidlle"), "<br/><br/>");
$obj_error_msg->add(new Label(__(ERROR_USER_BANNED_MSG_1), true), "<br/>");
if ($can_use_captacha) {
$obj_error_msg->add(new Label(__(ERROR_USER_BANNED_MSG_2), true), "<br/><br/>");
$this->captcha_error_obj = new Object();
$form = new Form($this);
$this->captcha = new Captcha($form);
$this->captcha->setFocus();
$unblock_btn = new Button($form);
$unblock_btn->setValue(__(ERROR_USER_BUTTON))->onClick("onClickUnblock");
$form->setContent(new Object($this->captcha, "<br/>", $unblock_btn));
$obj_error_msg->add($this->captcha_error_obj, "<br/>", $form);
}
$obj_error_msg->add("<br/><br/>", __(MAIN_PAGE_GO_BACK), new Link(BASE_URL, Link::TARGET_NONE, __(SITE_NAME)));
$this->render = new ErrorTemplate($obj_error_msg, __(ERROR_USER_BANNED));
}
示例2: Load
public function Load()
{
header($_SERVER["SERVER_PROTOCOL"] . " 401 Unauthorized");
parent::$PAGE_TITLE = __(ERROR_USER_RIGHTS) . " - " . __(SITE_NAME);
parent::$PAGE_META_ROBOTS = "noindex, nofollow";
$obj_error_msg = new Object(new Picture("wsp/img/warning.png", 48, 48, 0, "absmidlle"), "<br/>", new Label(__(ERROR_USER_RIGHTS_MSG)));
$obj_error_msg->add("<br/><br/>", __(MAIN_PAGE_GO_BACK), new Link(BASE_URL, Link::TARGET_NONE, __(SITE_NAME)));
$this->render = new ErrorTemplate($obj_error_msg, __(ERROR_USER_RIGHTS));
}
示例3: Load
public function Load()
{
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
parent::$PAGE_TITLE = __(ERROR_PAGE) . " - " . __(SITE_NAME);
parent::$PAGE_META_ROBOTS = "noindex, nofollow";
// check if URL is not bad, but could be a good URL
if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") {
$url_to_check = trim($_GET['error-redirect-url']);
} else {
$url_to_check = trim($this->getCurrentUrl());
}
$base_url_tmp = BASE_URL;
if ($base_url_tmp[strlen($base_url_tmp) - 1] == "/") {
$base_url_tmp = substr($base_url_tmp, 0, strlen($base_url_tmp) - 1);
}
$url_to_check = str_replace("%22", "\"", str_replace("%5C", "\\", str_replace("%5c", "\\", str_replace("%27", "'", $url_to_check))));
$redirect_bad_url_to = "";
if (preg_match("@" . $base_url_tmp . "([^?]*)/'(http://|https://|http:/|https:/)(.+)/'@i", $url_to_check, $matches) == 1) {
// url detect with /' in the end
$redirect_bad_url_to = $matches[3];
$redirect_bad_url_to_http = $matches[2];
} else {
if (preg_match("@" . $base_url_tmp . "([^?]*)/'(http://|https://|http:/|https:/)(.+)'@i", $url_to_check, $matches) == 1) {
// url detect with '
$redirect_bad_url_to = $matches[3];
$redirect_bad_url_to_http = $matches[2];
} else {
if (preg_match("@" . $base_url_tmp . "([^?]*)/\\\\'(http://|https://|http:/|https:/)(.+)\\\\'@i", $url_to_check, $matches) == 1) {
// url detect with \'
$redirect_bad_url_to = $matches[3];
$redirect_bad_url_to_http = $matches[2];
} else {
if (preg_match("@" . $base_url_tmp . "([^?]*)/\"(http://|https://|http:/|https:/)(.+)\"@i", $url_to_check, $matches) == 1) {
// url detect with "
$redirect_bad_url_to = $matches[3];
$redirect_bad_url_to_http = $matches[2];
} else {
if (preg_match("@" . $base_url_tmp . "([^?]*)/(http://|https://|http:/|https:/)(.+)@i", $url_to_check, $matches) == 1) {
// url detect without no '
$redirect_bad_url_to = $matches[3];
$redirect_bad_url_to_http = $matches[2];
} else {
if (preg_match("@" . BASE_URL . "combine-css/'/(.+)'@i", $url_to_check, $matches) == 1) {
// combine-css url with '
$redirect_bad_url_to = BASE_URL . $matches[1];
$redirect_bad_url_to_http = "";
}
}
}
}
}
}
// check apple icon
if ($redirect_bad_url_to == "" && find($url_to_check, "apple-touch-icon") > 0) {
if ($url_to_check == BASE_URL . "apple-touch-icon.png" || $url_to_check == BASE_URL . "apple-touch-icon-precomposed.png") {
if (defined('SITE_META_IPHONE_IMAGE_114PX')) {
$redirect_bad_url_to = SITE_META_IPHONE_IMAGE_114PX;
} else {
if (defined('SITE_META_IPHONE_IMAGE_72PX')) {
$redirect_bad_url_to = SITE_META_IPHONE_IMAGE_72PX;
} else {
if (defined('SITE_META_IPHONE_IMAGE_57PX')) {
$redirect_bad_url_to = SITE_META_IPHONE_IMAGE_57PX;
}
}
}
} else {
if ($url_to_check == BASE_URL . "apple-touch-icon-57x57.png" || $url_to_check == BASE_URL . "apple-touch-icon-57x57-precomposed.png") {
if (defined('SITE_META_IPHONE_IMAGE_57PX')) {
$redirect_bad_url_to = SITE_META_IPHONE_IMAGE_57PX;
}
}
}
if ($redirect_bad_url_to != "") {
if (strtoupper(substr($redirect_bad_url_to, 0, 7)) != "HTTP://" && strtoupper(substr($redirect_bad_url_to, 0, 8)) != "HTTPS://") {
$redirect_bad_url_to = BASE_URL . $redirect_bad_url_to;
}
}
}
// End check if URL is not bad
if ($redirect_bad_url_to != "") {
// if URL is detect as bad but can be redirect to good URL
if ($redirect_bad_url_to_http != "") {
$redirect_bad_url_to = str_replace(":/", "", str_replace("://", "", $redirect_bad_url_to_http)) . "://" . $redirect_bad_url_to;
}
$this->redirect($redirect_bad_url_to);
$msg_redirect = new Label(__(REDIRECT_URL_TO, $redirect_bad_url_to, $redirect_bad_url_to));
$this->render = new ErrorTemplate($msg_redirect, parent::$PAGE_TITLE);
} else {
// display the error page if the URL is correct
$error_msg_title = "";
$array_code_error = array(401, 403, 404, 500);
if (in_array($_GET['error-redirect'], $array_code_error)) {
$_SESSION['calling_page'] = "";
$error_msg = constant("ERROR_" . $_GET['error-redirect'] . "_MSG");
parent::$PAGE_TITLE = constant("ERROR_" . $_GET['error-redirect'] . "_MSG") . " - " . __(SITE_NAME);
$error_msg_title = constant("ERROR_" . $_GET['error-redirect'] . "_MSG");
} else {
if ($_SESSION['calling_page'] == "error-page") {
if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") {
//.........这里部分代码省略.........