当前位置: 首页>>代码示例>>PHP>>正文


PHP Phpfox::isAdminPanel方法代码示例

本文整理汇总了PHP中Phpfox::isAdminPanel方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::isAdminPanel方法的具体用法?PHP Phpfox::isAdminPanel怎么用?PHP Phpfox::isAdminPanel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phpfox的用法示例。


在下文中一共展示了Phpfox::isAdminPanel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * Controller
  */
 public function process()
 {
     $sCountryChildValue = $this->getParam('country_child_value');
     $mCountryChildFilter = $this->getParam('country_child_filter', $this->request()->get('country_child_filter', null));
     $sCountryChildType = $this->getParam('country_child_type', null);
     $sCountryChildId = null;
     if (empty($sCountryChildValue) && Phpfox::isUser() && $mCountryChildFilter === null && !$this->getParam('country_not_user')) {
         $sCountryChildValue = Phpfox::getUserBy('country_iso');
     }
     $iSearchId = 0;
     if ($mCountryChildFilter !== null) {
         $search = $this->request()->get('search');
         if (Phpfox::isAdminPanel() && isset($search['country'])) {
             $sCountryChildValue = $search['country'];
             $sCountryChildId = isset($search['country_child_id']) ? $search['country_child_id'] : '';
         } else {
             $iSearchId = $this->request()->get('search-id');
             if (!empty($iSearchId) && isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country'])) {
                 $sCountryChildValue = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country'];
             }
             if (isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country_child_id'])) {
                 $sCountryChildId = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country_child_id'];
             }
         }
     }
     /* Last resort, get is a little heavy but controller didnt provide a child country*/
     /*
     if ($sCountryChildId == null && $this->getParam('country_child_id') == null)
     {
     	$aUser = Phpfox::getService('user')->get(Phpfox::getUserId(), true);			
     	$sCountryChildId = $aUser['country_child_id'];			
     }
     */
     $this->template()->assign(array('aCountryChildren' => Phpfox::getService('core.country')->getChildren($sCountryChildValue), 'iCountryChildId' => (int) $this->getParam('country_child_id', $sCountryChildId), 'bForceDiv' => $this->getParam('country_force_div', false), 'mCountryChildFilter' => $mCountryChildFilter));
 }
开发者ID:lev1976g,项目名称:core,代码行数:38,代码来源:country-child.class.php

示例2: _checkIsThisAViewDetailRequest

 private function _checkIsThisAViewDetailRequest()
 {
     /**
      * Check if we are going to view an actual fundraising instead of the fundraising index page.
      * The 2nd URL param needs to be numeric.
      */
     if ($this->_aParentModule === null && $this->request()->getInt('req2') && !Phpfox::isAdminPanel()) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:12,代码来源:index.class.php

示例3: process

 /**
  * Controller
  */
 public function process()
 {
     if (!Phpfox::isAdminPanel()) {
         $sCurrentCategory = $this->getParam('sCurrentCategory', null);
         $aCategories = Phpfox::getService('photo.category')->getForBrowse($sCurrentCategory, $this->getParam('sPhotoCategorySubSystem', null));
         if (empty($aCategories)) {
             return false;
         }
         $aCallback = $this->getParam('aCallback', false);
         if ($aCallback !== false && is_array($aCategories)) {
             $sHomeUrl = '/' . Phpfox_Url::instance()->doRewrite($aCallback['url_home_array'][0]) . '/' . implode('/', $aCallback['url_home_array'][1]) . '/' . Phpfox_Url::instance()->doRewrite('photo') . '/';
             foreach ($aCategories as $iKey => $aCategory) {
                 $aCategories[$iKey]['url'] = preg_replace('/^http:\\/\\/(.*?)\\/' . Phpfox_Url::instance()->doRewrite('photo') . '\\/(.*?)$/i', 'http://\\1' . $sHomeUrl . '\\2', $aCategory['url']);
                 if (isset($aCategory['sub'])) {
                     foreach ($aCategory['sub'] as $iSubKey => $aSubCategory) {
                         $aCategories[$iKey]['sub'][$iSubKey]['url'] = preg_replace('/^http:\\/\\/(.*?)\\/' . Phpfox_Url::instance()->doRewrite('photo') . '\\/(.*?)$/i', 'http://\\1' . $sHomeUrl . '\\2', $aSubCategory['url']);
                     }
                 }
             }
         }
         if (!is_array($aCategories)) {
             return false;
         }
         $this->template()->assign(array('aCategories' => $aCategories, 'sHeader' => $this->getParam('hasSubCategories') ? Phpfox::getPhrase('photo.subcategories') : Phpfox::getPhrase('photo.categories')));
         return 'block';
     }
     if ($this->getParam('bIsTagSearch') === true) {
         return false;
     }
     $aCallback = $this->getParam('aCallback', null);
     $sCategories = Phpfox::getService('photo.category')->get($this->getParam('anchor', true));
     if ($aCallback !== null) {
         $sCategories = preg_replace('/href=\\"(.*?)\\/photo\\/(.*?)\\"/i', 'href="' . Phpfox_Url::instance()->makeUrl($aCallback['url_home']) . '\\2"', $sCategories);
     }
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('photo.categories'), 'sCategories' => $sCategories, 'bParent' => $this->getParam('parent', true)));
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:39,代码来源:category.class.php

