示例#1
0
 /**
  * Controller
  */
 public function process()
 {
     if (!defined('PHPFOX_IS_USER_PROFILE') && !defined('PHPFOX_IS_PAGES_VIEW')) {
         return false;
     }
     if (defined('PHPFOX_IS_PAGES_VIEW')) {
         $aUser = $this->getParam('aPage');
         $aUser['user_image'] = $aUser['image_path'];
         $aUser['profile_page_id'] = $aUser['page_id'];
         $aUser['server_id'] = $aUser['image_server_id'];
     } else {
         $aUser = $this->getParam('aUser');
     }
     $aUserInfo = array('title' => $aUser['full_name'], 'path' => 'core.url_user', 'file' => $aUser['user_image'], 'suffix' => '_50_square', 'max_width' => 75, 'max_height' => 75, 'no_default' => Phpfox::getUserId() == $aUser['user_id'] ? false : true, 'thickbox' => true, 'class' => 'profile_user_image');
     if (defined('PHPFOX_IS_PAGES_VIEW')) {
         $sImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => $aUser), $aUserInfo));
     } else {
         $sImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true, $aUser)), $aUserInfo));
     }
     $bIsInfo = false;
     if (isset($aUser['landing_page']) && $aUser['landing_page'] == 'info' && Phpfox_Request::instance()->get('req2') != 'wall' || Phpfox_Request::instance()->get('req2') == 'info') {
         $bIsInfo = true;
     }
     if (defined('PHPFOX_IS_PAGES_VIEW') && empty($aUser['vanity_url'])) {
         if (isset($aUser['landing_page']) && $aUser['landing_page'] == 'info' && Phpfox_Request::instance()->get('req3') != 'wall' || Phpfox_Request::instance()->get('req3') == 'info') {
             $bIsInfo = true;
         }
     }
     $this->template()->assign(array('aUser' => $aUser, 'sProfileImage' => $sImage, 'bIsInfo' => $bIsInfo, 'bCanPoke' => Phpfox::isModule('poke') && Phpfox::getService('poke')->canSendPoke($aUser['user_id'])));
 }
示例#2
0
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		$this->template()->assign(array(
				'sJanrainUrl' => (Phpfox::isModule('janrain') ? Phpfox::getService('janrain')->getUrl() : '')
			)
		);
	}
示例#3
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     if (!Phpfox::getUserParam('user.can_control_notification_privacy') && !Phpfox::getUserParam('user.can_control_profile_privacy')) {
         return Phpfox_Error::display(Phpfox::getPhrase('user.privacy_settings_have_been_disabled_for_your_user_group'));
     }
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('user.privacy.process')->update($aVals)) {
             $this->url()->send('user.privacy', null, Phpfox::getPhrase('user.privacy_settings_successfully_updated'));
         }
     }
     list($aUserPrivacy, $aNotifications, $aProfiles, $aItems) = Phpfox::getService('user.privacy')->get();
     $aUserInfo = Phpfox::getService('user')->get(Phpfox::getUserId());
     ($sPlugin = Phpfox_Plugin::get('user.component_controller_index_process')) ? eval($sPlugin) : false;
     $aMenus = array('profile' => Phpfox::getPhrase('user.profile'), 'items' => Phpfox::getPhrase('user.items'), 'notifications' => Phpfox::getPhrase('user.notifications'), 'blocked' => Phpfox::getPhrase('user.blocked_users'));
     if (!Phpfox::isModule('privacy')) {
         unset($aMenus['items']);
     }
     if (Phpfox::getUserParam('user.can_be_invisible')) {
         // $aMenus['invisible'] = Phpfox::getPhrase('user.invisible_mode');
     }
     $this->template()->buildPageMenu('js_privacy_block', $aMenus, array('no_header_border' => true, 'link' => $this->url()->makeUrl(Phpfox::getUserBy('user_name')), 'phrase' => Phpfox::getPhrase('user.view_your_profile')));
     if ($this->request()->get('view') == 'blocked') {
         $this->template()->assign(array('bGoToBlocked' => true));
     }
     $this->template()->setTitle(Phpfox::getPhrase('user.privacy_settings'))->setBreadcrumb('Account', $this->url()->makeUrl('profile'))->setBreadcrumb(Phpfox::getPhrase('user.privacy_settings'), $this->url()->makeUrl('user.privacy'), true)->setFullSite()->setHeader(array('privacy.css' => 'module_user'))->assign(array('aForms' => $aUserPrivacy['privacy'], 'aPrivacyNotifications' => $aNotifications, 'aProfiles' => $aProfiles, 'aUserPrivacy' => $aUserPrivacy, 'aBlockedUsers' => Phpfox::getService('user.block')->get(), 'aUserInfo' => $aUserInfo, 'aItems' => $aItems));
 }
示例#4
0
 /**
  * Controller
  */
 public function process()
 {
     if (Phpfox::isUser() && Phpfox::isModule('pages')) {
         list(, $pages) = Pages_Service_Pages::instance()->getMyLoginPages(0, 20);
         $this->template()->assign(['pages' => $pages]);
     }
 }
示例#5
0
	/**
	 * This function sends a poke to $iUser from Phpfox::getUserId()
	 * `status_id` tells if the poke has been seen:
	 *			1: not seen
	 *			2: seen
	 * 
	 * @param int $iUserId 
	 * @return boolean true if we added a poke.
	 */
	public function sendPoke($iUserId)
	{
		/* if the other user has not seen a poke then we do not add it */
		$iExists = $this->database()->select('poke_id')
				->from($this->_sTable)
				->where('user_id = ' . Phpfox::getUserId() . ' AND to_user_id = ' . (int)$iUserId . ' AND status_id = 1')
				->execute('getSlaveField');
		if ($iExists > 0)
		{
			return false;
		}
		$iPokeId = $this->database()->insert($this->_sTable, array(
			'user_id' => Phpfox::getUserId(),
			'to_user_id' => (int)$iUserId,
			'status_id' => 1
		));
		
		/* Ignore all pokes from $iUserId to us */
		$this->ignore($iUserId);
		
		if (Phpfox::getParam('poke.add_to_feed') && Phpfox::isModule('feed'))
		{
			Phpfox::getService('feed.process')->add('poke', $iPokeId);
		}
		
		return true;
	}
