Exemple #1
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::isUser(true);
     if (Phpfox::getService('favorite.process')->add($this->request()->get('type'), $this->request()->get('id'))) {
         Phpfox::getLib('ajax')->call('<script type="text/javascript">$(\'#js_footer_bar_favorite_content\').html(\'<!-- EMPTY_FOOTER_BAR -->\');</script>');
     }
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if ($aVals = $this->request()->getArray('val')) {
         Phpfox::isUser(true);
         Phpfox::getUserParam('comment.can_post_comments', true);
         if (($iFlood = Phpfox::getUserParam('comment.comment_post_flood_control')) !== 0) {
             $aFlood = array('action' => 'last_post', 'params' => array('field' => 'time_stamp', 'table' => Phpfox::getT('comment'), 'condition' => 'type_id = \'' . Phpfox::getLib('database')->escape($aVals['type']) . '\' AND user_id = ' . Phpfox::getUserId(), 'time_stamp' => $iFlood * 60));
             // actually check if flooding
             if (Phpfox::getLib('spam')->check($aFlood)) {
                 Phpfox_Error::set(Phpfox::getPhrase('comment.posting_a_comment_a_little_too_soon_total_time', array('total_time' => Phpfox::getLib('spam')->getWaitTime())));
             }
         }
         if (Phpfox::getLib('parse.format')->isEmpty($aVals['text'])) {
             Phpfox_Error::set(Phpfox::getPhrase('feed.add_some_text_to_your_comment'));
         }
         if (Phpfox_Error::isPassed() && ($iId = Phpfox::getService('comment.process')->add($aVals))) {
             $this->url()->send('feed.view', array('id' => $this->request()->getInt('id')), Phpfox::getPhrase('feed.successfully_added_your_comment'));
         }
     }
     if ($iLikeType = $this->request()->getInt('liketype')) {
         if (Phpfox::getService('feed.process')->like($this->request()->getInt('id'), $iLikeType)) {
             $this->url()->send('feed.view', array('id' => $this->request()->getInt('id')), $iLikeType == '1' ? Phpfox::getPhrase('feed.successfully_liked_this_feed') : Phpfox::getPhrase('feed.successfully_unliked_this_feed'));
         }
     }
     list($iFeedCount, $aFeeds) = Phpfox::getService('feed')->get(null, $this->request()->getInt('id'), 1);
     $iCommentCnt = 0;
     $aComments = array();
     if (Phpfox::getParam('feed.allow_comments_on_feeds')) {
         list($iCommentCnt, $aComments) = Phpfox::getService('comment')->get('cmt.*', array("AND cmt.type_id = 'feed'", 'AND cmt.item_id = ' . (int) $aFeeds[0]['feed_id'], 'AND cmt.view_id = 0'), 'cmt.time_stamp ASC');
     }
     if (!count($aFeeds)) {
         return Phpfox_Error::display(Phpfox::getPhrase('feed.not_a_valid_feed'));
     }
     $this->template()->setMobileHeader(array('feed.css' => 'module_feed'))->assign(array('iFeedId' => $aFeeds[0]['feed_id'], 'aFeeds' => $aFeeds, 'aComments' => $aComments));
 }
Exemple #3
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::isUser(true);
     $sMessage = Phpfox::getPhrase('share.hi_check_this_out_bbcode', array('url' => $this->request()->get('url')));
     $sMessage = str_replace("\n", "", $sMessage);
     $this->template()->assign(array('sTitle' => $this->request()->get('title'), 'sMessage' => $sMessage));
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     define('PHPFOX_DONT_SAVE_PAGE', true);
     if (Phpfox::isUser()) {
         $this->url()->send('profile');
     }
     switch (Phpfox::getParam('user.login_type')) {
         case 'user_name':
             $aValidation['login'] = Phpfox::getPhrase('user.provide_your_user_name');
             break;
         case 'email':
             $aValidation['login'] = Phpfox::getPhrase('user.provide_your_email');
             break;
         default:
             $aValidation['login'] = Phpfox::getPhrase('user.provide_your_user_name_email');
     }
     $aValidation['password'] = Phpfox::getPhrase('user.provide_your_password');
     $oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_login_form', 'aParams' => $aValidation));
     if ($aVals = $this->request()->getArray('val')) {
         if ($oValid->isValid($aVals)) {
             list($bLogged, $aUser) = Phpfox::getService('user.auth')->login($aVals['login'], $aVals['password'], isset($aVals['remember_me']) ? true : false, Phpfox::getParam('user.login_type'));
             if ($bLogged) {
                 $this->url()->send('');
             }
         }
     }
 }
