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


PHP Phpfox::isPackage方法代码示例

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


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

示例1: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (Phpfox::isPackage(array('1', '2'))) {
         return false;
     }
     $aUser = $this->getParam('aUser');
     if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'friend.view_friend')) {
         return false;
     }
     if (Phpfox::getUserId() == $aUser['user_id'] && !defined('PHPFOX_IN_DESIGN_MODE')) {
         return false;
     }
     if (Phpfox::getUserId() == $aUser['user_id']) {
         $this->template()->assign(array('sHeader' => Phpfox::getPhrase('friend.mutual_friends'), 'sDeleteBlock' => 'profile'));
         return 'block';
     }
     list($iTotal, $aRows) = Phpfox::getService('friend')->getMutualFriends($aUser['user_id']);
     if (!$iTotal) {
         return false;
     }
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('friend.mutual_friends'), 'sDeleteBlock' => 'profile', 'aMutualFriends' => $aRows, 'iTotalMutualFriends' => $iTotal));
     if ($iTotal > 3) {
         $this->template()->assign(array('aFooter' => array(Phpfox::getPhrase('friend.view_all') => $this->url()->makeUrl($aUser['user_name'], array('friend', 'mutual')))));
     }
     return 'block';
 }
开发者ID:laiello,项目名称:kr-indian,代码行数:29,代码来源:mutual-friend.class.php

示例2: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (Phpfox::isPackage(array('1', '2'))) {
         return Phpfox_Error::display('Not able to use this feature.');
     }
     $this->template()->setTitle(Phpfox::getPhrase('friend.friend_suggestions'))->setBreadcrumb(Phpfox::getPhrase('friend.my_friends'), $this->url()->makeUrl('friend'))->setBreadcrumb(Phpfox::getPhrase('friend.suggestions'), null, true)->assign(array('aSuggestions' => Phpfox::getService('friend.suggestion')->get()));
 }
开发者ID:laiello,项目名称:kr-indian,代码行数:10,代码来源:suggestion.class.php

示例3: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (defined('PHPFOX_IS_AJAX_CONTROLLER')) {
         $aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
         $this->setParam('aUser', $aUser);
     }
     $iPageSize = 12;
     $iPage = $this->request()->getInt('page');
     $aUser = $this->getParam('aUser');
     $bMutual = $this->request()->get('req3') == 'mutual' ? true : false;
     if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'friend.view_friend')) {
         return Phpfox_Error::display('<div class="extra_info">' . Phpfox::getService('user')->getFirstName($aUser['full_name']) . ' has closed ' . Phpfox::getService('user')->gender($aUser['gender'], true) . ' friends section.</div>');
     }
     $aFilters = array('sort' => array('type' => 'select', 'options' => array(), 'default' => 'full_name', 'alias' => 'u'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'ASC'), 'search' => array('type' => 'input:text', 'search' => '(u.full_name LIKE \'%[VALUE]%\' OR u.email LIKE \'%[VALUE]%\') AND', 'size' => '15', 'onclick' => 'Search'));
     $oFilter = Phpfox::getLib('search')->set(array('type' => 'friend', 'filters' => $aFilters, 'search' => 'search'));
     if ($bMutual === true) {
         if (Phpfox::isPackage(array('1', '2'))) {
             return Phpfox_Error::display('Not able to use this feature.');
         }
         $oFilter->setCondition('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId());
         $this->template()->setBreadcrumb(Phpfox::getPhrase('friend.mutual_friends'), null, true);
     } else {
         $oFilter->setCondition('friend.is_page = 0 AND friend.user_id = ' . (int) $aUser['user_id']);
         if ($this->request()->get('view')) {
             $this->template()->setBreadcrumb(Phpfox::getPhrase('friend.friends_online'), null, true);
         }
     }
     if (($iListId = $this->request()->getInt('list')) && ($aList = Phpfox::getService('friend.list')->getList($iListId, Phpfox::getUserId())) && isset($aList['list_id'])) {
         $this->search()->setCondition('AND fld.list_id = ' . (int) $aList['list_id'] . ' AND friend.user_id = ' . $aUser['user_id']);
         $this->template()->setTitle($aList['name'])->setBreadcrumb($aList['name'], $this->url()->makeUrl('friend', array('view' => 'list', 'id' => $iListId)), true);
     }
     list($iCnt, $aFriends) = Phpfox::getService('friend')->get($oFilter->getConditions(), $oFilter->getSort(), $oFilter->getPage(), $iPageSize, true, true, $this->request()->get('view') ? true : false, $bMutual === true ? $aUser['user_id'] : null);
     $iCnt = $oFilter->getSearchTotal($iCnt);
     Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->setParam('aTotalFriends', $iCnt);
     $this->template()->setMeta('keywords', Phpfox::getPhrase('friend.full_name_s_friends', array('full_name' => $aUser['full_name'])));
     $this->template()->setMeta('keywords', Phpfox::getParam('friend.friend_meta_keywords'));
     $this->template()->setMeta('description', Phpfox::getPhrase('friend.full_name_is_on_site_title_and_has_total_friends', array('full_name' => $aUser['full_name'], 'site_title' => Phpfox::getParam('core.site_title'), 'total' => $iCnt)));
     if ($iCnt) {
         $sCustomFriends = '';
         foreach ($aFriends as $aFriend) {
             $sCustomFriends .= $aFriend['full_name'] . ', ';
         }
         $sCustomFriends = rtrim($sCustomFriends, ', ');
         $this->template()->setMeta('description', Phpfox::getPhrase('friend.full_name_is_connected_with_friends', array('full_name' => $aUser['full_name'], 'friends' => $sCustomFriends)));
     }
     $this->template()->setMeta('description', Phpfox::getPhrase('friend.sign_up_on_site_title_and_connect_with_full_name_message_full_name_or_add_full_name_as_you', array('site_title' => Phpfox::getParam('core.site_title'), 'full_name' => $aUser['full_name'])));
     $this->template()->setTitle(Phpfox::getPhrase('friend.full_name_s_friends', array('full_name' => $aUser['full_name'])))->setBreadcrumb(Phpfox::getPhrase('friend.friends'))->setHeader('cache', array('pager.css' => 'style_css', 'friend.css' => 'style_css'))->assign(array('aFriends' => $aFriends, 'sFriendView' => $this->request()->get('view')));
 }