示例#6
0
 public function add($aVals, $bIsCustom = false, $aCallback = null)
 {
     if (!defined('PHPFOX_FORCE_IFRAME')) {
         define('PHPFOX_FORCE_IFRAME', true);
     }
     if (empty($aVals['privacy_comment'])) {
         $aVals['privacy_comment'] = 0;
     }
     if (empty($aVals['privacy'])) {
         $aVals['privacy'] = 0;
     }
     $iId = $this->database()->insert($this->_sTable, array('user_id' => Phpfox::getUserId(), 'is_custom' => $bIsCustom ? '1' : '0', 'module_id' => $aCallback === null ? null : $aCallback['module'], 'item_id' => $aCallback === null ? 0 : $aCallback['item_id'], 'parent_user_id' => isset($aVals['parent_user_id']) ? (int) $aVals['parent_user_id'] : 0, 'link' => $this->preParse()->clean($aVals['link']['url'], 255), 'image' => isset($aVals['link']['image_hide']) && $aVals['link']['image_hide'] == '1' || !isset($aVals['link']['image']) ? null : $this->preParse()->clean($aVals['link']['image'], 255), 'title' => isset($aVals['link']['title']) ? $this->preParse()->clean($aVals['link']['title'], 255) : '', 'description' => isset($aVals['link']['description']) ? $this->preParse()->clean($aVals['link']['description'], 200) : '', 'status_info' => empty($aVals['status_info']) ? null : $this->preParse()->prepare($aVals['status_info']), 'privacy' => (int) $aVals['privacy'], 'privacy_comment' => (int) $aVals['privacy_comment'], 'time_stamp' => PHPFOX_TIME, 'has_embed' => empty($aVals['link']['embed_code']) ? '0' : '1'));
     if (!empty($aVals['link']['embed_code'])) {
         $this->database()->insert(Phpfox::getT('link_embed'), array('link_id' => $iId, 'embed_code' => $this->preParse()->prepare($aVals['link']['embed_code'])));
     }
     if ($aCallback === null && isset($aVals['parent_user_id']) && $aVals['parent_user_id'] != Phpfox::getUserId()) {
         $aUser = $this->database()->select('user_name')->from(Phpfox::getT('user'))->where('user_id = ' . (int) $aVals['parent_user_id'])->execute('getRow');
         $sLink = Phpfox::getLib('url')->makeUrl($aUser['user_name'], array('plink-id' => $iId));
         Phpfox::getLib('mail')->to($aVals['parent_user_id'])->subject(array('link.full_name_posted_a_link_on_your_wall', array('full_name' => Phpfox::getUserBy('full_name'))))->message(array('link.full_name_posted_a_link_on_your_wall_message', array('full_name' => Phpfox::getUserBy('full_name'), 'link' => $sLink)))->notification('comment.add_new_comment')->send();
         if (Phpfox::isModule('notification')) {
             Phpfox::getService('notification.process')->add('feed_comment_link', $iId, $aVals['parent_user_id']);
         }
     }
     $this->_iLinkId = $iId;
     return $bIsCustom ? $iId : Phpfox::getService('feed.process')->callback($aCallback)->add('link', $iId, $aVals['privacy'], $aVals['privacy_comment'], isset($aVals['parent_user_id']) ? (int) $aVals['parent_user_id'] : 0);
 }
示例#7
0
 /** This function catches all the "actions" (Dislike, and in the future maybe others)
  * */
 public function getNotificationAction($aNotification)
 {
     //d($aNotification);die();
     // get the type of item that was marked ("blog", "photo"...)
     $aAction = $this->database()->select('*')->from(Phpfox::getT('action'))->where('action_id = ' . (int) $aNotification['item_id'])->limit(1)->execute('getSlaveRow');
     if (empty($aAction) || !isset($aAction['item_type_id'])) {
         return false;
         throw new Exception('No type for this action (' . print_r($aAction, true) . ')');
     }
     // Check if the module is a sub module
     if (preg_match('/(?P<module>[a-z]+)[_]?(?P<submodule>[a-z]{0,99})/i', $aAction['item_type_id'], $aMatch) < 1) {
         throw new Exception('Malformed item_type');
     }
     // Call the module and get the title
     if (!Phpfox::isModule($aMatch['module'])) {
         return false;
     }
     $aRow = Phpfox::getService($aMatch['module'])->getInfoForAction($aAction);
     $sUsers = Phpfox::getService('notification')->getUsers($aNotification);
     $sTitle = Phpfox::getLib('parse.output')->shorten($aRow['title'], Phpfox::getParam('notification.total_notification_title_length'), '...');
     $sPhrase = '';
     if ($aNotification['user_id'] == $aRow['user_id']) {
         // {users} disliked {gender} own {item} "{title}"
         $sPhrase = Phpfox::getPhrase('like.users_disliked_gender_own_item_title', array('users' => $sUsers, 'gender' => Phpfox::getService('user')->gender($aRow['gender'], 1), 'title' => $sTitle, 'item' => $aAction['item_type_id']));
     } elseif ($aRow['user_id'] == Phpfox::getUserId()) {
         // {users} liked your blog "{title}"
         $sPhrase = Phpfox::getPhrase('like.users_disliked_your_item_title', array('users' => $sUsers, 'title' => $sTitle, 'item' => $aAction['item_type_id']));
     } else {
         $sPhrase = Phpfox::getPhrase('like.users_disliked_users_item', array('users' => $sUsers, 'row_full_name' => $aRow['full_name'], 'title' => $sTitle, 'item' => $aAction['item_type_id']));
     }
     return array('link' => $aRow['link'], 'message' => $sPhrase, 'icon' => Phpfox_Template::instance()->getStyle('image', 'activity.png', 'blog'));
 }
示例#8
0
	/**
	 * Class process method which is used to execute this component.
	 */
	public function process()
	{
		if (!Phpfox::isModule('ad'))
		{
			return false;
		}	    
		
		if (defined('PHPFOX_IS_GROUP_VIEW'))
	    {
			return false;
	    }
	    
	    $aSponsorEvents = Phpfox::getService('event')->getRandomSponsored();
	    
	    if (empty($aSponsorEvents))
	    {
			return false;
	    }
	    
	    Phpfox::getService('ad.process')->addSponsorViewsCount($aSponsorEvents['sponsor_id'], 'event');
		
	    $this->template()->assign(array(
				'sHeader' => Phpfox::getPhrase('event.sponsored_event'),
				'aSponsorEvents' => $aSponsorEvents,
				'aFooter' => array(Phpfox::getPhrase('event.encourage_sponsor') => $this->url()->makeUrl('event', array('view' => 'my', 'sponsor' => 1)))
		    )
		);
		
	    return 'block';
	}