Exemple #5
0
 /**
  * Controller
  */
 public function process()
 {
     $this->url()->send('music');
     Phpfox::isUser(true);
     if (Phpfox::getParam('music.music_user_group_id') == Phpfox::getUserBy('user_group_id')) {
         $this->url()->send('music');
     }
     $aUser = array('full_name' => Phpfox::getUserBy('full_name'));
     $aSettings = Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), Phpfox::getUserId(), Phpfox::getParam('music.music_user_group_id'));
     $aParams = array('full_name' => Phpfox::getPhrase('music.provide_a_artist_band_name'), 'agree' => Phpfox::getPhrase('music.tick_the_box_to_agree_to_our_terms_and_privacy_policy'));
     foreach ($aSettings as $sKey => $aSetting) {
         if ($aSetting['is_required']) {
             $aParams['custom_field_' . $aSetting['field_id']] = array('title' => Phpfox::getPhrase('music.provide_a_value_for') . ': ' . Phpfox::getPhrase($aSetting['phrase_var_name']), 'def' => 'required', 'php_id' => 'custom[' . $aSetting['field_id'] . ']');
         }
     }
     $oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aParams));
     if ($aVals = $this->request()->getArray('val')) {
         if ($oValid->isValid($aVals)) {
             if (Music_Service_Process::instance()->convertMember($aVals, $this->request()->getArray('custom'))) {
                 $this->url()->send('music', null, Phpfox::getPhrase('music.you_have_successfully_converted_your_account'));
             }
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('music.musician_registration'))->setBreadcrumb(Phpfox::getPhrase('music.music'), $this->url()->makeUrl('music'))->setBreadcrumb(Phpfox::getPhrase('music.registration'), null, true)->setFullSite()->assign(array('aForms' => $aUser, 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(), 'aSettings' => $aSettings));
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::isUser(true);
     if (Phpfox::getUserBy('profile_page_id')) {
         Phpfox::getService('pages')->setIsInPage();
     }
     if (!($aAlbum = Phpfox::getService('photo.album')->getForEdit($this->request()->getInt('id')))) {
         return Phpfox_Error::display(Phpfox::getPhrase('photo.photo_album_not_found'));
     }
     if ($aVals = $this->request()->getArray('val')) {
         if ($this->request()->get('req3') == 'photo') {
             if (Phpfox::getService('photo.process')->massProcess($aAlbum, $aVals)) {
                 $this->url()->send('photo.edit-album.photo', array('id' => $aAlbum['album_id']), Phpfox::getPhrase('photo.photo_s_successfully_updated'));
             }
         } else {
             if (Phpfox::getService('photo.album.process')->update($aAlbum['album_id'], $aVals)) {
                 $this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name'], true, Phpfox::getPhrase('photo.album_successfully_updated'));
             }
         }
     }
     $aMenus = array('detail' => Phpfox::getPhrase('photo.album_info'), 'photo' => Phpfox::getPhrase('photo.photos'));
     $this->template()->buildPageMenu('js_photo_block', $aMenus, array('link' => $this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name']), 'phrase' => Phpfox::getPhrase('photo.view_this_album_uppercase')));
     list($iCnt, $aPhotos) = Phpfox::getService('photo')->get('p.album_id = ' . (int) $aAlbum['album_id']);
     list($iAlbumCnt, $aAlbums) = Phpfox::getService('photo.album')->get('pa.user_id = ' . Phpfox::getUserId());
     $this->template()->setTitle(Phpfox::getPhrase('photo.editing_album') . ': ' . $aAlbum['name'])->setFullSite()->setBreadcrumb(Phpfox::getPhrase('photo.photo'), $this->url()->makeUrl('photo'))->setBreadcrumb(Phpfox::getPhrase('photo.editing_album') . ': ' . $aAlbum['name'], $this->url()->makeUrl('photo.edit-album', array('id' => $aAlbum['album_id'])), true)->setHeader(array('edit.css' => 'module_photo', 'photo.js' => 'module_photo'))->assign(array('aForms' => $aAlbum, 'aPhotos' => $aPhotos, 'aAlbums' => $aAlbums));
 }
Exemple #7
0
	public function query()
	{
		if (Phpfox::isUser() && Phpfox::isModule('like'))
		{
			$this->database()->select('lik.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \'quiz\' AND lik.item_id = q.quiz_id AND lik.user_id = ' . Phpfox::getUserId());
		}			
	}
Exemple #8
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     // http://www.phpfox.com/tracker/view/15093/
     $bIsThickBox = $this->getParam('bIsThickBox');
     $this->template()->assign(array('bIsThickBox' => $bIsThickBox));
     if ($this->request()->getInt('purchase_id')) {
         if (!($aPackage = Phpfox::getService('subscribe.purchase')->getInvoice($this->request()->getInt('purchase_id'), true))) {
             return Phpfox_Error::set(Phpfox::getPhrase('subscribe.unable_to_find_the_purchase_you_are_looking_for'));
         }
         $iPurchaseId = $aPackage['purchase_id'];
     } else {
         if (!($aPackage = Phpfox::getService('subscribe')->getPackage($this->request()->getInt('id')))) {
             return Phpfox_Error::set(Phpfox::getPhrase('subscribe.unable_to_find_the_package_you_are_looking_for'));
         }
         if (Phpfox::getUserBy('user_group_id') == $aPackage['user_group_id']) {
             return Phpfox_Error::set(Phpfox::getPhrase('subscribe.attempting_to_upgrade_to_the_same_user_group_you_are_already_in'));
         }
         $aPackage['default_currency_id'] = isset($aPackage['default_currency_id']) ? $aPackage['default_currency_id'] : $aPackage['price'][0]['alternative_currency_id'];
         $aPackage['default_cost'] = isset($aPackage['default_cost']) ? $aPackage['default_cost'] : $aPackage['price'][0]['alternative_cost'];
         $iPurchaseId = Phpfox::getService('subscribe.purchase.process')->add(array('package_id' => $aPackage['package_id'], 'currency_id' => $aPackage['default_currency_id'], 'price' => $aPackage['default_cost']));
         /* Make sure we mark it as free only if the default cost is free and its not a recurring charge */
         if ($aPackage['default_cost'] == '0.00' && $aPackage['recurring_period'] == 0) {
             $this->template()->assign('bIsFree', true);
             $this->template()->assign('iPurchaseId', $iPurchaseId);
             Phpfox::getService('subscribe.purchase.process')->update($iPurchaseId, $aPackage['package_id'], 'completed', Phpfox::getUserId(), $aPackage['user_group_id'], $aPackage['fail_user_group']);
             return;
         }
     }
     /* Load the gateway only if its not free */
     if (($aPackage['default_cost'] != '0.00' || $aPackage['recurring_period'] != 0) && $iPurchaseId) {
         $this->setParam('gateway_data', array('item_number' => 'subscribe|' . $iPurchaseId, 'currency_code' => $aPackage['default_currency_id'], 'amount' => $aPackage['default_cost'], 'item_name' => $aPackage['title'], 'return' => $this->url()->makeUrl('subscribe.complete'), 'recurring' => $aPackage['recurring_period'], 'recurring_cost' => isset($aPackage['default_recurring_cost']) ? $aPackage['default_recurring_cost'] : '', 'alternative_cost' => isset($aPackage['price'][0]) ? serialize($aPackage['price']) : '', 'alternative_recurring_cost' => isset($aPackage['recurring_price'][0]) ? serialize($aPackage['recurring_price']) : ''));
     }
 }
Exemple #9
0
 public function query()
 {
     $this->database()->select('blog_text.text_parsed AS text, ')->join(Phpfox::getT('blog_text'), 'blog_text', 'blog_text.blog_id = blog.blog_id');
     if (Phpfox::isUser() && Phpfox::isModule('like')) {
         $this->database()->select('lik.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \'blog\' AND lik.item_id = blog.blog_id AND lik.user_id = ' . Phpfox::getUserId());
     }
 }
Exemple #10
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     if ($iInvite = $this->request()->getInt('del')) {
         $bDel = Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
         if ($bDel) {
             $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
         }
         $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
     } elseif ($aInvite = $this->request()->get('val')) {
         $bDel = true;
         foreach ($aInvite as $iInvite) {
             $bDel = $bDel && Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
         }
         if ($bDel) {
             $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
         }
         $this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
     }
     $iPage = $this->request()->getInt('page');
     $iPageSize = (int) Phpfox::getParam('invite.pendings_to_show_per_page');
     list($iCnt, $aInvites) = Phpfox::getService('invite')->get(Phpfox::getUserId(), $iPage, $iPageSize);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->setParam('global_moderation', array('name' => 'invitations', 'ajax' => 'invite.moderation', 'menu' => array(array('phrase' => 'Delete', 'action' => 'delete'))));
     $this->template()->setTitle(Phpfox::getPhrase('invite.pending_invitations'))->setBreadcrumb(Phpfox::getPhrase('invite.pending_invitations'))->assign(array('aInvites' => $aInvites, 'iPage' => $iPage))->setHeader('cache', array('pager.css' => 'style_css', 'pending.js' => 'module_invite'));
 }
