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


PHP Phpfox::hasCallback方法代码示例

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


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

示例1: process

 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('comment.can_moderate_comments', true);
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'cmt'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'comments', 'filters' => $aFilters, 'search' => 'search'));
     if ($this->request()->get('view') == 'approval') {
         $oSearch->setCondition('AND cmt.view_id = 1');
     } else {
         $oSearch->setCondition('AND cmt.view_id = 9');
     }
     list($iCnt, $aComments) = Phpfox::getService('comment')->get('cmt.*', $oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay(), null, true);
     foreach ($aComments as $iKey => $aComment) {
         if (Phpfox::hasCallback($aComment['type_id'], 'getItemName')) {
             $aComments[$iKey]['item_name'] = Phpfox::callback($aComment['type_id'] . '.getItemName', $aComment['comment_id'], $aComment['owner_full_name']);
         }
     }
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
     $this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aComments' => $aComments, 'bIsCommentAdminPanel' => true));
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:28,代码来源:index.class.php

示例2: process

 /**
  * Controller
  */
 public function process()
 {
     if ($iCommentId = $this->request()->getInt('req3')) {
         $aComment = Phpfox::getService('comment')->getComment($iCommentId);
         if (!isset($aComment['comment_id'])) {
             return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist'));
         }
         if (Phpfox::hasCallback('comment', 'getRedirectRequest')) {
             $this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id']));
         }
         if (Phpfox::hasCallback($aComment['type_id'], 'getParentItemCommentUrl')) {
             $sNewUrl = Phpfox::callback($aComment['type_id'] . '.getParentItemCommentUrl', $aComment);
             if ($sNewUrl !== false) {
                 $aComment['callback_url'] = $sNewUrl;
             }
         }
         $this->template()->setTitle(Phpfox::getPhrase('comment.viewing_comment'))->setHeader(array('view.css' => 'module_comment'))->setBreadcrumb(Phpfox::getPhrase('comment.viewing_comment'))->assign(array('aComment' => $aComment));
     } else {
         $aComment = Phpfox::getService('comment')->getComment($this->request()->getInt('id'));
         if (!isset($aComment['comment_id'])) {
             return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist'));
         }
         $this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id']));
     }
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:28,代码来源:view.class.php

示例3: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $iRsvp = $this->request()->get('rsvp', 1);
     $iPage = $this->request()->getInt('page');
     $sModule = $this->request()->get('module', false);
     $iItem = $this->request()->getInt('item', false);
     $aCallback = $this->getParam('aCallback', false);
     $iPageSize = 6;
     if (PHPFOX_IS_AJAX) {
         $aCallback = false;
         if ($sModule && $iItem && Phpfox::hasCallback($sModule, 'getEventInvites')) {
             $aCallback = Phpfox::callback($sModule . '.getEventInvites', $iItem);
         }
         $aEvent = Phpfox::getService('event')->callback($aCallback)->getEvent($this->request()->get('id'), true);
         $this->template()->assign('aEvent', $aEvent);
     } else {
         $aEvent = $this->getParam('aEvent');
         $this->template()->assign('aEvent', $aEvent);
     }
     if ($aCallback !== false) {
         $sModule = $aCallback['module'];
         $iItem = $aCallback['item'];
     }
     list($iCnt, $aInvites) = Phpfox::getService('event')->getInvites($aEvent['event_id'], $iRsvp, $iPage, $iPageSize);
     Phpfox::getLib('pager')->set(array('ajax' => 'event.listGuests', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'aParams' => array('id' => $aEvent['event_id'], 'module' => $sModule, 'item' => $iItem, 'rsvp' => $iRsvp)));
     $this->template()->assign(array('aInvites' => $aInvites, 'iRsvp' => $iRsvp));
     if (!PHPFOX_IS_AJAX) {
         $sExtra = '';
         if ($aCallback !== false) {
             $sExtra .= '&module=' . $aCallback['module'] . '&item=' . $aCallback['item'];
         }
         $this->template()->assign(array('sHeader' => Phpfox::getPhrase('event.event_guests'), 'aMenu' => array(Phpfox::getPhrase('event.attending') => '#event.listGuests?rsvp=1&id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.maybe') => '#event.listGuests?rsvp=2&id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.can_t_make_it') => '#event.listGuests?rsvp=3&id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.not_responded') => '#event.listGuests?rsvp=0&id=' . $aEvent['event_id'] . $sExtra), 'sBoxJsId' => 'event_guests'));
         return 'block';
     }
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:38,代码来源:list.class.php