示例4: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $aParentModule = $this->getParam('aParentModule');
     if ($aParentModule === null && $this->request()->getInt('req2') > 0) {
         if ($this->request()->get('req1') == 'pages' && Phpfox::isModule('pages') == false || $aParentModule['module_id'] == 'pages' && Phpfox::getService('pages')->hasPerm($aParentModule['item_id'], 'blog.view_browse_blog') == false) {
             return Phpfox_Error::display(Phpfox::getPhrase('blog.cannot_display_due_to_privacy'));
         }
         return Phpfox::getLib('module')->setController('blog.view');
     }
     if (defined('PHPFOX_IS_USER_PROFILE') && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle)) {
         Phpfox::getService('core')->getLegacyItem(array('field' => array('blog_id', 'title'), 'table' => 'blog', 'redirect' => 'blog', 'title' => $sLegacyTitle, 'search' => 'title'));
     }
     if ($this->request()->get('req2') == 'main') {
         return Phpfox::getLib('module')->setController('error.404');
     }
     ($sPlugin = Phpfox_Plugin::get('blog.component_controller_index_process_start')) ? eval($sPlugin) : false;
     if (($iRedirectId = $this->request()->get('redirect')) && ($aRedirectBlog = Phpfox::getService('blog')->getBlogForEdit($iRedirectId))) {
         Phpfox::permalink('blog', $aRedirectBlog['blog_id'], $aRedirectBlog['title'], true);
     }
     Phpfox::getUserParam('blog.view_blogs', true);
     if (defined('PHPFOX_IS_AJAX_CONTROLLER')) {
         $bIsProfile = true;
         $aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
         $this->setParam('aUser', $aUser);
     } else {
         $bIsProfile = $this->getParam('bIsProfile');
         if ($bIsProfile === true) {
             $aUser = $this->getParam('aUser');
             $this->search()->setCondition('AND blog.user_id = ' . $aUser['user_id']);
         }
     }
     /**
      * Check if we are going to view an actual blog instead of the blog index page.
      * The 2nd URL param needs to be numeric.
      */
     if (!Phpfox::isAdminPanel()) {
         if ($this->request()->getInt('req2') > 0 && !isset($aParentModule['module_id'])) {
             /**
              * Since we are going to be viewing a blog lets reset the controller and get out of this one.
              */
             return Phpfox::getLib('module')->setController('blog.view');
         }
     }
     if ($this->request()->get('req2') == 'category' && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle) && !is_numeric($sLegacyTitle)) {
         $aLegacyItem = Phpfox::getService('core')->getLegacyItem(array('field' => array('category_id', 'name'), 'table' => 'blog_category', 'redirect' => 'blog.category', 'title' => $sLegacyTitle, 'search' => 'name_url'));
     }
     /**
      * This creates a global variable that can be used in other components. This is a good way to 
      * pass information to other components.
      */
     $this->setParam('sTagType', 'blog');
     $this->template()->setTitle($bIsProfile ? Phpfox::getPhrase('blog.full_name_s_blogs', array('full_name' => $aUser['full_name'])) : Phpfox::getPhrase('blog.blog_title'))->setBreadCrumb($bIsProfile ? Phpfox::getPhrase('blog.blogs') : Phpfox::getPhrase('blog.blog_title'), $bIsProfile ? $this->url()->makeUrl($aUser['user_name'], 'blog') : $this->url()->makeUrl('blog'));
     $sView = $this->request()->get('view');
     $this->search()->set(array('type' => 'blog', 'field' => 'blog.blog_id', 'search_tool' => array('table_alias' => 'blog', 'search' => array('action' => $bIsProfile === true ? $this->url()->makeUrl($aUser['user_name'], array('blog', 'view' => $this->request()->get('view'))) : $this->url()->makeUrl('blog', array('view' => $this->request()->get('view'))), 'default_value' => Phpfox::getPhrase('blog.search_blogs_dot'), 'name' => 'search', 'field' => array('blog.title', 'blog_text.text')), 'sort' => array('latest' => array('blog.time_stamp', Phpfox::getPhrase('blog.latest')), 'most-viewed' => array('blog.total_view', Phpfox::getPhrase('blog.most_viewed')), 'most-liked' => array('blog.total_like', Phpfox::getPhrase('blog.most_liked')), 'most-talked' => array('blog.total_comment', Phpfox::getPhrase('blog.most_discussed'))), 'show' => array(5, 10, 15))));
     $aBrowseParams = array('module_id' => 'blog', 'alias' => 'blog', 'field' => 'blog_id', 'table' => Phpfox::getT('blog'), 'hide_view' => array('pending', 'my'));
     $aFilterMenu = array();
     if (!defined('PHPFOX_IS_USER_PROFILE') && !isset($aParentModule['module_id'])) {
         $aFilterMenu = array(Phpfox::getPhrase('blog.all_blogs') => '', Phpfox::getPhrase('blog.my_blogs') => 'my');
         if (!Phpfox::getParam('core.friends_only_community') && Phpfox::isModule('friend')) {
             $aFilterMenu[Phpfox::getPhrase('blog.friends_blogs')] = 'friend';
         }
         if (Phpfox::getUserParam('blog.can_approve_blogs')) {
             $iPendingTotal = Phpfox::getService('blog')->getPendingTotal();
             if ($iPendingTotal) {
                 $aFilterMenu[Phpfox::getPhrase('blog.pending_blogs') . (Phpfox::getUserParam('blog.can_approve_blogs') ? '<span class="pending">' . $iPendingTotal . '</span>' : 0)] = 'pending';
             }
         }
     }
     ($sPlugin = Phpfox_Plugin::get('blog.component_controller_index_process_search')) ? eval($sPlugin) : false;
     $this->template()->buildSectionMenu('blog', $aFilterMenu);
     switch ($sView) {
         case 'spam':
             Phpfox::isUser(true);
             if (Phpfox::getUserParam('blog.can_approve_blogs')) {
                 $this->search()->setCondition('AND blog.is_approved = 9');
             }
             break;
         case 'pending':
             Phpfox::isUser(true);
             if (Phpfox::getUserParam('blog.can_approve_blogs')) {
                 $this->search()->setCondition('AND blog.is_approved = 0');
             }
             break;
         case 'my':
             Phpfox::isUser(true);
             $this->search()->setCondition('AND blog.user_id = ' . Phpfox::getUserId());
             break;
         case 'draft':
             Phpfox::isUser(true);
             $this->search()->setCondition("AND blog.user_id = " . $aUser['user_id'] . " AND blog.is_approved IN(" . ($aUser['user_id'] == Phpfox::getUserId() ? '0,1' : '1') . ") AND blog.privacy IN(" . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ") AND blog.post_status = 2");
             break;
         default:
             $aPage = $this->getParam('aPage');
             $sCondition = "AND blog.is_approved = 1 AND blog.post_status = 1" . (Phpfox::getUserParam('privacy.can_comment_on_all_items') ? "" : " AND blog.privacy IN(%PRIVACY%)");
             if (isset($aPage['privacy']) && $aPage['privacy'] == 1) {
                 $sCondition = "AND blog.is_approved = 1 AND blog.privacy IN(%PRIVACY%, 1) AND blog.post_status = 1";
             }
//.........这里部分代码省略.........
开发者ID:googlesky,项目名称:snsp.vn,代码行数:101,代码来源:index.class.php

示例5: _getCachedName

 /**
  * Gets the full path of the cached template file
  * 
  * @param string $sName Name of the template
  * @return string Full path to cached template
  */
 private function _getCachedName($sName)
 {
     if (!defined('PHPFOX_INSTALLER')) {
         if (!is_dir(PHPFOX_DIR_CACHE . 'template' . PHPFOX_DS)) {
             mkdir(PHPFOX_DIR_CACHE . 'template' . PHPFOX_DS);
             chmod(PHPFOX_DIR_CACHE . 'template' . PHPFOX_DS, 0777);
         }
     }
     return (defined('PHPFOX_IS_HOSTED_SCRIPT') ? PHPFOX_IS_HOSTED_SCRIPT . Phpfox::getCleanVersion() . '' : '') . (defined('PHPFOX_TMP_DIR') ? PHPFOX_TMP_DIR : PHPFOX_DIR_CACHE) . (defined('PHPFOX_TMP_DIR') || PHPFOX_SAFE_MODE ? 'template_' : 'template/') . str_replace(array(PHPFOX_DIR_THEME, PHPFOX_DIR_MODULE, PHPFOX_DS), array('', '', '_'), $sName) . (Phpfox::isAdminPanel() ? '_admincp' : '') . (PHPFOX_IS_AJAX ? '_ajax' : '') . '.php';
 }
开发者ID:auzunov,项目名称:phpfox,代码行数:16,代码来源:template.class.php

示例6: function

								FB.Event.subscribe(\'auth.login\', function(response) 
								{
									if (response.authResponse) 
									{
										$(\'body\').html(\'<div id="fb-root"></div><div id="facebook_connection">' . Phpfox::getPhrase('facebook.connecting_to_facebook_please_hold') . '</div>\');
										window.location.href = \'' . Phpfox_Url::instance()->makeUrl('facebook.frame') . '\';
									}
								});
							};	
													
							' . $sFacebookAsync . '
						</script>'));
            }
        }
    } else {
        if (Phpfox::isUser() && !Phpfox::isAdminPanel() && Phpfox::getParam('facebook.facebook_app_id')) {
            $oTpl->setHeader(array('<script type="text/javascript">
						window.onload = function()
						{
							FB.init(
							{
								appId  : \'' . Phpfox::getParam('facebook.facebook_app_id') . '\',
								status : true,
								cookie : true,			
								oauth  : true,
								xfbml  : true 
							});
						};
					
					' . $sFacebookAsync . '
					</script>'));
开发者ID:lev1976g,项目名称:core,代码行数:31,代码来源:get_controller.php

示例7: _getInfo

 /** 
  * Returns paging info: 'totalPages', 'totalRows', 'current', 'fromRow','toRow', 'firstUrl', 'prevUrl', 'nextUrl', 'lastUrl',  'urls' (url=>page)
  * 
  * @param Url $oUrl page url
  * @return array paging info
  */
 private function _getInfo()
 {
     if (Phpfox::isAdminPanel()) {
         if ($this->getTotalPages() == 0) {
             return false;
         }
         $sParams = '';
         if (count($this->_aParams)) {
             foreach ($this->_aParams as $iKey => $sValue) {
                 if (in_array($iKey, array('phpfox', Phpfox::getTokenName(), 'page', PHPFOX_GET_METHOD, 'ajax_page_display'))) {
                     continue;
                 }
                 if (is_array($sValue)) {
                     foreach ($sValue as $sKey => $sNewValue) {
                         if (is_numeric($sKey)) {
                             continue;
                         }
                         $sParams .= '&amp;' . $iKey . '[' . $sKey . ']=' . $sNewValue;
                     }
                 } else {
                     if (PHPFOX_IS_AJAX && $iKey == 'feed' && Phpfox::isModule('comment') && Phpfox::getParam('comment.load_delayed_comments_items')) {
                         continue;
                     }
                     $sParams .= '&amp;' . $iKey . '=' . $sValue;
                 }
             }
         }
         $aInfo = array('totalPages' => $this->_iPagesCount, 'totalRows' => $this->_iCnt, 'current' => $this->_iPage, 'fromRow' => $this->_iFirstRow + 1, 'toRow' => $this->_iLastRow, 'displaying' => $this->_iCnt <= $this->_iPageSize * $this->_iPage ? $this->_iCnt : $this->_iPageSize * $this->_iPage, 'sParams' => $sParams, 'phrase' => $this->_sPhrase, 'icon' => $this->_sIcon);
         list($nStart, $nEnd) = $this->_getPos();
         $oUrl = Phpfox_Url::instance();
         $oUrl->clearParam('page');
         if ($this->_iPage != 1) {
             $oUrl->setParam($this->_sUrlKey, 1);
             $aInfo['firstAjaxUrl'] = 1;
             $aInfo['firstUrl'] = $oUrl->getFullUrl();
             $oUrl->setParam($this->_sUrlKey, $this->_iPage - 1);
             $aInfo['prevAjaxUrl'] = $this->_iPage - 1;
             $aInfo['prevUrl'] = $oUrl->getFullUrl();
             Phpfox_Template::instance()->setHeader('<link rel="prev" href="' . $aInfo['prevUrl'] . '" />');
         }
         for ($i = $nStart; $i <= $nEnd; $i++) {
             if ($this->_iPage == $i) {
                 $oUrl->setParam($this->_sUrlKey, $i);
                 $aInfo['urls'][$oUrl->getFullUrl()] = $i;
             } else {
                 $oUrl->setParam($this->_sUrlKey, $i);
                 $aInfo['urls'][$oUrl->getFullUrl()] = $i;
             }
         }
         $oUrl->setParam($this->_sUrlKey, $this->_iPage + 1);
         $aInfo['nextAjaxUrlPager'] = $oUrl->getFullUrl();
         if ($this->_iPagesCount != $this->_iPage) {
             $oUrl->setParam($this->_sUrlKey, $this->_iPage + 1);
             $aInfo['nextAjaxUrl'] = $this->_iPage + 1;
             $aInfo['nextUrl'] = $oUrl->getFullUrl();
             Phpfox_Template::instance()->setHeader('<link rel="next" href="' . $aInfo['nextUrl'] . '" />');
             $oUrl->setParam($this->_sUrlKey, $this->_iPagesCount);
             $aInfo['lastUrl'] = $oUrl->getFullUrl();
             $aInfo['lastAjaxUrl'] = $this->_iPagesCount;
         }
         $aInfo['sParamsAjax'] = str_replace("'", "\\'", $aInfo['sParams']);
         Phpfox_Template::instance()->assign(array('aPager' => $aInfo, 'sAjax' => $this->_sAjax));
     } else {
         $sNextPage = (int) Phpfox_Request::instance()->get('page', 1) + 1;
         Phpfox_Url::instance()->clearParam('page');
         $_GET['page'] = $sNextPage;
         Phpfox_Template::instance()->assign(array('sCurrentUrl' => Phpfox_Url::instance()->makeUrl('current'), 'sNextIteration' => $sNextPage));
     }
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:75,代码来源:pager.class.php

示例8:

<?php

$sPathImage = Phpfox::getLib('url')->getDomain() . 'module/slscrolltotop/static/image/';
$sPathJS = Phpfox::getLib('url')->getDomain() . 'module/slscrolltotop/static/jscript/';
$data = Phpfox::getService('slscrolltotop.getdata')->getList();
if ($data["enable_module"]) {
    $showScrollToTop = 1;
    $flagLoadScriptForAdminCP = 0;
    if (Phpfox::isAdminPanel()) {
        $flagLoadScriptForAdminCP = 1;
        if (Phpfox::getLib('module')->getModuleName() != "slscrolltotop") {
            $showScrollToTop = 0;
        }
    }
    if ($showScrollToTop) {
        if ($data["style"] < 1 or $data["style"] > 7) {
            $data["style"] = 1;
        }
        echo '	<div id="ScrollToTop" class="ScrollToTop_Global ScrollToTop_Style_' . $data["style"] . '">
					<span>' . $data["text_display"] . '</span>
				</div>';
        echo Phpfox::getService('slscrolltotop.process')->loadStyle($sPathImage, $data);
        echo Phpfox::getService('slscrolltotop.process')->loadScript($sPathImage, $sPathJS, $data, $flagLoadScriptForAdminCP);
    }
}
开发者ID:Lovinity,项目名称:EQM,代码行数:25,代码来源:theme_template_body__end.php

示例9: process

	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{		
		if (defined('PHPFOX_IS_USER_PROFILE') && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle))
		{			
			Phpfox::getService('core')->getLegacyItem(array(
					'field' => array('blog_id', 'title'),
					'table' => 'blog',		
					'redirect' => 'blog',
					'title' => $sLegacyTitle
				)
			);
		}		
		
		if ($this->request()->get('req2') == 'main')
		{
			return Phpfox::getLib('module')->setController('error.404');
		}
	
		(($sPlugin = Phpfox_Plugin::get('blog.component_controller_index_process_start')) ? eval($sPlugin) : false);
		
		if (($iRedirectId = $this->request()->get('redirect')) && ($aRedirectBlog = Phpfox::getService('blog')->getBlogForEdit($iRedirectId)))
		{
			Phpfox::permalink('blog', $aRedirectBlog['blog_id'], $aRedirectBlog['title'], true);
		}
		
		Phpfox::getUserParam('blog.view_blogs', true);	
		
		if (defined('PHPFOX_IS_AJAX_CONTROLLER'))
		{
			$bIsProfile = true;
			$aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
			$this->setParam('aUser', $aUser);
		}
		else 
		{		
			$bIsProfile = $this->getParam('bIsProfile');	
			if ($bIsProfile === true)
			{
				$aUser = $this->getParam('aUser');
			}
		}
	
		/**
		 * Check if we are going to view an actual blog instead of the blog index page.
		 * The 2nd URL param needs to be numeric.
		 */
		if (!Phpfox::isAdminPanel())
		{
			if ($this->request()->getInt('req2') > 0)
			{
				/**
				 * Since we are going to be viewing a blog lets reset the controller and get out of this one.
				 */
				return Phpfox::getLib('module')->setController('blog.view');			
			}		
		}
		
		if ($this->request()->get('req2') == 'category' && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle))
		{
			$aLegacyItem = Phpfox::getService('core')->getLegacyItem(array(
					'field' => array('category_id', 'name'),
					'table' => 'blog_category',		
					'redirect' => 'blog.category',
					'title' => $sLegacyTitle,
					'search' => 'name_url'
				)
			);		
		}		

		/**
		 * This creates a global variable that can be used in other components. This is a good way to 
		 * pass information to other components.
		 */
		$this->setParam('sTagType', 'blog');
		
		$this->template()->setTitle(($bIsProfile ? Phpfox::getPhrase('blog.full_name_s_blogs', array('full_name' => $aUser['full_name'])) : Phpfox::getPhrase('blog.blog_title')))->setBreadCrumb(($bIsProfile ? 'Blogs' : Phpfox::getPhrase('blog.blog_title')), ($bIsProfile ? $this->url()->makeUrl($aUser['user_name'], 'blog') : $this->url()->makeUrl('blog')));
		
		$sView = $this->request()->get('view');			

		$this->search()->set(array(
				'type' => 'blog',
				'field' => 'blog.blog_id',				
				'search_tool' => array(
					'table_alias' => 'blog',
					'search' => array(
						'action' => ($bIsProfile === true ? $this->url()->makeUrl($aUser['user_name'], array('blog', 'view' => $this->request()->get('view'))) : $this->url()->makeUrl('blog', array('view' => $this->request()->get('view')))),
						'default_value' => Phpfox::getPhrase('blog.search_blogs_dot'),
						'name' => 'search',
						'field' => 'blog_text.text'
					),
					'sort' => array(
						'latest' => array('blog.time_stamp', Phpfox::getPhrase('blog.latest')),
						'most-viewed' => array('blog.total_view', Phpfox::getPhrase('blog.most_viewed')),
						'most-liked' => array('blog.total_like', Phpfox::getPhrase('blog.most_liked')),
						'most-talked' => array('blog.total_comment', Phpfox::getPhrase('blog.most_discussed'))
					),
					'show' => array(5, 10, 15)
//.........这里部分代码省略.........
开发者ID:hoanghd,项目名称:tools,代码行数:101,代码来源:index.class.php

示例10: foreach

 * @version 		$Id: controller.html.php 64 2009-01-19 15:05:54Z Raymond_Benc $
 */
if (count((array) $this->_aVars['aSettings'])) {
    foreach ((array) $this->_aVars['aSettings'] as $this->_aVars['aSetting']) {
        ?>
		<div class="table js_custom_groups<?php 
        if (isset($this->_aVars['aSetting']['group_id'])) {
            ?>
 js_custom_group_<?php 
            echo $this->_aVars['aSetting']['group_id'];
        }
        ?>
">
			<div class="table_left">
<?php 
        if ($this->_aVars['aSetting']['is_required'] && !Phpfox::isAdminPanel()) {
            if (Phpfox::getParam('core.display_required')) {
                ?>
<span class="required"><?php 
                echo Phpfox::getParam('core.required_symbol');
                ?>
</span><?php 
            }
        }
        echo Phpfox::getPhrase($this->_aVars['aSetting']['phrase_var_name']);
        ?>
:
			</div>
			<div class="table_right">
				<?php 
        Phpfox::getLib('template')->getBuiltFile('custom.block.form');
开发者ID:laiello,项目名称:kr-indian,代码行数:31,代码来源:block_user.block.custom.php

示例11:

		   				{
							if (response.session) 
							{
								$(\'body\').html(\'<div id="fb-root"></div><div id="facebook_connection">Connecting to Facebook. Please hold...</div>\');
								window.location.href = \'' . Phpfox::getLib('url')->makeUrl('facebook.frame') . '\';
							}			
		      			});		      		
						
					</script>')
				);
		}
	}
}
else
{
	if (Phpfox::isUser() && !Phpfox::isAdminPanel())
	{
		$oTpl->setHeader(array(
				'<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>',							
				'<script type="text/javascript">
					$(function()
					{
		   				FB.init(
		   				{
			     			appId  : \'' . Phpfox::getParam('facebook.facebook_app_id') . '\',
			     			status : true,
			     			cookie : true,
			     			xfbml  : true 
		   				});			   			
	   				});
				</script>')
开发者ID:hoanghd,项目名称:tools,代码行数:31,代码来源:get_controller.php

示例12: getController

 /**
  * Loads and outputs the current page based on the controller we loaded with the method setController().
  * 
  * @see self::setController()
  */
 public function getController()
 {
     // Get the component
     $this->_oController = $this->getComponent($this->_sModule . '.' . $this->_sController, array('bNoTemplate' => true), 'controller');
     if (!Phpfox::isAdminPanel() && !defined('PHPFOX_INSTALLER')) {
         $db = Phpfox_Database::instance();
         $cache = Phpfox_Cache::instance();
         $name = Phpfox_Module::instance()->getFullControllerName();
         $pageMeta = $cache->set('page_meta_' . $name);
         $meta = $cache->get($pageMeta);
         if ($meta === false) {
             $theme = $db->select('*')->from(':theme_template')->where(['type_id' => 'meta', 'name' => $name])->get();
             $cache->save($pageMeta, isset($theme['template_id']) ? json_decode($theme['html_data']) : []);
             $meta = $cache->get($pageMeta);
         }
         // $this->_meta = $meta;
         Phpfox_Template::instance()->setPageMeta($meta);
     }
 }
开发者ID:JerwinPRO,项目名称:phpfox,代码行数:24,代码来源:module.class.php

示例13: _makeUrl

 /**
  * Build a URL based on the apache rewrite rules.
  *
  * @param array $aParts ARRAY of all the URL parts.
  * @param array $aParams ARRAY of all the requests.
  * @return string Converted URL.
  */
 private function _makeUrl(&$aParts, &$aParams)
 {
     if (isset($this->aRewrite[$aParts[0]]) && !is_array($this->aRewrite[$aParts[0]])) {
         $aParts[0] = $this->aRewrite[$aParts[0]];
     }
     $sUrls = '';
     foreach ($aParts as $iPartKey => $sPart) {
         if (Phpfox::getParam('core.url_rewrite') == 3 && $iPartKey == 0) {
             continue;
         }
         if (empty($sPart)) {
             continue;
         }
         if ($iPartKey === 0 && $sPart == 'admincp') {
             $sPart = Phpfox::getParam('admincp.admin_cp');
         }
         if ($aParts[0] != 'admincp' && isset($this->aRewrite[$sPart]) && !is_array($this->aRewrite[$sPart])) {
             $sPart = $this->aRewrite[$sPart];
         }
         $sUrls .= str_replace('.', '', $sPart) . '/';
     }
     if ($aParams && is_array($aParams)) {
         $iIteration = 0;
         foreach ($aParams as $sKey => $sValue) {
             if (is_null($sValue)) {
                 continue;
             }
             if ($aParts[0] != 'admincp' && is_numeric($sKey) && isset($this->aRewrite[str_replace('.', '', $sValue)]) && !is_array($this->aRewrite[str_replace('.', '', $sValue)])) {
                 $sValue = $this->aRewrite[str_replace('.', '', $sValue)];
             }
             if (is_numeric($sKey)) {
                 $sUrls .= str_replace('.', '', $sValue) . '/';
                 continue;
             }
             $iIteration++;
             if ($iIteration === 1) {
                 $sUrls .= '?';
             }
             if (is_array($sValue)) {
                 foreach ($sValue as $subKey => $subValue) {
                     $sUrls .= $sKey . '[' . $subKey . ']=' . (Phpfox::isAdminPanel() ? $subValue : str_replace('.', '', $subValue)) . '&';
                 }
                 continue;
             }
             $sUrls .= $sKey . '=' . (Phpfox::isAdminPanel() ? $sValue : str_replace('.', '', $sValue)) . '&';
         }
         $sUrls = rtrim($sUrls, '&');
     }
     if (preg_match('/\\#/', $sUrls)) {
         // $sUrls = rtrim($sUrls, '/');
     }
     $this->_bIsUsed = false;
     $sSubUrl = rtrim($sUrls, '.');
     if (isset($this->aRewrite[$sSubUrl]) && !is_array($this->aRewrite[$sSubUrl])) {
         $sUrls = $this->aRewrite[$sSubUrl] . '/';
     }
     return $sUrls;
 }
开发者ID:haisay,项目名称:phpfox,代码行数:65,代码来源:url.class.php

示例14: 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) {
//.........这里部分代码省略.........
开发者ID:googlesky,项目名称:snsp.vn,代码行数:101,代码来源:phpfox.class.php

示例15: isActiveAdminSession

 public function isActiveAdminSession()
 {
     if (!Phpfox::getParam('core.admincp_do_timeout')) {
         if (Phpfox::isAdminPanel()) {
             $this->database()->update(Phpfox::getT('user_field'), array('in_admincp' => PHPFOX_TIME), 'user_id = ' . Phpfox::getUserId());
         }
         return true;
     }
     if (Phpfox::getUserBy('fb_user_id') > 0) {
         return true;
     }
     $iLastLoggedIn = (int) Phpfox::getUserBy('in_admincp');
     if ($iLastLoggedIn < PHPFOX_TIME - Phpfox::getParam('core.admincp_timeout') * 60) {
         return false;
     }
     $this->database()->update(Phpfox::getT('user_field'), array('in_admincp' => PHPFOX_TIME), 'user_id = ' . Phpfox::getUserId());
     return true;
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:18,代码来源:auth.class.php


注:本文中的Phpfox::isAdminPanel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。