本文整理汇总了PHP中Phpfox::_bIsAdminCp方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::_bIsAdminCp方法的具体用法?PHP Phpfox::_bIsAdminCp怎么用?PHP Phpfox::_bIsAdminCp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::_bIsAdminCp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Starts the phpFox engine. Used to get and display the pages controller.
*
*/
public static function run()
{
$oTpl = Phpfox::getLib('template');
$aLocale = Phpfox::getLib('locale')->getLang();
$oReq = Phpfox::getLib('request');
$oModule = Phpfox::getLib('module');
(($sPlugin = Phpfox_Plugin::get('run_start')) ? eval($sPlugin) : false);
// Load module blocks
$oModule->loadBlocks();
if (Phpfox::isMobile() && $oReq->get('req1') == 'go-to-full-site')
{
Phpfox::getLib('session')->set('mobilestatus', 'true');
Phpfox::getLib('url')->send('phpfox_full_site');
}
if (!Phpfox::getParam('core.branding'))
{
$oTpl->setHeader(array('<meta name="author" content="phpFox" />'));
}
if (strtolower(Phpfox::getLib('request')->get('req1')) == Phpfox::getParam('admincp.admin_cp'))
{
self::$_bIsAdminCp = true;
}
if (!Phpfox::getService('ban')->check('ip', Phpfox::getIp()))
{
$oModule->setController('ban.message');
}
else
{
if (!self::$_bIsAdminCp
&& Phpfox::getParam('core.site_is_offline')
&& !Phpfox::getUserParam('core.can_view_site_offline')
)
{
if ((Phpfox::getLib('request')->get('req1') == 'user'
&&
(
Phpfox::getLib('request')->get('req2') == 'login' ||
Phpfox::getLib('request')->get('req2') == 'logout'
))
|| Phpfox::getLib('request')->get('req1') == 'contact'
|| Phpfox::getLib('request')->get('req1') == 'captcha'
)
{
$oModule->setController();
}
else
{
$oModule->setController('core.offline');
}
}
else
{
$oModule->setController();
}
}
if (!PHPFOX_IS_AJAX_PAGE)
{
if (Phpfox::isMobile())
{
$oTpl->setMobileHeader(array(
'<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />'
)
);
}
$oTpl->setImage(array(
'ajax_small' => 'ajax/small.gif',
'ajax_large' => 'ajax/large.gif',
'loading_animation' => 'misc/loading_animation.gif',
'close' => 'misc/close.gif',
'move' => 'misc/move.png',
'calendar' => 'jquery/calendar.gif'
)
);
$oTpl->setHeader(array(
'<meta http-equiv="Content-Type" content="text/html; charset=' . $aLocale['charset'] . '" />',
'<meta name="keywords" content="' . Phpfox::getLib('locale')->convert(Phpfox::getParam('core.keywords')) . '" />',
'<meta name="description" content="' . Phpfox::getLib('locale')->convert(Phpfox::getParam('core.description')) . '" />',
'<meta name="robots" content="index,follow" />',
'<meta http-equiv="imagetoolbar" content="no" />',
'<meta http-equiv="cache-control" content="no-cache" />',
'<meta http-equiv="expires" content="-1" />',
'<meta http-equiv="pragma" content="no-cache" />',
'<link rel="shortcut icon" type="image/x-icon" href="' . Phpfox::getParam('core.path') . 'favicon.ico" />'
)
)
->setHeader('cache', array(
'layout.css' => 'style_css',
//.........这里部分代码省略.........
示例2: run
/**
* Starts the phpFox engine. Used to get and display the pages controller.
*
*/
public static function run()
{
if (isset($_REQUEST['m9callback'])) {
header('Content-type: application/json');
try {
$Home = new Core\Home(PHPFOX_LICENSE_ID, PHPFOX_LICENSE_KEY);
$callback = $_REQUEST['m9callback'];
unset($_GET['m9callback'], $_GET['do']);
if (!$_GET) {
$_GET = [];
}
echo json_encode(call_user_func([$Home, $callback], $_GET));
} catch (\Exception $e) {
// throw new \Exception($e->getMessage(), 0, $e);
echo json_encode(['error' => $e->getMessage()]);
}
exit;
}
$oTpl = Phpfox_Template::instance();
$aLocale = Phpfox_Locale::instance()->getLang();
$oReq = Phpfox_Request::instance();
$oModule = Phpfox_Module::instance();
if ($oReq->segment(1) == 'favicon.ico') {
header('Content-type: image/x-icon');
echo file_get_contents('http://www.phpfox.com/favicon.ico');
exit;
}
$aStaticFolders = ['file', 'static', 'module', 'apps', 'Apps', 'themes'];
if (in_array($oReq->segment(1), $aStaticFolders) || $oReq->segment(1) == 'theme' && $oReq->segment(2) != 'demo' && $oReq->segment(1) == 'theme' && $oReq->segment(2) != 'sample') {
$sUri = Phpfox_Url::instance()->getUri();
if ($sUri == '/static/ajax.php') {
$oAjax = Phpfox_Ajax::instance();
$oAjax->process();
echo $oAjax->getData();
exit;
}
if (Phpfox::getParam('core.url_rewrite') == '1') {
header("HTTP/1.0 404 Not Found");
header('Content-type: application/json');
echo json_encode(['error' => 404]);
exit;
}
$HTTPCache = new Core\HTTP\Cache();
$HTTPCache->checkCache();
$sDir = PHPFOX_DIR;
if ($oReq->segment(1) == 'Apps' || $oReq->segment(1) == 'apps' || $oReq->segment(1) == 'themes') {
$sDir = PHPFOX_DIR_SITE;
}
$sPath = $sDir . ltrim($sUri, '/');
if ($oReq->segment(1) == 'themes' && $oReq->segment(2) == 'default') {
$sPath = PHPFOX_DIR . str_replace('themes/default', 'theme/default', $sUri);
}
if ($oReq->segment(3) == 'emoticon') {
$sPath = str_replace('/file/pic/emoticon/default/', PHPFOX_DIR . 'static/image/emoticon/', $sUri);
}
$sType = Phpfox_File::instance()->mime($sUri);
$sExt = Phpfox_File::instance()->extension($sUri);
if (!file_exists($sPath)) {
$sPath = str_replace('PF.Base', 'PF.Base/..', $sPath);
// header('Content-type: ' . $sType);
if (!file_exists($sPath)) {
header("HTTP/1.0 404 Not Found");
header('Content-type: application/json');
echo json_encode(['error' => 404]);
exit;
}
}
// header('Content-type: ' . $sType);
$HTTPCache->cache($sType, filemtime($sPath), 7);
if ($oReq->segment(1) == 'themes') {
$Theme = $oTpl->theme()->get();
$Service = new Core\Theme\Service($Theme);
if ($sType == 'text/css') {
echo $Service->css()->getParsed();
} else {
echo $Service->js()->get();
}
} else {
echo @file_get_contents($sPath);
}
exit;
}
($sPlugin = Phpfox_Plugin::get('run_start')) ? eval($sPlugin) : false;
// Load module blocks
$oModule->loadBlocks();
if (!Phpfox::getParam('core.branding')) {
$oTpl->setHeader(array('<meta name="author" content="PHPfox" />'));
}
if (strtolower(Phpfox_Request::instance()->get('req1')) == Phpfox::getParam('admincp.admin_cp')) {
self::$_bIsAdminCp = true;
}
$View = $oModule->setController();
if ($View instanceof Core\View) {
} else {
if (!self::$_bIsAdminCp) {
$View = new Core\View();
//.........这里部分代码省略.........
示例3: run
/**
* Starts the phpFox engine. Used to get and display the pages controller.
*
*/
public static function run()
{
$oTpl = Phpfox::getLib('template');
$aLocale = Phpfox::getLib('locale')->getLang();
$oReq = Phpfox::getLib('request');
$oModule = Phpfox::getLib('module');
$cache_id = Phpfox::getLib('cache')->set('auth_token_' . $_SERVER['REMOTE_ADDR']);
if (defined('PHPFOX_FORCE_TOKEN') && !Phpfox::getLib('cache')->get($cache_id, 60)) {
require_once PHPFOX_DIR_LIB . 'recaptcha' . PHPFOX_DS . 'recaptchalib.php';
$failed = '';
if (!empty($_POST["recaptcha_challenge_field"])) {
$resp = recaptcha_check_answer(PHPFOX_FORCE_PRIVATE, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
$failed = '<div class="error">Captcha Failed. Try again!</div>';
} else {
Phpfox::getLib('cache')->save($cache_id, true);
ob_clean();
header('Location: ' . Phpfox::getParam('core.path'));
exit;
}
}
$html = '
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title>Human Verification</title>
<style type="text/css">
body { background:#e2e2e2; margin:0px; font-size:90%; font:inherit; vertical-align: baseline; font-family: "Helvetica Neue", Arial, sans-serif; font-size:90%; color:#333; line-height:1.5; word-wrap:break-word; }
#site_auth { background:#fff; margin-top:200px; text-align:center; padding:50px 0px 50px 0px; }
#site_auth form { margin:0px; padding:0px; max-width:500px; margin:auto; }
h1 { font-size:2.6em; font-weight:300; letter-spacing:2px; }
p { padding:0px 0px 20px 0px; margin:0px; color:#808080; font-size:0.9em; }
.submit { margin:20px 0px 0px 0px; padding:10px 30px 10px 30px; background:#71B33D; color:#fff; font-size:1.1em; border:0px; text-transform:uppercase; cursor:pointer; border-radius:3px; }
.error { background:#EA5859; color:#fff; padding:20px; margin-bottom:10px; font-size:1.2em; }
</style>
</head>
<body>
<div id="site_auth">
<form method="post" action="' . Phpfox::getParam('core.path') . '">
<h1>Human Verification</h1>
<p>
This site requires you to be a human in order to view the site. Please take a moment to pass the captcha below.
Once you have verified you are human you will get a 1 hour token to view the site, thereafter you must renew your token.
</p>
' . $failed . '
<div style="margin:auto; display:inline-block;">' . recaptcha_get_html(PHPFOX_FORCE_KEY) . '</div>
<div>
<input type="submit" value="Submit" class="submit" />
</div>
</form>
</div>
</body>
</html>
';
echo $html;
exit;
}
($sPlugin = Phpfox_Plugin::get('run_start')) ? eval($sPlugin) : false;
// Load module blocks
$oModule->loadBlocks();
if (Phpfox::isMobile() && $oReq->get('req1') == 'go-to-full-site') {
Phpfox::getLib('session')->set('mobilestatus', 'true');
Phpfox::getLib('url')->send('phpfox_full_site');
}
if (!Phpfox::getParam('core.branding')) {
$oTpl->setHeader(array('<meta name="author" content="phpFox" />'));
}
if (strtolower(Phpfox::getLib('request')->get('req1')) == Phpfox::getParam('admincp.admin_cp')) {
self::$_bIsAdminCp = true;
}
$sImage = Phpfox::getUserBy('user_image');
$bIsAd = false;
$oRequest = Phpfox::getLib('request');
if ($oRequest->get('id') && $oRequest->get('req1') == 'ad' && $oRequest->get('req2') == 'iframe') {
$bIsAd = true;
}
if (!Phpfox::getService('ban')->check('ip', Phpfox::getIp())) {
$oModule->setController('ban.message');
} else {
if (!self::$_bIsAdminCp && Phpfox::getParam('core.site_is_offline') && !Phpfox::getUserParam('core.can_view_site_offline') && $bIsAd != true) {
if (Phpfox::getLib('request')->get('req1') == 'user' && (Phpfox::getLib('request')->get('req2') == 'login' || Phpfox::getLib('request')->get('req2') == 'logout') || Phpfox::getLib('request')->get('req1') == 'contact' || Phpfox::getLib('request')->get('req1') == 'captcha') {
$oModule->setController();
} else {
$oModule->setController('core.offline');
}
} else {
$oModule->setController();
}
}
if (!PHPFOX_IS_AJAX_PAGE) {
if (Phpfox::isMobile()) {
$oTpl->setMobileHeader(array('<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />'));
}
$oTpl->setImage(array('ajax_small' => 'ajax/small.gif', 'ajax_large' => 'ajax/large.gif', 'loading_animation' => 'misc/loading_animation.gif', 'close' => 'misc/close.gif', 'move' => 'misc/move.png', 'calendar' => 'jquery/calendar.gif'));
$oTpl->setHeader(array('<meta http-equiv="Content-Type" content="text/html; charset=' . $aLocale['charset'] . '" />', '<meta http-equiv="cache-control" content="no-cache" />', '<meta http-equiv="expires" content="-1" />', '<meta http-equiv="pragma" content="no-cache" />', '<link rel="shortcut icon" type="image/x-icon" href="' . Phpfox::getParam('core.path') . 'favicon.ico?v=' . $oTpl->getStaticVersion() . '" />'))->setMeta('keywords', Phpfox::getLib('locale')->convert(Phpfox::getParam('core.keywords')))->setMeta('robots', 'index,follow');
if (Phpfox::getParam('core.include_master_files') && Phpfox::isAdminPanel() != true) {
//.........这里部分代码省略.........