Exemple #11
0
 /**
  * Controller
  */
 public function process()
 {
     if (!defined('PHPFOX_IS_USER_PROFILE') && !Phpfox::isUser()) {
         return false;
     }
     $aUser = $this->getParam('aUser');
     $iTotal = (int) Phpfox::getComponentSetting(defined('PHPFOX_IS_USER_PROFILE') ? $aUser['user_id'] : Phpfox::getUserId(), 'friend.friend_display_limit_profile', Phpfox::getParam('friend.friend_display_limit'));
     $aTopFriends = Friend_Service_Friend::instance()->getTop(defined('PHPFOX_IS_USER_PROFILE') ? $aUser['user_id'] : Phpfox::getUserId(), $iTotal);
     $iCount = count($aTopFriends);
     if (defined('PHPFOX_IS_USER_PROFILE') && !$iCount) {
         return false;
     }
     $this->template()->assign(array('aTopFriends' => $aTopFriends));
     if (defined('PHPFOX_IS_USER_PROFILE')) {
         $this->template()->assign(array('bMoveCursor' => false));
     } else {
         $this->template()->assign(array('bMoveCursor' => true));
     }
     if (!$this->getParam('bIsAjax')) {
         $this->template()->assign(array('sHeader' => Phpfox::getPhrase('friend.top_friends'), 'sBlockJsId' => 'top_friends'));
         $bCanEditSettings = false;
         if (defined('PHPFOX_IS_USER_PROFILE')) {
             if ($aUser['user_id'] == Phpfox::getUserId()) {
                 // $bCanEditSettings = true;
             }
             $bCanEditSettings = false;
         } else {
             $bCanEditSettings = true;
         }
         if ($bCanEditSettings) {
             $this->template()->assign(array('aEditBar' => array('ajax_call' => 'friend.getEditBar', 'params' => '&amp;type_id=profile&amp;no_delete_link=true&amp;is_edit_top=true')));
         }
         return 'block';
     }
 }