示例#9
0
 public function getQueryJoins($bIsCount = false, $bNoQueryFriend = false)
 {
     if (Phpfox::isModule('friend') && Phpfox::getService('friend')->queryJoin($bNoQueryFriend)) {
         $this->database()->join(Phpfox::getT('friend'), 'friends', 'friends.user_id = m.user_id AND friends.friend_user_id = ' . Phpfox::getUserId());
     }
     if ($this->_sCategory !== null) {
         $this->database()->innerJoin(Phpfox::getT('fevent_category_data'), 'mcd', 'mcd.fevent_id = m.fevent_id');
         if (!$bIsCount) {
             $this->database()->group('m.fevent_id');
         }
     }
     if ($this->_iAttending !== null) {
         $this->database()->innerJoin(Phpfox::getT('fevent_invite'), 'ei', 'ei.fevent_id = m.fevent_id AND ei.rsvp_id = ' . (int) $this->_iAttending . ' AND ei.invited_user_id = ' . Phpfox::getUserId());
         if (!$bIsCount) {
             $this->database()->select('ei.rsvp_id, ');
             $this->database()->group('m.fevent_id');
         }
     } else {
         if (Phpfox::isUser()) {
             $this->database()->leftJoin(Phpfox::getT('fevent_invite'), 'ei', 'ei.fevent_id = m.fevent_id AND ei.invited_user_id = ' . Phpfox::getUserId());
             if (!$bIsCount) {
                 $this->database()->select('ei.rsvp_id, ');
                 $this->database()->group('m.fevent_id');
             }
         }
     }
 }
示例#10
0
	public function query($sQuery, $iPage, $iTotalShow, $sView = null)
	{
		if ($sView !== null && Phpfox::isModule($sView))
		{
			$aModuleResults = Phpfox::callback($sView . '.globalUnionSearch', $this->preParse()->clean($sQuery));
		}
		else 
		{
			$aModuleResults = Phpfox::massCallback('globalUnionSearch', $this->preParse()->clean($sQuery));
		}
		
		$iOffset = ($iPage * $iTotalShow);
		
		$aRows = $this->database()->select('item.*, ' . Phpfox::getUserField())
				->unionFrom('item')		
				->join(Phpfox::getT('user'), 'u', 'u.user_id = item.item_user_id')
				->limit($iOffset, $iTotalShow)
				->order('item_time_stamp DESC')				
				->execute('getSlaveRows');

		$aResults = array();
		foreach ($aRows as $iKey => $aRow)
		{
			$aResults[] = array_merge($aRow, (array) Phpfox::callback($aRow['item_type_id'] . '.getSearchInfo', $aRow));
		}
		
		return $aResults;
	}
示例#11
0
	public function getQueryJoins($bIsCount = false, $bNoQueryFriend = false)
	{
		if (Phpfox::isModule('friend') && Phpfox::getService('friend')->queryJoin($bNoQueryFriend))
		{
			$this->database()->join(Phpfox::getT('friend'), 'friends', 'friends.user_id = q.user_id AND friends.friend_user_id = ' . Phpfox::getUserId());	
		}			
	}