开发者ID:laiello,项目名称:kr-indian,代码行数:52,代码来源:profile.class.php

示例4: process

	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{			
		if (Phpfox::isPackage(array('1', '2')))
		{
			return false;
		}		
		
		if (!Phpfox::getParam('friend.enable_friend_suggestion'))
		{
			return false;
		}
		
		if ($this->getParam('reload'))
		{
			Phpfox::getService('friend.suggestion')->reBuild();
		}
		
		$aSuggestion = Phpfox::getService('friend.suggestion')->getSingle();			

		if ($aSuggestion === false)
		{			
			if (PHPFOX_IS_AJAX)
			{
				echo '<div class="extra_info">' . Phpfox::getPhrase('friend.we_are_unable_to_find_any_friends_to_suggest_at_this_time_once_we_do_you_will_be_notified_within_our_dashboard') . '</div>';
				return;
			}			
						
			return false;
		}			
					
		$this->template()->assign(array(
				'sHeader' => Phpfox::getPhrase('friend.suggestions'),
				'sDeleteBlock' => 'dashboard',
				'aSuggestion' => $aSuggestion,
				'aFooter' => array(
					Phpfox::getPhrase('friend.view_all') => $this->url()->makeUrl('friend.suggestion')
				)
			)
		);	
		
		if (!PHPFOX_IS_AJAX)
		{
			return 'block';
		}
	}
开发者ID:hoanghd,项目名称:tools,代码行数:48,代码来源:suggestion.class.php

示例5: _cacheModules

 /**
  * Cache all the active modules based on the package the client is using.
  *
  */
 public function _cacheModules()
 {
     $oCache = Phpfox::getLib('cache');
     $iCachedId = $oCache->set('module');
     if (!($this->_aModules = $oCache->get($iCachedId))) {
         $aModules = array();
         $aRows = Phpfox_Database::instance()->select('m.module_id')->from(Phpfox::getT('module'), 'm')->join(Phpfox::getT('product'), 'p', 'm.product_id = p.product_id AND p.is_active = 1')->where('m.is_active = 1')->order('m.module_id')->execute('getRows');
         foreach ($aRows as $aRow) {
             switch ($aRow['module_id']) {
                 case 'im':
                 case 'music':
                 case 'shoutbox':
                 case 'subscribe':
                 case 'video':
                 case 'forum':
                     if (Phpfox::isPackage(array('premium'))) {
                         Phpfox_Database::instance()->update(Phpfox::getT('module'), array('is_active' => '0'), 'module_id = \'' . $aRow['module_id'] . '\'');
                         continue;
                     }
                     break;
             }
             $this->_aModules[$aRow['module_id']] = $aRow['module_id'];
         }
         $oCache->save($iCachedId, $this->_aModules);
     }
 }