Exemple #12
0
 /**
  * Controller
  */
 public function process()
 {
     $this->template()->assign(array('iStatus' => Phpfox::getUserBy('status_id')));
     if (Phpfox::isUser()) {
         $this->url()->send($this->url()->makeUrl(''));
     }
 }
Exemple #13
0
 public function insert()
 {
     Phpfox::isUser(true);
     if (Phpfox::getService('report.data.process')->add($this->get('report'), $this->get('type'), $this->get('id'), $this->get('feedback'))) {
         // $this->call('tb_remove();');
     }
 }
Exemple #14
0
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		if (!Phpfox::isUser())
		{
			exit;
		}		
		
		$aImage = Phpfox::getLib('file')->load('image', array('jpg', 'gif', 'png'));
			
		if ($aImage === false)
		{
			echo '<script type="text/javascript">window.parent().$(\'#js_image_error\').show();</script>';
			exit;
		}			
		
		$aParts = explode('x', $this->request()->get('ad_size'));		
		
		if ($sFileName = Phpfox::getLib('file')->upload('image', Phpfox::getParam('ad.dir_image'), Phpfox::getUserId() . uniqid()))
		{
			Phpfox::getLib('image')->createThumbnail(Phpfox::getParam('ad.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('ad.dir_image') . sprintf($sFileName, '_thumb'), ($aParts[0] / 3), ($aParts[1] - 20));
			
			unlink(Phpfox::getParam('ad.dir_image') . sprintf($sFileName, ''));
			rename(Phpfox::getParam('ad.dir_image') . sprintf($sFileName, '_thumb'), Phpfox::getParam('ad.dir_image') . sprintf($sFileName, ''));
			
			echo '<script type="text/javascript">window.parent.$(\'.js_ad_image\').html(\'<a href="#ad-link"><img src="' . Phpfox::getParam('ad.url_image') . sprintf($sFileName, '') . '" alt="" /></a>\').show(); window.parent.$(\'#js_image_holder_message\').hide(); window.parent.$(\'#js_image_holder_link\').show(); window.parent.$(\'#js_image_id\').val(\'' . sprintf($sFileName, '') . '\');</script>';
		}
		
		exit;
	}
Exemple #15
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     exit('Use AJAX method');
     Phpfox::isUser(true);
     if (!($iId = $this->request()->get('id'))) {
         return Phpfox_Error::display(Phpfox::getPhrase('video.id_must_be_defined'));
     }
     echo '<script type="text/javascript">';
     if (Phpfox::getService('video.convert')->process($iId)) {
         if ($this->request()->get('video-inline') == '1') {
             $iFeedId = Phpfox::getService('feed.process')->getLastId();
             echo 'window.parent.$.ajaxCall(\'video.displayFeed\', \'id=' . $iFeedId . '&video_id=' . $iId . '\', \'GET\');';
         } elseif ($this->request()->get('isajax')) {
             echo 'window.parent.Editor.insert({type: \'video\', id: \'' . (int) $iId . '\', editor_id: \'' . base64_decode($this->request()->get('editor-id')) . '\'});';
         } else {
             $aVideo = Phpfox::getService('video')->getForEdit($iId);
             echo 'window.parent.location.href = \'' . Phpfox::permalink('video', $aVideo['video_id'], $aVideo['title']) . '\';';
         }
     } else {
         Phpfox::getService('video.process')->delete($iId);
         echo 'window.parent.document.getElementById(\'js_video_upload_error\').style.display = \'block\';';
         echo 'window.parent.document.getElementById(\'js_video_upload_message\').innerHTML = \'' . implode('<br />', Phpfox_Error::get()) . '\';';
         echo 'window.parent.document.getElementById(\'js_upload_inner_form\').style.display = \'block\';';
         echo 'window.parent.document.getElementById(\'js_video_detail\').style.display = \'none\';';
         echo 'window.parent.document.getElementById(\'js_video_process\').style.display = \'none\';';
     }
     echo '</script>';
     exit;
 }
 public function check()
 {
     if (!Phpfox::getParam('user.check_promotion_system')) {
         return false;
     }
     if (!Phpfox::isUser()) {
         return false;
     }
     $sCacheId = $this->cache()->set('promotion_' . Phpfox::getUserBy('user_group_id'));
     $aPromotion = array();
     if (!($aPromotion = $this->cache()->get($sCacheId))) {
         $aPromotion = $this->database()->select('*')->from($this->_sTable)->where('user_group_id = ' . Phpfox::getUserBy('user_group_id'))->execute('getSlaveRow');
         $this->cache()->save($sCacheId, $aPromotion);
     }
     if (isset($aPromotion['promotion_id'])) {
         if ((int) Phpfox::getUserBy('activity_points') >= (int) $aPromotion['total_activity'] && (int) $aPromotion['total_activity']) {
             $this->database()->update(Phpfox::getT('user'), array('user_group_id' => $aPromotion['upgrade_user_group_id']), 'user_id = ' . Phpfox::getUserId());
             Phpfox_Url::instance()->send('user.promotion');
         } else {
             if ((int) $aPromotion['total_day'] > 0) {
                 if (str_replace('-', '', Phpfox::getUserBy('joined') - PHPFOX_TIME) >= $aPromotion['total_day'] * 86400) {
                     $this->database()->update(Phpfox::getT('user'), array('user_group_id' => $aPromotion['upgrade_user_group_id']), 'user_id = ' . Phpfox::getUserId());
                     Phpfox_Url::instance()->send('user.promotion');
                 }
             }
         }
     }
 }