示例#12
0
 /**
  * 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;
 }
示例#13
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if ($this->request()->get('req2') == 'view' && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle)) {
         Phpfox::getService('core')->getLegacyItem(array('field' => array('listing_id', 'title'), 'table' => 'marketplace', 'redirect' => 'marketplace', 'title' => $sLegacyTitle));
     }
     Phpfox::getUserParam('marketplace.can_access_marketplace', true);
     if (!($iListingId = $this->request()->get('req2'))) {
         $this->url()->send('marketplace');
     }
     if (!($aListing = Phpfox::getService('marketplace')->getListing($iListingId))) {
         return Phpfox_Error::display(Phpfox::getPhrase('marketplace.the_listing_you_are_looking_for_either_does_not_exist_or_has_been_removed'));
     }
     $this->setParam('aListing', $aListing);
     if (Phpfox::isUser() && $aListing['invite_id'] && !$aListing['visited_id'] && $aListing['user_id'] != Phpfox::getUserId()) {
         Phpfox::getService('marketplace.process')->setVisit($aListing['listing_id'], Phpfox::getUserId());
     }
     if (Phpfox::isUser() && Phpfox::isModule('notification')) {
         Phpfox::getService('notification.process')->delete('comment_marketplace', $this->request()->getInt('req2'), Phpfox::getUserId());
         Phpfox::getService('notification.process')->delete('marketplace_like', $this->request()->getInt('req2'), Phpfox::getUserId());
     }
     if (Phpfox::isModule('notification') && $aListing['user_id'] == Phpfox::getUserId()) {
         Phpfox::getService('notification.process')->delete('marketplace_approved', $aListing['listing_id'], Phpfox::getUserId());
     }
     Phpfox::getService('core.redirect')->check($aListing['title']);
     if (Phpfox::isModule('privacy')) {
         Phpfox::getService('privacy')->check('marketplace', $aListing['listing_id'], $aListing['user_id'], $aListing['privacy'], $aListing['is_friend']);
     }
     $this->setParam('aRatingCallback', array('type' => 'user', 'default_rating' => $aListing['total_score'], 'item_id' => $aListing['user_id'], 'stars' => range(1, 10)));
     $this->setParam('aFeed', array('comment_type_id' => 'marketplace', 'privacy' => $aListing['privacy'], 'comment_privacy' => $aListing['privacy_comment'], 'like_type_id' => 'marketplace', 'feed_is_liked' => $aListing['is_liked'], 'feed_is_friend' => $aListing['is_friend'], 'item_id' => $aListing['listing_id'], 'user_id' => $aListing['user_id'], 'total_comment' => $aListing['total_comment'], 'total_like' => $aListing['total_like'], 'feed_link' => $this->url()->permalink('marketplace', $aListing['listing_id'], $aListing['title']), 'feed_title' => $aListing['title'], 'feed_display' => 'view', 'feed_total_like' => $aListing['total_like'], 'report_module' => 'marketplace', 'report_phrase' => Phpfox::getPhrase('marketplace.report_this_listing_lowercase')));
     $this->template()->setTitle($aListing['title'] . ($aListing['view_id'] == '2' ? ' (' . Phpfox::getPhrase('marketplace.sold') . ')' : ''))->setBreadcrumb(Phpfox::getPhrase('marketplace.marketplace'), $this->url()->makeUrl('marketplace'))->setMeta('description', $aListing['description'])->setMeta('keywords', $this->template()->getKeywords($aListing['title'] . $aListing['description']))->setMeta('og:image', Phpfox::getLib('image.helper')->display(array('server_id' => $aListing['listing_id'], 'path' => 'marketplace.url_image', 'file' => $aListing['image_path'], 'suffix' => '_400', 'return_url' => true)))->setBreadcrumb($aListing['title'] . ($aListing['view_id'] == '2' ? ' (' . Phpfox::getPhrase('marketplace.sold') . ')' : ''), $this->url()->permalink('marketplace', $aListing['listing_id'], $aListing['title']), true)->setHeader('cache', array('jquery/plugin/star/jquery.rating.js' => 'static_script', 'jquery.rating.css' => 'style_css', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'comment.css' => 'style_css', 'pager.css' => 'style_css', 'switch_legend.js' => 'static_script', 'switch_menu.js' => 'static_script', 'view.js' => 'module_marketplace', 'view.css' => 'module_marketplace', 'pager.css' => 'style_css', 'feed.js' => 'module_feed'))->setEditor(array('load' => 'simple'))->assign(array('aListing' => $aListing, 'sMicroPropType' => 'Product'));
     if (Phpfox::isModule('rate')) {
         $this->template()->setPhrase(array('rate.thanks_for_rating'))->setHeader(array('rate.js' => 'module_rate', '<script type="text/javascript">$Behavior.rateMarketplaceUser = function() { $Core.rate.init({display: false}); }</script>'));
     }
     ($sPlugin = Phpfox_Plugin::get('marketplace.component_controller_view_process_end')) ? eval($sPlugin) : false;
 }
示例#14
0
 public function getValidation($sStep = null)
 {
     $aValidation = array();
     if ($sStep == 1 || $sStep === null) {
         $aValidation['full_name'] = Phpfox::getPhrase('user.provide_your_full_name');
         $aValidation['email'] = array('def' => 'email', 'title' => Phpfox::getPhrase('user.provide_a_valid_email_address'));
         $aValidation['password'] = array('def' => 'password', 'title' => Phpfox::getPhrase('user.provide_a_valid_password'));
         if (Phpfox::getParam('user.new_user_terms_confirmation')) {
             $aValidation['agree'] = array('def' => 'checkbox', 'title' => Phpfox::getPhrase('user.check_our_agreement_in_order_to_join_our_site'));
         }
         if (!Phpfox::getParam('user.profile_use_id') && !Phpfox::getParam('user.disable_username_on_sign_up')) {
             $aValidation['user_name'] = array('def' => 'username', 'title' => Phpfox::getPhrase('user.provide_a_valid_user_name', array('min' => Phpfox::getParam('user.min_length_for_username'), 'max' => Phpfox::getParam('user.max_length_for_username'))));
         }
     }
     if ($sStep == 2 || $sStep === null) {
         if (Phpfox::getParam('core.registration_enable_dob')) {
             $aValidation['month'] = Phpfox::getPhrase('user.select_month_of_birth');
             $aValidation['day'] = Phpfox::getPhrase('user.select_day_of_birth');
             $aValidation['year'] = Phpfox::getPhrase('user.select_year_of_birth');
         }
         if (Phpfox::getParam('core.registration_enable_location')) {
             $aValidation['country_iso'] = Phpfox::getPhrase('user.select_current_location');
         }
         if (Phpfox::getParam('core.registration_enable_gender')) {
             $aValidation['gender'] = Phpfox::getPhrase('user.select_your_gender');
         }
     }
     if (Phpfox::isModule('captcha') && Phpfox::getParam('user.captcha_on_signup') && $sStep === null) {
         $aValidation['image_verification'] = Phpfox::getPhrase('captcha.complete_captcha_challenge');
     }
     return $aValidation;
 }
示例#15
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     // assign the categories
     $this->template()->assign(array('aCategories' => Phpfox::getService('contact.contact')->getCategories()));
     // create the captcha check JS
     // they need to input some text always
     $aValidation = array('text' => Phpfox::getPhrase('contact.fill_in_some_text_for_your_message'), 'category_id' => Phpfox::getPhrase('contact.you_need_to_choose_a_category'), 'subject' => Phpfox::getPhrase('contact.provide_a_subject'), 'full_name' => Phpfox::getPhrase('contact.provide_your_full_name'));
     // do they need to complete a captcha challenge?
     if (Phpfox::isModule('captcha') && Phpfox::getParam('contact.contact_enable_captcha')) {
         $aValidation['image_verification'] = Phpfox::getPhrase('captcha.complete_captcha_challenge');
     }
     // They always need to input their email address
     $aValidation['email'] = array('def' => 'email', 'title' => Phpfox::getPhrase('contact.provide_a_valid_email'));
     $oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_contact_form', 'aParams' => $aValidation));
     // check if we're getting a request:
     if ($aVals = $this->request()->getArray('val')) {
         // check the fields are valid
         if ($oValid->isValid($aVals)) {
             if (Phpfox::getService('contact.contact')->sendContactMessage($aVals)) {
                 if (!empty($aVals['category_id']) && $aVals['category_id'] == 'phpfox_sales_ticket') {
                     $this->url()->send('contact', array('sent' => 'true'));
                 } else {
                     $this->url()->send('contact', null, Phpfox::getPhrase('contact.your_message_was_successfully_sent'));
                 }
             } else {
                 $this->template()->assign(array('aContactErrors' => Phpfox_Error::set(Phpfox::getPhrase('error.site_email_not_set'))));
             }
         }
     }
     if (Phpfox::isUser()) {
         $this->template()->assign(array('sFullName' => Phpfox::getUserBy('full_name'), 'sEmail' => Phpfox::getUserBy('email')));
     }
     $this->template()->setTitle(Phpfox::getPhrase('contact.contact_us'))->setBreadcrumb(Phpfox::getPhrase('contact.contact_us'))->assign(array('sCreateJs' => $oValid->createJs(), 'sGetJsForm' => $oValid->getJsForm(), 'bIsSent' => $this->request()->get('sent')))->setFullSite();
 }
示例#16
0
	public function getQueryJoins($bIsCount = false, $bNoQueryFriend = false)
	{
		if (Phpfox::isModule('friend') && Phpfox::getService('friend')->queryJoin($bNoQueryFriend))
		{
			$this->database()->join(Phpfox::getT('friend'), 'friends', 'friends.user_id = m.user_id AND friends.friend_user_id = ' . Phpfox::getUserId());	
		}		
		
		if ($this->_sTag != null)
		{
			$this->database()->innerJoin(Phpfox::getT('tag'), 'tag', 'tag.item_id = m.video_id AND tag.category_id = \''.(defined('PHPFOX_GROUP_VIEW') ? 'video_group' : 'video').'\'');
			if (!$bIsCount)
			{
				$this->database()->group('m.video_id');
			}			
		}

		if ($this->_sCategory !== null)
		{		
			$this->database()->innerJoin(Phpfox::getT('video_category_data'), 'mcd', 'mcd.video_id = m.video_id');
			if (!$bIsCount)
			{
				$this->database()->group('m.video_id');
			}
		}				
	}		
示例#17
0
 public function send($aVals)
 {
     Phpfox::isUser(true);
     $oFilter = Phpfox::getLib('parse.input');
     if (!is_numeric($aVals['interaction']) || !is_numeric($aVals['user_id'])) {
         return Phpfox_Error::set(Phpfox::getPhrase('interact.an_error_has_occured'));
     }
     if (!($iId = $this->database()->insert(Phpfox::getT('interactions_main'), array('sender_id' => Phpfox::getUserId(), 'recipient_id' => $aVals['user_id'], 'interaction_id' => $aVals['interaction'], 'message' => $aVals['text'] ? $oFilter->clean($aVals['text']) : '', 'time' => time(), 'is_reply' => $aVals['is_reply'], 'is_new' => 1)))) {
         return Phpfox_Error::set(Phpfox::getPhrase('interact.an_error_has_occured'));
     }
     if ($aVals['item_id'] != 0) {
         $this->database()->update(Phpfox::getT('interactions_main'), array('replied' => 1, 'is_new' => 0), 'id = ' . $aVals['item_id']);
     }
     if (Phpfox::isModule('notification')) {
         Phpfox::getService('notification.process')->add('interact', $iId, $aVals['user_id'], Phpfox::getUserId());
     }
     if (Phpfox::isModule('feed') && Phpfox::getParam('interact.add_interact_to_feed')) {
         $iFeedId = Phpfox::getService('feed.process')->add('interact', $iId, '', Phpfox::getUserId());
         if (Phpfox::getParam('interact.interact_friends_only')) {
             $this->database()->update(Phpfox::getT('feed'), array('privacy' => 1), 'feed_id = ' . $iFeedId);
         }
     }
     if (Phpfox::getParam('interact.send_email')) {
         $aInteractInfo = $this->database()->select('i.*, im.*, u.language_id')->from(Phpfox::getT('interactions_main'), 'im')->join(Phpfox::getT('interactions'), 'i', 'im.interaction_id = i.id')->join(Phpfox::getT('user'), 'u', 'im.recipient_id = u.user_id')->where('im.id = ' . $iId)->execute('getSlaveRow');
         $sInteraction = strtolower(Phpfox::getPhrase('interact.action_' . Phpfox::getService('language.phrase.process')->prepare(htmlspecialchars_decode($aInteractInfo['name'], ENT_QUOTES))));
         if ($aInteractInfo['message'] == '') {
             $sLink = Phpfox::getLib('url')->makeUrl('interact.inbox');
             Phpfox::getLib('mail')->to($aVals['user_id'])->subject(array('interact.full_name_interacted_with_you_on_site_title', array('full_name' => Phpfox::getUserBy('full_name'), 'site_title' => Phpfox::getParam('core.site_title')), false, null, $aInteractInfo['language_id']))->message(array('interact.full_name_interacted_with_you', array('full_name' => Phpfox::getUserBy('full_name'), 'interaction' => $sInteraction, 'message' => $oFilter->clean(strip_tags(Phpfox::getLib('parse.bbcode')->cleanCode(str_replace(array('&lt;', '&gt;'), array('<', '>'), $aInteractInfo['message'])))), 'link' => $sLink)))->notification('interact.interact_received')->send();
         } else {
             $sLink = Phpfox::getLib('url')->makeUrl('interact.inbox');
             Phpfox::getLib('mail')->to($aVals['user_id'])->subject(array('interact.full_name_interacted_with_you_on_site_title', array('full_name' => Phpfox::getUserBy('full_name'), 'site_title' => Phpfox::getParam('core.site_title')), false, null, $aInteractInfo['language_id']))->message(array('interact.full_name_interacted_with_you_message', array('full_name' => Phpfox::getUserBy('full_name'), 'interaction' => $sInteraction, 'message' => $oFilter->clean(strip_tags(Phpfox::getLib('parse.bbcode')->cleanCode(str_replace(array('&lt;', '&gt;'), array('<', '>'), $aInteractInfo['message'])))), 'link' => $sLink)))->notification('interact.interact_received')->send();
         }
     }
     return $iId;
 }
示例#18
0
 /**
  * Hides blocks by issuing a callback
  * @param type $sBlockId
  * @param type $sTypeId
  * @return type 
  */
 public function hideBlock($sBlockId, $sTypeId, $sController)
 {
     $sBlockId = str_replace('clone_', '', $sBlockId);
     $sBlockId = str_replace('js_block_border_', '', $sBlockId);
     $aParts = explode('_', $sBlockId);
     if (!Phpfox::isModule($aParts[0])) {
         return Phpfox_Error::set(Phpfox::getPhrase('core.module_is_not_a_valid_module', array('module' => $aParts[0])));
     }
     $sModule = $aParts[0];
     unset($aParts[0]);
     $sTable = 'user_design_order';
     if ($sController == 'core.index-member') {
         $sTable = 'user_dashboard';
     }
     $iHasEntry = $this->database()->select('COUNT(*)')->from(Phpfox::getT($sTable))->where('user_id = ' . Phpfox::getUserId())->execute('getSlaveField');
     if (!$iHasEntry) {
         $aBlocks = $this->database()->select('module_id, component, location, ordering')->from(Phpfox::getT('block'))->where('is_active = 1 && m_connection = "' . $sController . '" AND location IN (1,2,3)')->execute('getSlaveRows');
         foreach ($aBlocks as $aBlock) {
             $this->database()->insert(Phpfox::getT($sTable), array('user_id' => Phpfox::getUserId(), 'cache_id' => 'js_block_border_' . $aBlock['module_id'] . '_' . $aBlock['component'], 'block_id' => $aBlock['location'], 'ordering' => $aBlock['ordering'], 'is_hidden' => 0));
         }
     } else {
         $iCount = $this->database()->select('COUNT(*)')->from(Phpfox::getT($sTable))->where('user_id = ' . Phpfox::getUserId() . ' AND cache_id = \'js_block_border_' . $this->database()->escape($sBlockId) . '\'')->execute('getSlaveField');
         if (!$iCount) {
             $this->database()->insert(Phpfox::getT($sTable), array('user_id' => Phpfox::getUserId(), 'cache_id' => 'js_block_border_' . $sBlockId, 'block_id' => null));
         }
     }
     $this->database()->update(Phpfox::getT($sTable), array('is_hidden' => '1'), 'user_id = ' . Phpfox::getUserId() . ' AND cache_id = \'js_block_border_' . $this->database()->escape($sBlockId) . '\'');
 }