开发者ID:Goudarzi-hahram,项目名称:phpfox,代码行数:30,代码来源:module.class.php

示例6: get

	public function get($bUninstalled = false)
	{		
		$aProductCache = array();
		$aProducts = $this->database()->select('product_id, title')
			->from(Phpfox::getT('product'))
			->execute('getRows');
		foreach ($aProducts as $aProduct)
		{
			$aProductCache[$aProduct['product_id']] = $aProduct['title'];
		}
		
		$aRows = $this->database()->select('m.*, p.title AS product_title, COUNT(s.setting_id) AS total_setting')
			->from($this->_sTable, 'm')
			->leftJoin(Phpfox::getT('product'), 'p', 'p.product_id = m.product_id')
			->leftJoin(Phpfox::getT('setting'), 's', 's.module_id = m.module_id')
			->order('m.module_id ASC')
			->group('m.module_id')
			->execute('getRows');
		
		$aModules = array();
		$aCache = array();
		foreach ($aRows as $aRow)
		{
			$aCache[$aRow['module_id']] = true;
			
			switch ($aRow['module_id'])
			{
				case 'ad':			
				case 'blog':
				case 'marketplace':
				case 'poll':
				case 'quiz':
				case 'attachment':
				case 'forum':					
					if (Phpfox::isPackage('1'))
					{					
						continue 2;
					}
					break;
				case 'im':
				case 'music':			
				case 'shoutbox':
				case 'subscribe':
				case 'video':							
					if (Phpfox::isPackage(array('1', '2')))
					{							
						continue 2;							
					}						
					break;					
			}			
				
			$aModules[($aRow['is_core'] ? 'core' : '3rdparty')][] = $aRow;			
		}		
		
		if ($bUninstalled === true)
		{
			$aNotInstalled = array();
			$hDir = opendir(PHPFOX_DIR_MODULE);
			while ($sModule = readdir($hDir))
			{
				if ($sModule == '.' || $sModule == '..')
				{
					continue;
				}
				
				if (!file_exists(PHPFOX_DIR_MODULE . $sModule . PHPFOX_DS . 'install' . PHPFOX_DS . 'phpfox.xml.php'))
				{
					continue;
				}				
				
				if (isset($aCache[$sModule]))
				{
					continue;
				}
				
				$aModuleDetails = Phpfox::getLib('xml.parser')->parse(file_get_contents(PHPFOX_DIR_MODULE . $sModule . PHPFOX_DS . 'install' . PHPFOX_DS . 'phpfox.xml.php'));				
				if (isset($aModuleDetails['data']))
				{
					$aModuleDetails['data']['is_not_installed'] = true;
					$aModuleDetails['data']['product_title'] = (isset($aProductCache[$aModuleDetails['data']['product_id']]) ? $aProductCache[$aModuleDetails['data']['product_id']] : $aModuleDetails['data']['product_id']);
					
					$aNotInstalled[] = $aModuleDetails['data'];
				}
			}
			closedir($hDir);
			
			if (count($aNotInstalled))
			{
				foreach ($aNotInstalled as $aModule)
				{
					$aModules['3rdparty'][] = $aModule;
				}
			}
		}		
					
		return $aModules;
	}	
开发者ID:hoanghd,项目名称:tools,代码行数:97,代码来源:module.class.php