Exemple #17
0
 public function updateActivity($iId, $iType)
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('admincp.has_admin_access', true);
     $this->database()->update($this->_sTable, array('is_active' => (int) ($iType == '1' ? 1 : 0)), 'stat_id = ' . (int) $iId);
     $this->cache()->remove('stat', 'substr');
 }
Exemple #18
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::isUser(true);
     $sView = $this->request()->get('view');
     $aCond = array();
     switch ($sView) {
         case 'pending':
             $aCond[] = 'AND s.is_custom = 2';
             // pending approval
             break;
         case 'payment':
             $aCond[] = 'AND s.is_custom = 0';
             break;
         case 'denied':
             $aCond[] = 'AND s.is_custom = 4';
             break;
         default:
             $aCond[] = 'AND s.is_custom = 3';
             break;
     }
     $aCond[] = 'AND s.user_id = ' . Phpfox::getUserId();
     Phpfox::getService('ad')->getSectionMenu();
     $aAds = Phpfox::getService('ad')->getSponsorForUser($aCond);
     $this->template()->setTitle(Phpfox::getPhrase('ad.ad_management'))->setFullSite()->setBreadcrumb(Phpfox::getPhrase('ad.advertise'), $this->url()->makeUrl('ad'))->setBreadcrumb(Phpfox::getPhrase('ad.sponsorships'), $this->url()->makeUrl('ad.manage-sponsor'), true)->setHeader(array('table.css' => 'style_css', 'manage.js' => 'module_ad'))->assign(array('aAds' => $aAds, 'sView' => $sView));
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if ($sPlugin = Phpfox_Plugin::get('core.component_controller_index_member_start')) {
         eval($sPlugin);
     }
     Phpfox::isUser(true);
     if ($this->request()->get('req3') == 'customize') {
         define('PHPFOX_IN_DESIGN_MODE', true);
         define('PHPFOX_CAN_MOVE_BLOCKS', true);
         if ($iTestStyle = $this->request()->get('test_style_id')) {
             if (Phpfox::getLib('template')->testStyle($iTestStyle)) {
             }
         }
         $aDesigner = array('current_style_id' => Phpfox::getUserBy('style_id'), 'design_header' => Phpfox::getPhrase('core.customize_dashboard'), 'current_page' => $this->url()->makeUrl(''), 'design_page' => $this->url()->makeUrl('core.index-member', 'customize'), 'block' => 'core.index-member', 'item_id' => Phpfox::getUserId(), 'type_id' => 'user');
         $this->setParam('aDesigner', $aDesigner);
         $this->template()->setPhrase(array('theme.are_you_sure'))->setHeader('cache', array('style.css' => 'style_css', 'video.css' => 'module_video', 'design.js' => 'module_theme', 'select.js' => 'module_theme'));
         if (Phpfox::getParam('profile.can_drag_drop_blocks_on_profile')) {
             $this->template()->setHeader('cache', array('jquery/ui.js' => 'static_script', 'sort.js' => 'module_theme'))->setHeader(array('<script type="text/javascript">$Behavior.core_controller_member_designonupdate = function() { function designOnUpdate() { $Core.design.updateSorting(); } };</script>', '<script type="text/javascript">$Behavior.core_controller_init = function() { $Core.design.init({type_id: \'user\'}); };</script>'));
         }
     } else {
         // $this->template()->setHeader('jquery/ui.js', 'static_script');
         $this->template()->setHeader('cache', array('sort.js' => 'module_theme', 'design.js' => 'module_theme', 'video.css' => 'module_video'))->setHeader(array());
     }
     if (Phpfox::getParam('video.convert_servers_enable')) {
         $this->template()->setHeader('<script type="text/javascript">document.domain = "' . Phpfox::getParam('video.convert_js_parent') . '";</script>');
     }
     Phpfox::getLib('module')->setCacheBlockData(array('table' => 'user_dashboard', 'field' => 'user_id', 'item_id' => Phpfox::getUserId(), 'controller' => 'core.index-member'));
     $this->template()->setHeader('cache', array('feed.js' => 'module_feed', 'welcome.css' => 'style_css', 'announcement.css' => 'style_css', 'comment.css' => 'style_css', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'player/flowplayer/flowplayer.js' => 'static_script'))->setEditor(array('load' => 'simple'));
 }