示例#19
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (defined('PHPFOX_IS_AD_PREVIEW')) {
         return false;
     }
     if (Phpfox::getUserBy('profile_page_id') > 0) {
         return false;
     }
     $oRequest = Phpfox::getLib('request');
     if ($this->template()->bIsSample || $oRequest->get('req2') == 'designer' || $oRequest->get('req2') == 'index-member' && $oRequest->get('req3') == 'customize') {
         return false;
     }
     if (!Phpfox::isModule('friend')) {
         return false;
     }
     $sLastOpenWindow = null;
     $sLastWindowParam = null;
     if ($sLastOpenWindow = Phpfox::getCookie('im_last_open_window')) {
         if (preg_match("/chat_(.*)/i", $sLastOpenWindow, $aMatches)) {
             $sLastOpenWindow = 'chat';
             $sLastWindowParam = (int) $aMatches[1];
         } elseif ($sLastOpenWindow == 'messenger') {
             $sLastOpenWindow = 'messenger';
         }
         Phpfox::setCookie('im_last_open_window', '', -1);
     }
     $iCnt = 0;
     if (Phpfox::getUserBy('im_hide') != '1') {
         $aCond = array('AND f.user_id = ' . Phpfox::getUserId() . ' AND u.im_hide != 1');
         list($iCnt, $aFriends) = Phpfox::getService('im')->getOnlineFriends(Phpfox::getUserId(), $aCond);
     }
     $this->template()->assign(array('iTotalFriendsOnline' => $iCnt, 'sLastOpenWindow' => $sLastOpenWindow, 'sLastWindowParam' => $sLastWindowParam));
 }