示例7: getParam

 /**
  * Get a setting and its value.
  *
  * @param mixed $mVar STRING name of the setting or ARRAY name of the setting.
  * @param string $sDef Default value in case the setting cannot be found.
  * @return nixed Returns the value of the setting, which can be a STRING, ARRAY, BOOL or INT.
  */
 public function getParam($mVar, $sDef = '')
 {
     if ($mVar == 'core.branding' && Phpfox::isPackage(array('premium', 'ultimate'))) {
         return true;
     }
     if ($mVar == 'im.enable_im_in_footer_bar' && Phpfox::isMobile()) {
         return false;
     }
     // http://www.phpfox.com/tracker/view/15079/
     /*if ($mVar == 'core.wysiwyg' && !defined('PHPFOX_INSTALLER') && Phpfox::isMobile())
     		{
     			return 'default';
     		}*/
     if ($mVar == 'core.phpfox_is_hosted') {
         return $this->getParam('core.is_auto_hosted');
     }
     if (defined('PHPFOX_IS_HOSTED_SCRIPT')) {
         /*
         if ($mVar == 'core.url_static_script')
         {
         	return Phpfox::getCdnPath() . 'static/jscript/';
         }
         */
         if ($mVar == 'core.setting_session_prefix') {
             return PHPFOX_IS_HOSTED_SCRIPT;
         } elseif ($mVar == 'video.allow_video_uploading') {
             return true;
         }
         /*
         elseif ($mVar == 'core.cache_js_css')
         {
         	return true;			
         }
         */
     }
     if (defined('PHPFOX_INSTALLER') && $mVar == 'core.cache_js_css') {
         return false;
     }
     if (is_array($mVar)) {
         $sParam = isset($this->_aParams[$mVar[0]][$mVar[1]]) ? $this->_aParams[$mVar[0]][$mVar[1]] : (isset($this->_aDefaults[$mVar[0]][$mVar[1]]) ? $this->_aDefaults[$mVar[0]][$mVar[1]] : Phpfox_Error::trigger('Missing Param: ' . $mVar[0] . '][' . $mVar[1]));
     } else {
         $sParam = isset($this->_aParams[$mVar]) ? $this->_aParams[$mVar] : (isset($this->_aDefaults[$mVar]) ? $this->_aDefaults[$mVar] : Phpfox_Error::trigger('Missing Param: ' . $mVar));
         if (!defined('PHPFOX_INSTALLER') && ($mVar == 'core.footer_bar_site_name' || $mVar == 'core.site_copyright')) {
             $sParam = Phpfox_Locale::instance()->convert($sParam);
         }
         if ($mVar == 'admincp.admin_cp') {
             $sParam = strtolower($sParam);
         }
         if ($mVar == 'user.points_conversion_rate') {
             $sParam = empty($sParam) ? array() : json_decode($sParam, true);
         }
     }
     if ($mVar == 'core.wysiwyg' && !defined('PHPFOX_INSTALLER') && $sParam == 'tiny_mce' && !Phpfox::isModule('tinymce')) {
         return 'default';
     }
     return $sParam;
 }
开发者ID:JerwinPRO,项目名称:phpfox,代码行数:64,代码来源:setting.class.php

示例8: _cacheModules

 /**
  * Cache all the active modules based on the package the client is using.
  *
  */
 public function _cacheModules()
 {
     $oCache = Phpfox::getLib('cache');
     $iCachedId = $oCache->set('module');
     if (!($this->_aModules = $oCache->get($iCachedId))) {
         $aModules = array();
         $aRows = Phpfox::getLib('database')->select('m.module_id')->from(Phpfox::getT('module'), 'm')->join(Phpfox::getT('product'), 'p', 'm.product_id = p.product_id AND p.is_active = 1')->where('m.is_active = 1')->order('m.module_id')->execute('getRows');
         foreach ($aRows as $aRow) {
             if (Phpfox::getParam('core.is_auto_hosted')) {
                 switch ($aRow['module_id']) {
                     case 'im':
                     case 'music':
                     case 'shoutbox':
                     case 'rss':
                     case 'quiz':
                     case 'marketplace':
                     case 'blog':
                     case 'poll':
                         Phpfox::getLib('database')->update(Phpfox::getT('module'), array('is_active' => '0'), 'module_id = \'' . $aRow['module_id'] . '\'');
                         continue 2;
                         break;
                 }
             }
             switch ($aRow['module_id']) {
                 case 'ad':
                 case 'blog':
                 case 'marketplace':
                 case 'poll':
                 case 'quiz':
                 case 'attachment':
                 case 'forum':
                     if (Phpfox::isPackage('1')) {
                         Phpfox::getLib('database')->update(Phpfox::getT('module'), array('is_active' => '0'), 'module_id = \'' . $aRow['module_id'] . '\'');
                         continue;
                     }
                     break;
                 case 'im':
                 case 'music':
                 case 'shoutbox':
                 case 'subscribe':
                 case 'video':
                     if (Phpfox::isPackage(array('1', '2'))) {
                         Phpfox::getLib('database')->update(Phpfox::getT('module'), array('is_active' => '0'), 'module_id = \'' . $aRow['module_id'] . '\'');
                         continue;
                     }
                     break;
             }
             $this->_aModules[$aRow['module_id']] = $aRow['module_id'];
         }
         $oCache->save($iCachedId, $this->_aModules);
     }
 }
开发者ID:laiello,项目名称:kr-indian,代码行数:56,代码来源:module.class.php


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