示例4: getMessages

	/**
	 * Get the latest shoutouts.
	 *
	 * @param int $iLimit Define the limit so we don't return all the shoutouts.
	 * @return array Array of shoutouts.
	 */
	public function getMessages($iLimit = 5)
	{
		if (isset($this->_aCallback['module']))
		{
			if (Phpfox::hasCallback($this->_aCallback['module'], 'getShoutboxData'))
			{
				$aCallback = Phpfox::callback($this->_aCallback['module'] . '.getShoutboxData');		
				if (isset($aCallback['table']))
				{
					$this->_sTable = Phpfox::getT($aCallback['table']);
					
					$this->database()->where('item_id = ' . (int) $this->_aCallback['item']);
				}
			}
		}				
		
		$aMessages = $this->database()->select('s.shout_id, s.text, s.time_stamp, ' . Phpfox::getUserField())
			->from($this->_sTable, 's')
			->join(Phpfox::getT('user'), 'u', 'u.user_id = s.user_id')
			->limit($iLimit)
			->order('s.time_stamp DESC')
			->execute('getSlaveRows');

		foreach ($aMessages as $iKey => $aMessage)
		{
			$aMessage['text'] = Phpfox::getLib('parse.output')->split(Phpfox::getLib('parse.output')->clean($aMessage['text']), Phpfox::getParam('shoutbox.shoutbox_wordwrap'));
			
			$aMessages[$iKey]['text'] = Phpfox::getService('emoticon')->parse($aMessage['text']);
			$aMessages[$iKey]['module'] = (isset($this->_aCallback['module']) ? $this->_aCallback['module'] : '');
		}
			
		return $aMessages;
	}
开发者ID:hoanghd,项目名称:tools,代码行数:39,代码来源:shoutbox.class.php