示例#20
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $aDeny = array('forum', 'profile');
     //Plugin call
     if ($sPlugin = Phpfox_Plugin::get('user.block_login-block_process__start')) {
         eval($sPlugin);
     }
     // If we are logged in lets not display the login block
     if (Phpfox::isUser()) {
         return false;
     }
     if (in_array(Phpfox::getLib('module')->getModuleName(), $aDeny)) {
         return false;
     }
     if (Phpfox::getLib('url')->isUrl(array('user/login', 'user/register', 'profile', 'user/password/request', 'forum'))) {
         return false;
     }
     $aFooter = array();
     if (Phpfox::getParam('user.allow_user_registration')) {
         $aFooter[Phpfox::getPhrase('user.sign')] = $this->url()->makeUrl('user.register');
     }
     $aFooter[Phpfox::getPhrase('user.forgot_password')] = $this->url()->makeUrl('user.password.request');
     // Assign the needed vars for the template
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('user.log'), 'aFooter' => $aFooter, 'sJanrainUrl' => Phpfox::isModule('janrain') ? Phpfox::getService('janrain')->getUrl() : ''));
     //Plugin call
     if ($sPlugin = Phpfox_Plugin::get('user.block_login-block_process__end')) {
         eval($sPlugin);
     }
     return 'block';
 }
示例#21
0
 public function process()
 {
     if (Phpfox::getService('language.process')->useLanguage($this->get('id'))) {
         Phpfox::addMessage(Phpfox::getPhrase('language.successfully_updated_your_language_preferences'));
         $sReturn = Phpfox::getLib('session')->get('redirect');
         if (is_bool($sReturn)) {
             $sReturn = '';
         }
         if ($sReturn) {
             $aParts = explode('/', trim($sReturn, '/'));
             if (isset($aParts[0])) {
                 $aParts[0] = Phpfox_Url::instance()->reverseRewrite($aParts[0]);
             }
             if (isset($aParts[0]) && !Phpfox::isModule($aParts[0])) {
                 $aUserCheck = Phpfox::getService('user')->getByUserName($aParts[0]);
                 if (isset($aUserCheck['user_id'])) {
                     if (isset($aParts[1]) && !Phpfox::isModule($aParts[1])) {
                         $sReturn = '';
                     }
                 } else {
                     $sReturn = '';
                 }
             }
         }
         $sReturn = trim($sReturn, '/');
         $this->call('window.location.href = window.location.href;');
         // . Phpfox_Url::instance()->makeUrl($sReturn) . '\';');
     }
 }
示例#22
0
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		if (!defined('PHPFOX_IS_USER_PROFILE'))
		{
			return false;
		}
		
		$aUser = $this->getParam('aUser');

		$aUserInfo = array(
			'title' => $aUser['full_name'],
			'path' => 'core.url_user',
			'file' => $aUser['user_image'],
			'suffix' => '_75_square',
			'max_width' => 75,
			'max_height' => 75,
			'no_default' => (Phpfox::getUserId() == $aUser['user_id'] ? false : true),
			'thickbox' => true,
        	'class' => 'profile_user_image'
		);			
		
		$sImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true, $aUser)), $aUserInfo));	

		$this->template()->assign(array(
				'sProfileImage' => $sImage,
				'bIsInfo' => (Phpfox::getLib('request')->get('req2') == 'info' ? true : false),
				'bCanPoke' => Phpfox::isModule('poke') && Phpfox::getService('poke')->canSendPoke($aUser['user_id'])
			)
		);		
	}