Exemple #20
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('share.can_send_emails', true);
     $sText = Phpfox::getPhrase('share.hi_check_this_out_url', array('url' => $this->request()->get('url'), 'full_name' => Phpfox::getUserBy('full_name'), 'user_name' => Phpfox::getUserBy('user_name'), 'email' => Phpfox::getUserBy('email'), 'user_id' => Phpfox::getUserBy('user_id')));
     $this->template()->assign(array('sTitle' => $this->request()->get('title'), 'sMessage' => str_replace("\n", "", $sText), 'iEmailLimit' => Phpfox::getUserParam('share.total_emails_per_round'), 'bCanSendEmails' => Phpfox::getService('share')->canSendEmails()));
 }
 /**
  * Controller
  */
 public function process()
 {
     $sCountryChildValue = $this->getParam('country_child_value');
     $mCountryChildFilter = $this->getParam('country_child_filter', $this->request()->get('country_child_filter', null));
     $sCountryChildType = $this->getParam('country_child_type', null);
     $sCountryChildId = null;
     if (empty($sCountryChildValue) && Phpfox::isUser() && $mCountryChildFilter === null && !$this->getParam('country_not_user')) {
         $sCountryChildValue = Phpfox::getUserBy('country_iso');
     }
     $iSearchId = 0;
     if ($mCountryChildFilter !== null) {
         $iSearchId = $this->request()->get('search-id');
         if (!empty($iSearchId) && isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country'])) {
             $sCountryChildValue = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country'];
         }
         if (isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country_child_id'])) {
             $sCountryChildId = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country_child_id'];
         }
     }
     /* Last resort, get is a little heavy but controller didnt provide a child country*/
     if ($sCountryChildId == null && $this->getParam('country_child_id') == null) {
         $aUser = Phpfox::getService('user')->get(Phpfox::getUserId(), true);
         $sCountryChildId = $aUser['country_child_id'];
     }
     $this->template()->assign(array('aCountryChildren' => Phpfox::getService('core.country')->getChildren($sCountryChildValue), 'iCountryChildId' => (int) $this->getParam('country_child_id', $sCountryChildId), 'bForceDiv' => $this->getParam('country_force_div', false), 'mCountryChildFilter' => $mCountryChildFilter));
 }