示例5: getMessages

 /**
  * Get the latest shoutouts.
  *
  * @param int $iLimit Define the limit so we don't return all the shoutouts.
  * @return array Array of shoutouts.
  */
 public function getMessages($iLimit = 5)
 {
     if (isset($this->_aCallback['module'])) {
         if (Phpfox::hasCallback($this->_aCallback['module'], 'getShoutboxData')) {
             $aCallback = Phpfox::callback($this->_aCallback['module'] . '.getShoutboxData');
             if (isset($aCallback['table'])) {
                 $this->_sTable = Phpfox::getT($aCallback['table']);
                 $this->database()->where('item_id = ' . (int) $this->_aCallback['item']);
             }
         }
     }
     $aMessages = $this->database()->select('s.shout_id, s.text, s.time_stamp, ' . Phpfox::getUserField())->from($this->_sTable, 's')->join(Phpfox::getT('user'), 'u', 'u.user_id = s.user_id')->limit($iLimit)->order('s.time_stamp DESC')->execute('getSlaveRows');
     foreach ($aMessages as $iKey => $aMessage) {
         $aMessage['text'] = Phpfox::getLib('parse.output')->replaceHashTags(Phpfox::getLib('parse.output')->split(Phpfox::getLib('parse.output')->clean($aMessage['text']), Phpfox::getParam('shoutbox.shoutbox_wordwrap')));
         if (Phpfox::isModule('emoticon')) {
             $aMessages[$iKey]['text'] = Phpfox::getService('emoticon')->parse($aMessage['text']);
         }
         $aMessages[$iKey]['module'] = isset($this->_aCallback['module']) ? $this->_aCallback['module'] : '';
     }
     // FUDGE Lovinity January 5, 2016: Filter shouts by users who have been blocked or are blocking
     $bIsBlocked = Phpfox::getService('user.block')->isBlocked($aMessages[$iKey]['user_id'], Phpfox::getUserId());
     $bIsBlocked2 = Phpfox::getService('user.block')->isBlocked(Phpfox::getUserId(), $aMessages[$iKey]['user_id']);
     if ($bIsBlocked || $bIsBlocked2) {
         $aMessages[$iKey]['text'] = '<img src="file/public/blocked.png">';
     }
     // END FUDGE
     return $aMessages;
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:34,代码来源:shoutbox.class.php

示例6: process

 public function process()
 {
     Phpfox::getLib('setting')->setParam(array('profiles.url_image' => Phpfox::getParam('core.url_pic') . 'profiles/'));
     $mUser = $this->request()->get('req2');
     $sSection = $this->request()->get('req3');
     $bIsPublicItemView = false;
     if (Phpfox::isPublicView()) {
         if (!empty($sSection) && Phpfox::isModule($sSection) && $sSection != 'designer' && Phpfox::hasCallback($sSection, 'getItemView') && Phpfox::callback($sSection . '.getItemView') === true) {
             $bIsPublicItemView = true;
         }
     }
     if (!$mUser) {
         if (Phpfox::isUser()) {
             $this->url()->send('profile');
         } else {
             Phpfox::isUser(true);
         }
     }
     // If we are unable to find a user lets make sure we return a 404 page not found error
     $aExtraProfile = Phpfox::getService('profiles')->getProfile($mUser);
     if (count($aExtraProfile) == 0) {
         return Phpfox::getLib('module')->setController('error.404');
     }
     $aUser = Phpfox::getService('user')->get($aExtraProfile['user_id']);
     $this->setParam('aExtraProfile', $aExtraProfile);
     $this->template()->assign(array('aExtraProfile' => $aExtraProfile));
     if (Phpfox::getService('user.block')->isBlocked($aExtraProfile['user_id'], Phpfox::getUserId()) && !Phpfox::getUserParam('user.can_override_user_privacy')) {
         $this->url()->send($aUser['user_name']);
     }
     if (!Phpfox::getService('user.privacy')->hasAccess($aExtraProfile['user_id'], 'profile.view_profile')) {
         $this->url()->send($aUser['user_name']);
     }
     //This is where I want to add $this->request()->get('req3') == gallery
     if (!empty($sSection) && $sSection == 'photo') {
         Phpfox::getLib('module')->setController('profiles.view');
     }
     Phpfox::getUserParam('profile.can_view_users_profile', true);
     $this->template()->setHeader('cache', array('profile.css' => 'style_css', 'feed.js' => 'module_feed'));
     $this->template()->setMeta('description', Phpfox::getPhrase('profiles.meta_description', array('extra_name' => $aExtraProfile['title'], 'site_title' => Phpfox::getParam('core.site_title'), 'meta_description_profile' => Phpfox::getParam('core.meta_description_profile'))));
     $sPageTitle = $aExtraProfile['title'];
     $this->setParam('aFeed', array('comment_type_id' => 'profiles', 'privacy' => 0, 'comment_privacy' => 0, 'item_id' => $aExtraProfile['extra_id'], 'like_type_id' => 'profiles', 'feed_is_liked' => isset($aExtraProfile['is_liked']) ? $aExtraProfile['is_liked'] : false, 'user_id' => $aExtraProfile['user_id'], 'total_comment' => $aExtraProfile['total_comment'], 'total_like' => 0, 'feed_link' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url']), 'feed_title' => $aExtraProfile['title'], 'feed_display' => 'view', 'report_module' => 'profiles', 'report_phrase' => Phpfox::getPhrase('profiles.report_this_profile')));
     if ($this->request()->get('req3') != 'photo') {
         $this->template()->setBreadcrumb($sPageTitle, Phpfox::getLib('url')->makeUrl('profiles.browse'));
     } elseif ($this->request()->get('req3') == '') {
         $this->template()->setBreadcrumb(Phpfox::getPhrase('profiles.extra_profiles'), Phpfox::getLib('url')->makeUrl('profiles.browse'));
     }
     $this->template()->setTitle($sPageTitle)->setEditor(array('load' => 'simple', 'wysiwyg' => Phpfox::isModule('comment') && Phpfox::getParam('comment.wysiwyg_comments') && Phpfox::getUserParam('comment.wysiwyg_on_comments')))->setUrl('profiles')->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'));
     if ($this->request()->get('update')) {
         $this->template()->setHeader('<script type="text/javascript">window.parent.tb_remove();</script>');
     }
     if ($sPlugin = Phpfox_Plugin::get('profiles.component_controller_index_end')) {
         eval($sPlugin);
         if (isset($mReturnFromPlugin)) {
             return $mReturnFromPlugin;
         }
     }
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:57,代码来源:index.class.php

示例7: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (Phpfox::getParam('video.convert_servers_secret') != $this->request()->get('_v_secret')) {
         $this->p('Secret does not match', true);
     } else {
         if ($this->request()->get('_v_action')) {
             switch ($this->request()->get('_v_action')) {
                 case 'completed':
                     $iCnt = 0;
                     foreach (Phpfox::getParam('video.convert_servers') as $sServer) {
                         $iCnt++;
                         if (md5($sServer) == $this->request()->get('url')) {
                             break;
                         }
                     }
                     $sDest = '{' . $iCnt . '}' . $this->request()->get('name');
                     $aVideo = Phpfox::getLib('database')->select('*')->from(Phpfox::getT('video'))->where('custom_v_id = ' . (int) $this->request()->get('id'))->execute('getSlaveRow');
                     if (isset($aVideo['video_id'])) {
                         $aCallback = null;
                         if ($aVideo['module_id'] != 'video' && Phpfox::hasCallback($aVideo['module_id'], 'convertVideo')) {
                             $aCallback = Phpfox::callback($aVideo['module_id'] . '.convertVideo', $aVideo);
                         }
                         Phpfox::isModule('feed') ? Phpfox::getService('feed.process')->callback($aCallback)->allowGuest()->add('video', $aVideo['video_id'], $aVideo['privacy'], $aVideo['privacy_comment'], $aVideo['item_id'], $aVideo['user_id']) : null;
                         Phpfox::getLib('database')->update(Phpfox::getT('video'), array('in_process' => '0', 'destination' => $sDest, 'image_path' => $sDest . '.jpg'), 'custom_v_id = ' . (int) $this->request()->get('id'));
                         $bUpdatePoints = $aVideo['module_id'] == 'video' ? Phpfox::getUserParam('video.approve_video_before_display') ? false : true : true;
                         if ($bUpdatePoints === true) {
                             // Update user activity
                             Phpfox::getService('user.activity')->update($aVideo['user_id'], 'video');
                         }
                     }
                     break;
                 case 'canUpload':
                     // Will add security checks later
                     if (Phpfox::getService('video')->checkCustomHash($this->request()->get('hash_id'))) {
                         $this->p('All is good.');
                     } else {
                         $this->p('No token set for this upload.', true);
                     }
                     break;
                 case 'getSettings':
                     $aSettings = array();
                     $aParams = array('video.covert_mp4_exec', 'video.covert_webm_exec', 'video.covert_ogg_exec', 'video.covert_mp4_image');
                     foreach ($aParams as $sParam) {
                         $aSettings[$sParam] = Phpfox::getParam($sParam);
                     }
                     $this->p($aSettings);
                     break;
             }
         } else {
             $this->p('No action provided', true);
         }
     }
     $this->output();
     exit;
 }
开发者ID:googlesky,项目名称:snsp.vn,代码行数:58,代码来源:ping.class.php

示例8: _getNotification

 public function _getNotification($iUserId)
 {
     $aGetRows = $this->database()->select('n.*, n.user_id as item_user_id, COUNT(n.notification_id) AS total_extra, ' . Phpfox::getUserField())->from($this->_sTable, 'n')->join(Phpfox::getT('user'), 'u', 'u.user_id = n.owner_user_id')->innerJoin('(SELECT * FROM ' . $this->_sTable . ' AS n WHERE n.user_id = ' . $iUserId . ' ORDER BY n.time_stamp DESC)', 'ninner', 'ninner.notification_id = n.notification_id')->where('n.user_id = ' . $iUserId . '')->group('n.type_id, n.item_id')->order('n.is_seen ASC, n.time_stamp DESC')->limit(5)->execute('getSlaveRows');
     $aRows = array();
     foreach ($aGetRows as $aGetRow) {
         $aRows[(int) $aGetRow['notification_id']] = $aGetRow;
     }
     arsort($aRows);
     $aNotifications = array();
     foreach ($aRows as $aRow) {
         $aParts1 = explode('.', $aRow['type_id']);
         $sModule = $aParts1[0];
         if (strpos($sModule, '_')) {
             $aParts = explode('_', $sModule);
             $sModule = $aParts[0];
         }
         if (Phpfox::isModule($sModule)) {
             if ((int) $aRow['total_extra'] > 1) {
                 $aExtra = $this->database()->select('n.owner_user_id, n.time_stamp, n.is_seen, u.full_name')->from($this->_sTable, 'n')->join(Phpfox::getT('user'), 'u', 'u.user_id = n.owner_user_id')->where('n.type_id = \'' . $this->database()->escape($aRow['type_id']) . '\' AND n.item_id = ' . (int) $aRow['item_id'])->group('u.user_id')->order('n.time_stamp DESC')->limit(10)->execute('getSlaveRows');
                 foreach ($aExtra as $iKey => $aExtraUser) {
                     if ($aExtraUser['owner_user_id'] == $aRow['user_id']) {
                         unset($aExtra[$iKey]);
                     }
                     if (!$aRow['is_seen'] && $aExtraUser['is_seen']) {
                         unset($aExtra[$iKey]);
                     }
                 }
                 if (count($aExtra)) {
                     $aRow['extra_users'] = $aExtra;
                 }
             }
             if (substr($aRow['type_id'], 0, 8) != 'comment_' && !Phpfox::hasCallback($aRow['type_id'], 'getNotification')) {
                 $aCallBack['link'] = '#';
                 $aCallBack['message'] = '2. Notification is missing a callback. [' . $aRow['type_id'] . '::getNotification]';
             } elseif (substr($aRow['type_id'], 0, 8) == 'comment_' && substr($aRow['type_id'], 0, 12) != 'comment_feed' && !Phpfox::hasCallback(substr_replace($aRow['type_id'], '', 0, 8), 'getCommentNotification')) {
                 $aCallBack['link'] = '#';
                 $aCallBack['message'] = 'Notification is missing a callback. [' . substr_replace($aRow['type_id'], '', 0, 8) . '::getCommentNotification]';
             } else {
                 // set wanted user id
                 Phpfox::getService('user.auth')->setUserId($iUserId);
                 $aCallBack = Phpfox::callback($aRow['type_id'] . '.getNotification', $aRow);
                 // reset current user id
                 Phpfox::getService('user.auth')->setUserId(null);
                 if ($aCallBack === false) {
                     $this->database()->delete($this->_sTable, 'notification_id = ' . (int) $aRow['notification_id']);
                     continue;
                 }
             }
             $aNotifications[] = array_merge($aRow, (array) $aCallBack);
         }
         //            $this->database()->update($this->_sTable, array('is_seen' => '1'), 'type_id = \'' . $this->database()->escape($aRow['type_id']) . '\' AND item_id = ' . (int) $aRow['item_id']);
     }
     return $aNotifications;
 }
开发者ID:PhpFoxPro,项目名称:Better-Mobile-Module,代码行数:54,代码来源:notification.class.php

示例9: process

 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     static $aBookmarks = array();
     if (empty($aBookmarks)) {
         $aBookmarks = Phpfox::getService('share')->getType();
     }
     if (!is_array($aBookmarks)) {
         $aBookmarks = array();
     }
     $this->template()->assign(array('sBookmarkType' => $this->getParam('type'), 'sBookmarkUrl' => $this->getParam('url'), 'sBookmarkTitle' => $this->getParam('title'), 'bShowSocialBookmarks' => count($aBookmarks) > 0, 'iFeedId' => Phpfox::hasCallback($this->request()->get('sharemodule'), 'canShareItemOnFeed') ? $this->request()->getInt('feed_id') : 0, 'sShareModule' => $this->request()->get('sharemodule')));
 }
开发者ID:googlesky,项目名称:snsp.vn,代码行数:14,代码来源:frame.class.php

示例10: canUpdateURL

 /**
  * This function checks if a user is allowed to update the URL of a specific blog
  */
 public function canUpdateURL($sModule, $iUser, $iItemId)
 {
     // first the general permission
     if (!Phpfox::isModule($sModule) || Phpfox::getUserParam($sModule . '.can_update_url') == false || !Phpfox::hasCallback($sModule, 'getRedirectionTable')) {
         return false;
     }
     $iCnt = $this->database()->select('COUNT(*)')->from(Phpfox::callback($sModule . '.getRedirectionTable'))->where('item_id = ' . (int) $iItemId)->execute('getSlaveField');
     if ($iCnt >= Phpfox::getUserParam($sModule . '.how_many_url_updates') && $iCnt > 0 && Phpfox::getUserParam($sModule . '.how_many_url_updates') > 0) {
         return false;
     }
     return true;
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:15,代码来源:redirect.class.php

示例11: loadProfileBlock

 public function loadProfileBlock()
 {
     die('sdsdg');
     exit;
     $sProfileUrl = str_replace('profile_', '', $this->get('url'));
     if ($this->get('url') == 'profile_info') {
         $sProfileUrl = 'profile';
     }
     if (!Phpfox::isModule($sProfileUrl)) {
         Phpfox_Error::set('Trying to load an invalid module.');
     } else {
         if (!Phpfox::hasCallback($sProfileUrl, 'getAjaxProfileController')) {
             Phpfox_Error::set('Unable to load the section you are looking for.');
         }
     }
     if (Phpfox_Error::isPassed()) {
         $oModule = Phpfox::getLib('module');
         $oTpl = Phpfox::getLib('template');
         $oTpl->assign(array('bIsAjaxLoader' => true));
         $aStyleInUse = $oTpl->getStyleInUse();
         $oModule->loadBlocks();
         $aUrlParams = array($this->get('user_name'));
         if ($this->get('url') != 'profile') {
             $aUrlParams[] = str_replace('profile_', '', $this->get('url'));
         }
         Phpfox::getLib('url')->setParam($aUrlParams);
         $oModule->setController(Phpfox::callback($sProfileUrl . '.getAjaxProfileController'));
         if ($aStyleInUse['total_column'] == '3') {
             $oTpl->assign(array('aBlocks1' => $oTpl->bIsSample ? true : Phpfox::getLib('module')->getModuleBlocks(1), 'aBlocks3' => $oTpl->bIsSample ? true : Phpfox::getLib('module')->getModuleBlocks(3), 'aAdBlocks1' => $oTpl->bIsSample ? true : (Phpfox::isModule('ad') ? Phpfox::getService('ad')->getForBlock(1) : null), 'aAdBlocks3' => $oTpl->bIsSample ? true : (Phpfox::isModule('ad') ? Phpfox::getService('ad')->getForBlock(3) : null)));
         } else {
             $oTpl->assign(array('aBlocks1' => array(), 'aBlocks3' => array(), 'aAdBlocks1' => array(), 'aAdBlocks3' => array()));
         }
         $oTpl->assign(array('sPublicMessage' => Phpfox::getMessage(), 'aErrors' => Phpfox_Error::getDisplay() ? Phpfox_Error::get() : array(), 'aStyleInUse' => $aStyleInUse));
         list($aBreadCrumbs, $aBreadCrumbTitle) = $oTpl->getBreadCrumb();
         $this->remove('#js_temp_breadcrumb');
         if (count($aBreadCrumbs)) {
             foreach ($aBreadCrumbs as $sLink => $sPhrase) {
                 $this->append('h1', '<span id="js_temp_breadcrumb"><span class="profile_breadcrumb">&#187;</span><a href="' . $sLink . '">' . $sPhrase . '</a></span>');
                 break;
             }
         }
         $oTpl->getLayout($oTpl->sDisplayLayout);
         $this->html($aStyleInUse['total_column'] == '3' ? '#content_load_data' : '#content', $this->getContent(false));
         if ($this->get('url') == 'profile_info') {
             $this->call('$Core.loadProfileInfo();');
         }
     } else {
         $this->html('#js_profile_block_view_data_' . $this->get('url'), implode('', Phpfox_Error::get()));
     }
     $this->call('$Core.loadInit();');
 }
开发者ID:laiello,项目名称:kr-indian,代码行数:51,代码来源:ajax.class.php

示例12: add

 /**
  * Add link
  * @param $aVals
  * @param $sUrl
  * @param $aLink
  * @return bool
  */
 public function add($aVals, $sUrl, $aLink)
 {
     $aCallback = null;
     if (isset($aVals['callback_module']) && Phpfox::hasCallback($aVals['callback_module'], 'addLink')) {
         $aCallback = Phpfox::callback($aVals['callback_module'] . '.addLink', $aVals);
     }
     $aVals['link'] = $aLink;
     $aVals['link']['url'] = $sUrl;
     $aVals['link']['image'] = $aLink['default_image'];
     if ($iId = Phpfox::getService('link.process')->add($aVals, false, $aCallback)) {
         return $iId;
     }
     return false;
 }
开发者ID:PhpFoxPro,项目名称:Better-Mobile-Module,代码行数:21,代码来源:link.class.php

示例13: delete

 public function delete($iId, $sModule = '')
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('shoutbox.can_delete_all_shoutbox_messages', true);
     $sTable = 'shoutbox';
     if (!empty($sModule) && Phpfox::hasCallback($sModule, 'getShoutboxData')) {
         $aCallback = Phpfox::callback($sModule . '.getShoutboxData');
         if (isset($aCallback['table'])) {
             $sTable = $aCallback['table'];
         }
     }
     $this->database()->delete(Phpfox::getT($sTable), 'shout_id = ' . (int) $iId);
     return true;
 }
开发者ID:googlesky,项目名称:snsp.vn,代码行数:14,代码来源:process.class.php

示例14: process

 public function process()
 {
     Phpfox::getLib('setting')->setParam(array('profiles.url_image' => Phpfox::getParam('core.url_pic') . 'profiles/'));
     $mUser = $this->request()->get('req2');
     $sSection = $this->request()->get('req3');
     $bIsPublicItemView = false;
     if (Phpfox::isPublicView()) {
         if (!empty($sSection) && Phpfox::isModule($sSection) && $sSection != 'designer' && Phpfox::hasCallback($sSection, 'getItemView') && Phpfox::callback($sSection . '.getItemView') === true) {
             $bIsPublicItemView = true;
         }
     }
     if (!$mUser) {
         if (Phpfox::isUser()) {
             $this->url()->send('profile');
         } else {
             Phpfox::isUser(true);
         }
     }
     $aExtraProfile = Phpfox::getService('profiles')->getProfile($mUser);
     if (count($aExtraProfile) == 0) {
         return Phpfox::getLib('module')->setController('error.404');
     }
     $aUser = Phpfox::getService('user')->get($aExtraProfile['user_id']);
     $this->setParam('aExtraProfile', $aExtraProfile);
     $this->template()->assign(array('aExtraProfile' => $aExtraProfile));
     if (Phpfox::getService('user.block')->isBlocked($aExtraProfile['user_id'], Phpfox::getUserId()) && !Phpfox::getUserParam('user.can_override_user_privacy')) {
         $this->url()->send($aUser['user_name']);
     }
     if (!Phpfox::getService('user.privacy')->hasAccess($aExtraProfile['user_id'], 'profile.view_profile')) {
         $this->url()->send($aUser['user_name']);
     }
     if (!empty($sSection) && $sSection == 'photo') {
         $this->setParam('aParentModule', array('module_id' => 'profiles', 'item_id' => $aExtraProfile['extra_id'], 'url' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url'])));
         $this->template()->setTitle($aExtraProfile['title'])->setBreadcrumb($aExtraProfile['title'], $this->url()->makeUrl('profiles', $aExtraProfile['title_url']));
         $this->url()->aRewrite['photo/add/'] = 'profiles/redirect/photo/add/' . $aExtraProfile['extra_id'];
         $this->url()->aReverseRewrite['profiles/redirect/photo/add/' . $aExtraProfile['extra_id']] = 'photo/add/';
     }
     Phpfox::getUserParam('profile.can_view_users_profile', true);
     $this->template()->setHeader('cache', array('profile.css' => 'style_css', 'feed.js' => 'module_feed'));
     $this->template()->setMeta('description', Phpfox::getPhrase('profiles.meta_description', array('extra_name' => $aExtraProfile['title'], 'site_title' => Phpfox::getParam('core.site_title'), 'meta_description_profile' => Phpfox::getParam('core.meta_description_profile'))));
     $sPageTitle = $aExtraProfile['title'];
     $this->setParam('aFeed', array('comment_type_id' => 'profiles', 'privacy' => 0, 'comment_privacy' => 0, 'item_id' => $aExtraProfile['extra_id'], 'like_type_id' => 'profiles', 'feed_is_liked' => isset($aExtraProfile['is_liked']) ? $aExtraProfile['is_liked'] : false, 'user_id' => $aExtraProfile['user_id'], 'total_comment' => $aExtraProfile['total_comment'], 'total_like' => 0, 'feed_link' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url']), 'feed_title' => $aExtraProfile['title'], 'feed_display' => 'view', 'report_module' => 'profiles', 'report_phrase' => Phpfox::getPhrase('profiles.report_this_profile')));
     $this->template()->setTitle($sPageTitle)->setEditor(array('load' => 'simple', 'wysiwyg' => Phpfox::isModule('comment') && Phpfox::getParam('comment.wysiwyg_comments') && Phpfox::getUserParam('comment.wysiwyg_on_comments')))->setUrl('profiles')->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'));
     if ($this->request()->get('update')) {
         $this->template()->setHeader('<script type="text/javascript">window.parent.tb_remove();</script>');
     }
     Phpfox::getComponent('photo.index', array('bNoTemplate' => true), 'controller');
     $this->setParam('global_moderation', array('name' => 'photo', 'ajax' => 'profiles.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('photo.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('photo.approve'), 'action' => 'approve'))));
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:49,代码来源:view.class.php

示例15: process

 /**
  * Controller
  */
 public function process()
 {
     $iId = $this->request()->get('id');
     $aRow = Phpfox::getService('attachment')->getForDownload($iId);
     if (!isset($aRow['destination'])) {
         return Phpfox_Error::display(Phpfox::getPhrase('attachment.no_such_download_found'));
     }
     $sPath = Phpfox::getParam('core.dir_attachment') . sprintf($aRow['destination'], '');
     if (Phpfox::hasCallback($aRow['category_id'], 'attachmentControl')) {
         $bAllowed = Phpfox::callback($aRow['category_id'] . '.attachmentControl', $aRow['item_id']);
         if ($bAllowed == false) {
             return Phpfox_Error::display(Phpfox::getPhrase('attachment.you_are_not_allowed_to_download_this_attachment'));
         }
     }
     Phpfox::getService('attachment.process')->updateCounter($aRow['attachment_id']);
     Phpfox_File::instance()->forceDownload($sPath, $aRow['file_name'], $aRow['mime_type'], $aRow['file_size'], $aRow['server_id']);
     exit;
 }
开发者ID:lev1976g,项目名称:core,代码行数:21,代码来源:download.class.php


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