示例#23
0
 /**
  * Controller
  */
 public function process()
 {
     if ($iDeleteId = $this->request()->getInt('delete')) {
         if (Phpfox::getService('admincp.block.process')->delete($iDeleteId)) {
             $this->url()->send('admincp.block', null, Phpfox::getPhrase('admincp.successfully_deleted'));
         }
     }
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('admincp.block.process')->updateOrder($aVals)) {
             $this->url()->send('admincp.block');
         }
     }
     $aBlocks = array();
     $aRows = Admincp_Service_Block_Block::instance()->get();
     foreach ($aRows as $iKey => $aRow) {
         if (!Phpfox::isModule($aRow['module_id'])) {
             continue;
         }
         if ($aRow['m_connection'] == 'admincp.index') {
             continue;
         }
         $aBlocks[$aRow['m_connection']][$aRow['location']][] = $aRow;
     }
     // d($aBlocks); exit;
     ksort($aBlocks);
     $this->template()->setSectionTitle('Blocks')->setActionMenu(['Add Block' => ['class' => 'popup', 'url' => $this->url()->makeUrl('admincp.block.add')]])->setBreadCrumb(Phpfox::getPhrase('admincp.block_manager'))->setTitle(Phpfox::getPhrase('admincp.block_manager'))->setHeader('cache', array('template.css' => 'style_css', 'drag.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script'))->assign(array('aBlocks' => $aBlocks));
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     header('Content-Type: text/json');
     $oServiceAccountapi = Phpfox::getService('accountapi');
     // get username password from url
     $sAppId = $oServiceAccountapi->getReq(3);
     $sUsername = $oServiceAccountapi->getReq(4);
     $sPassword = $oServiceAccountapi->getReq(5);
     // if fail to get
     // -> get from $_POST
     if (empty($sAppId) && empty($sUsername) && empty($sPassword)) {
         if (isset($_POST['email'])) {
             $sUsername = $_POST['email'];
         }
         if (isset($_POST['password'])) {
             $sPassword = $_POST['password'];
         }
     }
     if (!is_int($sAppId)) {
         $sPassword = $sUsername;
         $sUsername = $sAppId;
         $sAppId = Phpfox::getParam('accountapi.app_id');
     }
     if (empty($sUsername)) {
         $sUsername = $this->request()->get('email');
         $sPassword = $this->request()->get('password');
     }
     if (!$sAppId || !$sUsername || !$sPassword) {
         echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.missing_parameters')));
         exit;
     }
     $aUser = Phpfox::getService('accountapi')->getUserByEmailOrUsername($sUsername);
     if (!$aUser || !is_array($aUser)) {
         echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.username_invalid')));
         exit;
     }
     if (Phpfox::isModule('semigrator') && strlen($aUser['password_salt']) > 3) {
         if ($aUser['password'] !== Phpfox::getService('semigrator.se.user')->setHash($sPassword, $aUser['password_salt'])) {
             echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.password_invalid')));
             exit;
         }
     } else {
         if ($aUser['password'] !== Phpfox::getLib('hash')->setHash($sPassword, $aUser['password_salt'])) {
             echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.password_invalid')));
             exit;
         }
     }
     if (isset($aUser['status_id']) && $aUser['status_id'] == 1 && Phpfox::getParam('user.verify_email_at_signup')) {
         echo json_encode(array('status' => 'error', 'message' => strip_tags(Phpfox::getPhrase('user.you_need_to_verify_your_email_address_before_logging_in', array('email' => $aUser['email'])))));
         exit;
     }
     $aKey = Phpfox::getService('accountapi.user')->checkKey($sAppId, $aUser);
     if (!$aKey) {
         exit;
     }
     ($sPlugin = Phpfox_Plugin::get('accountapi.component_controller_checkkey_get_json_value')) ? eval($sPlugin) : false;
     echo json_encode($aKey);
     exit;
 }
示例#25
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $bIsPages = defined('PHPFOX_IS_PAGES_VIEW') && Phpfox::isModule('pages') ? true : false;
     $bIsOrganization = defined('PHPFOX_IS_ORGANIZATION_VIEW') && Phpfox::isModule('organization') ? true : false;
     if ($bIsOrganization) {
         return false;
     }
     /*        if($bIsOrganization)
               return false;*/
     // Used in the template to set the ajax call
     $sModule = 'user';
     $aUser = $this->getParam('aUser');
     if (empty($aUser) && $bIsPages) {
         $aUser = $this->getParam('aPage');
     }
     if (empty($aUser) && $bIsOrganization) {
         $aUser = $this->getParam('aOrganization');
     }
     if ($bIsPages && !defined('loadedLogo') && isset($aUser['cover_photo_id'])) {
         $aUser['cover_photo'] = $aUser['cover_photo_id'];
         $aUser['cover_photo_top'] = isset($aUser['cover_photo_position']) ? $aUser['cover_photo_position'] : 0;
         $this->template()->assign(array('sLogoPosition' => $aUser['cover_photo_top']));
         $sModule = 'pages';
         define('loadedLogo', true);
     } else {
         if ($bIsOrganization && !defined('loadedLogo') && isset($aUser['cover_photo_id'])) {
             $aUser['cover_photo'] = $aUser['cover_photo_id'];
             $aUser['cover_photo_top'] = isset($aUser['cover_photo_position']) ? $aUser['cover_photo_position'] : 0;
             $this->template()->assign(array('sLogoPosition' => $aUser['cover_photo_top']));
             $sModule = 'organization';
             define('loadedLogo', true);
         } else {
             if (!defined('PHPFOX_IS_USER_PROFILE')) {
                 return false;
             }
         }
     }
     $this->template()->assign(array('sAjaxModule' => $sModule));
     if (empty($aUser['cover_photo'])) {
         return false;
     }
     $aCoverPhoto = Phpfox::getService('photo')->getCoverPhoto($aUser['cover_photo']);
     if (!isset($aCoverPhoto['photo_id'])) {
         return false;
     }
     if (!$bIsOrganization && !$bIsPages && !Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.view_profile')) {
         return false;
     }
     $sPagesUrl = '';
     if ($bIsPages) {
         $aPage = $this->getParam('aPage');
         $this->template()->assign('sPagesLink', $aPage['link']);
     }
     if ($bIsOrganization) {
         $aOrganization = $this->getParam('aOrganization');
         $this->template()->assign('sOrganizationLink', $aOrganization['link']);
     }
     $this->template()->assign(array('aCoverPhoto' => $aCoverPhoto, 'bRefreshPhoto' => $this->request()->getInt('coverupdate') ? true : false, 'bNewCoverPhoto' => $this->request()->getInt('newcoverphoto') ? true : false, 'sLogoPosition' => $aUser['cover_photo_top'], 'bIsPages' => $bIsPages, 'bIsOrganization' => $bIsOrganization));
 }
 public function process()
 {
     if (!Phpfox::isModule('messenger') || !Phpfox::isUser()) {
         return false;
     }
     $aUser = Phpfox::getUserBy();
     $this->template()->assign(array('aOwner' => $aUser));
 }