Exemple #22
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));
 }
Exemple #23
0
 public function query()
 {
     $this->database()->select('pd.background, pd.percentage, pd.border, pr.answer_id, pr.user_id as voted, friends2.friend_id AS is_friend, ')->leftjoin(Phpfox::getT('poll_design'), 'pd', 'pd.poll_id = poll.poll_id')->leftjoin(Phpfox::getT('poll_result'), 'pr', 'pr.poll_id = poll.poll_id AND pr.user_id = ' . Phpfox::getUserId())->leftJoin(Phpfox::getT('friend'), 'friends2', 'friends2.user_id = poll.user_id AND friends2.friend_user_id = ' . Phpfox::getUserId());
     if (Phpfox::isUser() && Phpfox::isModule('like')) {
         $this->database()->select('lik.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \'poll\' AND lik.item_id = poll.poll_id AND lik.user_id = ' . Phpfox::getUserId());
     }
 }
 /**
  * Controller
  */
 public function process()
 {
     if (Phpfox::isUser()) {
         list(, $pages) = Pages_Service_Pages::instance()->getMyLoginPages(0, 20);
         $this->template()->assign(['pages' => $pages]);
     }
 }
Exemple #25
0
 public function process()
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('profiles.is_enabled', true);
     if ($sName = $this->request()->get('req3')) {
         $aExtraProfile = Phpfox::getService('profiles')->getProfile($sName);
     }
     if (count($aExtraProfile) == 0) {
         return Phpfox::getLib('module')->setController('error.404');
     }
     if (Phpfox::getUserId() != $aExtraProfile['user_id']) {
         Phpfox::getUserParam('profiles.can_edit_others', true);
         if (($aUser = Phpfox::getService('user')->getUser($aExtraProfile['user_id'], 'u.user_group_id')) && isset($aUser['user_group_id'])) {
             $iUserGroupId = $aUser['user_group_id'];
         }
     } else {
         $iUserGroupId = Phpfox::getUserBy('user_group_id');
     }
     $bIsEdit = false;
     if ($iId = $this->request()->getInt('id', false)) {
         $iUserGroupId = $iId;
         if ($aVals = $this->request()->getArray('custom') && !empty($aVals)) {
             $bIsEdit = true;
             if (Phpfox::getService('profiles.process')->updateFields($aExtraProfile['extra_id'], $aExtraProfile['user_id'], $aVals)) {
                 $this->url()->send('profiles.' . $aExtraProfile['title_url'], null, Phpfox::getPhrase('profiles.successfully_updated_name_profile', array('extra_name' => $aExtraProfile['title'])));
             }
         }
     }
     $aCustomFields = Phpfox::getService('profiles')->getFields(array('extra_main', 'extra_panel', 'extra_side'), $aExtraProfile['extra_id'], $iUserGroupId);
     $this->template()->setTitle(Phpfox::getPhrase('profiles.edit_extra_profiles'))->setBreadcrumb($aExtraProfile['title']);
     $this->template()->setHeader(array('custom.js' => 'module_profiles'))->assign(array('aExtraProfile' => $aExtraProfile, 'aSettings' => $aCustomFields, 'bIsEdit' => $bIsEdit));
 }
Exemple #26
0
 /**
  * Process the controller
  *
  */
 public function process()
 {
     if (Phpfox::isUser()) {
         $this->url()->send('');
     }
     if ($sRequest = $this->request()->get('id')) {
         if ($aVals = $this->request()->getArray('val')) {
             if (!isset($aVals['newpassword']) || !isset($aVals['newpassword2']) || $aVals['newpassword'] != $aVals['newpassword2']) {
                 Phpfox_Error::set(Phpfox::getPhrase('user.your_confirmed_password_does_not_match_your_new_password'));
             } else {
                 if (Phpfox::getService('user.password')->updatePassword($sRequest, $aVals)) {
                     $this->url()->send('user.password.verify', null, Phpfox::getPhrase('user.password_successfully_updated'));
                 }
             }
         }
         if (Phpfox::getParam('user.shorter_password_reset_routine')) {
             if (Phpfox::getService('user.password')->isValidRequest($sRequest) == true) {
                 $this->template()->assign(array('sRequest' => $sRequest));
             } else {
             }
         } else {
             if (Phpfox::getService('user.password')->verifyRequest($sRequest)) {
                 $this->url()->send('user.password.verify', null, Phpfox::getPhrase('user.new_password_successfully_sent_check_your_email_to_use_your_new_password'));
             }
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('user.password_request_verification'))->setBreadcrumb(Phpfox::getPhrase('user.password_request_verification'));
 }
Exemple #27
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();
 }
Exemple #28
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     $sView = $this->request()->get('view');
     $aCond = array();
     switch ($sView) {
         case 'pending':
             $aCond[] = 'AND a.is_custom = 2';
             break;
         case 'payment':
             $aCond[] = 'AND a.is_custom = 1';
             break;
         case 'denied':
             $aCond[] = 'AND a.is_custom = 4';
             break;
         default:
             $aCond[] = 'AND a.is_custom = 3';
             break;
     }
     $aCond[] = 'AND a.user_id = ' . Phpfox::getUserId();
     if (Phpfox::getParam('ad.multi_ad')) {
         $aCond[] = ' AND a.location = 50';
     }
     $aAds = Ad_Service_Ad::instance()->getForUser($aCond);
     Ad_Service_Ad::instance()->getSectionMenu();
     $this->template()->setTitle(Phpfox::getPhrase('ad.ad_management'))->setFullSite()->setBreadcrumb(Phpfox::getPhrase('ad.advertise'), $this->url()->makeUrl('ad'))->setBreadcrumb(Phpfox::getPhrase('ad.advertise'), $this->url()->makeUrl('ad.manage'), true)->setHeader(array('table.css' => 'style_css', 'manage.js' => 'module_ad'))->assign(array('aAllAds' => $aAds, 'sView' => $sView, 'bNewPurchase' => $this->request()->get('payment')));
 }
Exemple #29
0
 /**
  * Need this to take over photo moderation
  * Enter description here ...
  */
 public function moderation()
 {
     Phpfox::isUser(true);
     switch ($this->get('action')) {
         case 'approve':
             Phpfox::getUserParam('photo.can_approve_photos', true);
             foreach ((array) $this->get('item_moderate') as $iId) {
                 Phpfox::getService('photo.process')->approve($iId);
                 $this->call('$(\'#js_photo_id_' . $iId . '\').remove();');
             }
             $sMessage = Phpfox::getPhrase('photo.photo_s_successfully_approved');
             $this->alert($sMessage, 'Moderation', 300, 150, true);
             break;
         case 'delete':
             Phpfox::getUserParam('photo.can_delete_other_photos', true);
             $item = $this->get('item_moderate')[0];
             $bReload = Phpfox::getService('profiles')->getUserAndProfile($item);
             if ($bReload) {
                 $this->call('location.reload();');
             }
             foreach ((array) $this->get('item_moderate') as $iId) {
                 Phpfox::getService('photo.process')->delete($iId);
                 $this->call('$(\'#js_photo_id_' . $iId . '\').remove();');
             }
             $sMessage = Phpfox::getPhrase('photo.photo_s_successfully_deleted');
             break;
     }
     $this->updateCount();
     $this->hide('.moderation_process');
 }
Exemple #30
0
 public function updateActivity($iId, $iType)
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('admincp.has_admin_access', true);
     $this->database()->update($this->_sTable, array('is_active' => (int) ($iType == '1' ? 1 : 0)), 'currency_id = \'' . $this->database()->escape($iId) . '\'');
     $this->cache()->remove('currency');
 }