示例#27
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $sModuleFormTitle = $this->getParam('module_form_title', Phpfox::getPhrase('admincp.module'));
     if (preg_match('/([a-zA-Z]+)\\.([a-zA-Z]+)/i', $sModuleFormTitle, $aMatches) && isset($aMatches[2]) && Phpfox::isModule($aMatches[1])) {
         $sModuleFormTitle = Phpfox::getPhrase($sModuleFormTitle);
     }
     $this->template()->assign(array('aModules' => Phpfox::getService('admincp.module')->getModules(), 'bUseClass' => $this->getParam('class'), 'sModuleFormTitle' => $sModuleFormTitle, 'bModuleFormRequired' => $this->getParam('module_form_required', true), 'sModuleFormValue' => $this->getParam('module_form_value', Phpfox::getPhrase('admincp.select') . ':'), 'sModuleFormId' => $this->getParam('module_form_id', 'module_id')));
 }
示例#28
0
 /**
  * Controller
  */
 public function process()
 {
     if (($sId = $this->request()->get('item_number')) != '') {
         $this->url()->send('friend.invoice', array(), Phpfox::getPhrase('egift.thank_you_for_your_purchase'));
     }
     $aInvoices = Phpfox::isModule('egif') ? Phpfox::getService('egift')->getSentEcards(Phpfox::getUserId()) : array();
     $this->template()->setTitle(Phpfox::getPhrase('friend.invoices'))->setBreadcrumb(Phpfox::getPhrase('friend.friend'), $this->url()->makeUrl('friend'))->setBreadcrumb(Phpfox::getPhrase('friend.invoices'), null, true)->setHeader('cache', array('table.css' => 'style_css'))->assign(array('aInvoices' => $aInvoices));
 }
示例#29
0
 /**
  * Controller
  */
 public function process()
 {
     list($aGroups, $aModules, $aProductGroups) = Phpfox::getService('admincp.setting.group')->get();
     $aCond = array();
     $aUrl = array();
     $sSettingTitle = '';
     if ($sSettingId = $this->request()->get('setting-id')) {
         $aCond[] = " AND setting.setting_id = " . (int) $sSettingId;
         $aUrl = array('setting', 'edit', 'setting-id' => $sSettingId);
     }
     if ($sGroupId = $this->request()->get('group-id')) {
         $aCond[] = " AND setting.group_id = '" . Phpfox_Database::instance()->escape($sGroupId) . "' AND setting.is_hidden = 0 ";
         $aUrl = array('setting', 'edit', 'group-id' => $sGroupId);
         foreach ($aGroups as $aGroup) {
             if ($aGroup['group_id'] == $sGroupId) {
                 $sSettingTitle = $aGroup['var_name'];
                 break;
             }
         }
     }
     if ($iModuleId = $this->request()->get('module-id')) {
         $aCond[] = " AND setting.module_id = '" . Phpfox_Database::instance()->escape($iModuleId) . "' AND setting.is_hidden = 0 ";
         $aUrl = array('setting', 'edit', 'module-id' => $iModuleId);
         foreach ($aModules as $aModule) {
             if ($aModule['module_id'] == $iModuleId) {
                 $sSettingTitle = $aModule['module_id'];
                 break;
             }
         }
     }
     if ($sProductId = $this->request()->get('product-id')) {
         $aCond[] = " AND setting.product_id = '" . Phpfox_Database::instance()->escape($sProductId) . "' AND setting.is_hidden = 0 ";
         $aUrl = array('setting', 'edit', 'product-id' => $sProductId);
         foreach ($aProductGroups as $aProduct) {
             if ($aProduct['product_id'] == $sProductId) {
                 $sSettingTitle = $aProduct['var_name'];
                 break;
             }
         }
     }
     $aSettings = Phpfox::getService('admincp.setting')->get($aCond);
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('admincp.setting.process')->update($aVals)) {
             // $this->url()->send('admincp', $aUrl, Phpfox::getPhrase('admincp.updated'));
             return ['updated' => true];
         }
     }
     $sWatermarkImage = Phpfox::getParam('core.url_watermark') . sprintf(Phpfox::getParam('core.watermark_image'), '') . '?v=' . uniqid();
     if (!file_exists(Phpfox::getParam('core.dir_watermark') . sprintf(Phpfox::getParam('core.watermark_image'), '')) && Phpfox::getParam('core.allow_cdn')) {
         $sWatermarkImage = Phpfox::getLib('cdn')->getUrl(str_replace(PHPFOX_DIR, '', $sWatermarkImage));
     }
     if (Phpfox::isModule($sSettingTitle)) {
         $sSettingTitle = Phpfox_Locale::instance()->translate($sSettingTitle, 'module');
     }
     $this->template()->setSectionTitle($sSettingTitle);
     $this->template()->setBreadCrumb(Phpfox::getPhrase('admincp.manage_settings'), $this->url()->makeUrl('admincp.setting'))->setBreadCrumb(Phpfox::getPhraseT($sSettingTitle, 'module'), null, true)->setTitle(Phpfox::getPhrase('admincp.manage_settings'))->assign(array('aGroups' => $aGroups, 'aModules' => $aModules, 'aProductGroups' => $aProductGroups, 'aSettings' => $aSettings, 'sSettingTitle' => $sSettingTitle, 'sWatermarkImage' => $sWatermarkImage));
     ($sPlugin = Phpfox_Plugin::get('admincp.component_controller_setting_edit_process')) ? eval($sPlugin) : false;
 }
示例#30
0
 public function process()
 {
     Phpfox::isUser(true);
     // get the request for just one message
     $iId = (int) $this->request()->get('id');
     $aMessages = Friend_Service_Friend::instance()->getBirthdayMessages(Phpfox::getUserId(), $iId);
     $this->template()->assign(array('aMessages' => $aMessages))->setBreadcrumb(Phpfox::getPhrase('friend.my_friends'), $this->url()->makeUrl('friend'))->setBreadCrumb(Phpfox::getPhrase('friend.birthday_e_cards'), $this->url()->makeUrl('friend.mybirthday'), true)->setTitle(Phpfox::getPhrase('friend.birthday_e_cards'));
     Phpfox::isModule('notification') ? Phpfox::getService('notification.process')->delete('friend_birthday', $iId, Phpfox::getUserId()) : null;
 }