/** * Controller */ public function process() { $this->template()->assign(array('iStatus' => Phpfox::getUserBy('status_id'))); if (Phpfox::isUser()) { $this->url()->send($this->url()->makeUrl('')); } }
/** * 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']) : '')); } }
/** * Class process method wnich is used to execute this component. */ public function process() { if (Phpfox::getUserBy('profile_page_id')) { return false; } if (!Phpfox::isUser()) { return false; } $iTotal = 20; list($iCnt, $aRows) = Phpfox::getService('friend')->get('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId(), 'ls.last_activity DESC', 0, $iTotal, true, false, true); $this->template()->assign(array( 'sHeader' => '' . Phpfox::getPhrase('friend.friends_online') . ' (' . $iCnt . ')', 'aFriends' => $aRows ) ); if (Phpfox::getUserParam('friend.can_remove_friends_from_dashboard')) { //$this->template()->assign('sDeleteBlock', 'dashboard'); } return 'block'; }
/** * Controller */ public function process() { Phpfox::isUser(true); Phpfox::getUserParam('core.can_gift_points', true); $aUser = Phpfox::getService('user')->get($this->getParam('user_id'), true); $this->template()->assign(array('aUser' => $aUser, 'iCurrentAvailable' => Phpfox::getUserBy('activity_points'), 'iTrgUserId' => $this->getParam('user_id'))); }
/** * 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)); }
public function process() { define('PHPFOX_FEED_STREAM_MODE', true); if ($val = $this->request()->get('val')) { Phpfox::isUser(true); // if (isset($aVals['user_status']) && ($iId = Phpfox::getService('user.process')->updateStatus($aVals))) $val['user_status'] = $val['content']; $id = Phpfox::getService('user.process')->updateStatus($val); Feed_Service_Feed::instance()->processAjax($id); echo Phpfox_Ajax::instance()->getData(); exit; } $aFeedCallback = []; if ($module = $this->request()->get('module')) { $aFeedCallback = ['module' => $this->request()->get('module'), 'table_prefix' => $this->request()->get('module') . '_', 'item_id' => $this->request()->get('item_id')]; } $aFeed = Feed_Service_Feed::instance()->callback($aFeedCallback)->get(null, $this->request()->get('id')); header('Content-type: application/javascript'); if (!isset($aFeed[0])) { echo ';__(' . json_encode(['url' => $this->url()->makeUrl('feed.stream', ['id' => $this->request()->get('id')]), 'content' => false]) . ');'; exit; } $this->template()->assign('aGlobalUser', Phpfox::isUser() ? Phpfox::getUserBy(null) : array()); $this->template()->assign('aFeed', $aFeed[0]); $url = $this->url()->makeUrl('feed.stream', ['id' => $this->request()->get('id')]); if ($aFeedCallback) { $this->template()->assign('aFeedCallback', $aFeedCallback); $url = $this->url()->makeUrl('feed.stream', ['id' => $this->request()->get('id'), 'module' => $this->request()->get('module'), 'item_id' => $this->request()->get('item_id')]); } $this->template()->getTemplate('feed.block.entry'); echo ';__(' . json_encode(['url' => $url, 'content' => ob_get_clean()]) . ');'; exit; }
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('<', '>'), 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('<', '>'), array('<', '>'), $aInteractInfo['message'])))), 'link' => $sLink)))->notification('interact.interact_received')->send(); } } return $iId; }
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'); } } } } }
public function render($name, array $params = array()) { $params['ActiveUser'] = (new \Api\User())->get(\Phpfox::getUserBy()); $params['isPager'] = isset($_GET['page']) ? true : false; $params['Is'] = new \Core\Is(); return $this->loadTemplate($name)->render($params); }
/** * 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)); }
public function process() { $iLogId = Phpfox::getUserId(); $aUser = $this->getParam('aUser'); $iUserId = $aUser['user_id']; if ($iLogId == $iUserId || !Phpfox::isUser()) { return false; } if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'interact.can_interact')) { return false; } if (Phpfox::getParam('interact.interact_friends_only')) { if (!Phpfox::getService('friend')->isFriend($aUser['user_id'], Phpfox::getUserId())) { return false; } } $aInteractions = Phpfox::getService('interact.manage')->getInteractions(); $aUserGroups = Phpfox::getService('user.group')->get(); foreach ($aUserGroups as $aKey => $aUserGroup) { if ($aUserGroups[$aKey]['user_group_id'] == 3 || $aUserGroups[$aKey]['user_group_id'] == 5) { unset($aUserGroups[$aKey]); } } $this->template()->assign(array('aUserGroups' => $aUserGroups, 'iUserGroupId' => Phpfox::getUserBy('user_group_id'), 'aInteractions' => $aInteractions, 'iLogId' => $iLogId, 'iUserId' => $iUserId, 'sHeader' => Phpfox::getPhrase('interact.interact'))); return 'block'; }
/** * Class process method wnich is used to execute this component. */ public function process() { if (Phpfox::isUser()) { $aGroup = Phpfox::getService('user.group')->getGroup(Phpfox::getUserBy('user_group_id')); } $this->template()->assign(array('aPurchases' => Phpfox::isUser() ? Phpfox::getService('subscribe.purchase')->get(Phpfox::getUserId(), 5) : array(), 'aPackages' => Phpfox::getService('subscribe')->getPackages(Phpfox::isUser() ? false : true, Phpfox::isUser() ? true : false), 'aGroup' => Phpfox::isUser() ? $aGroup : array(), 'bIsOnSignup' => $this->getParam('on_signup') ? true : false)); }
/** * Class process method wnich is used to execute this component. */ public function process() { // If the user is not a member don't display this block if (!Phpfox::isUser()) { return false; } $sUserProfileImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true)), array( 'path' => 'core.url_user', 'file' => Phpfox::getUserBy('user_image'), 'suffix' => '_50_square', 'max_width' => 50, 'max_height' => 50 ) ) ); // Assign template vars $this->template()->assign(array( 'sUserProfileImage' => $sUserProfileImage, 'sUserProfileUrl' => $this->url()->makeUrl('profile', Phpfox::getUserBy('user_name')), // Create the users profile URL 'sCurrentUserName' => Phpfox::getLib('parse.output')->shorten(Phpfox::getLib('parse.output')->clean(Phpfox::getUserBy('full_name')), 50, '...'), // Get the users display name 'sCurrentTimeStamp' => Phpfox::getTime(Phpfox::getParam('core.global_welcome_time_stamp'), PHPFOX_TIME), // Get the current time stamp 'iTotalActivityPoints' => (int) Phpfox::getUserBy('activity_points'), 'iTotalProfileViews' => (int) Phpfox::getUserBy('total_view') ) ); }
public function sendEmails($iThreadId, $iPostId = null) { $aUsers = $this->database()->select('fs.user_id, ft.forum_id, ft.group_id, ft.title, ft.title_url, f.name AS forum_name, f.name_url AS forum_url') ->from($this->_sTable, 'fs') ->join(Phpfox::getT('forum_thread'), 'ft', 'ft.thread_id = fs.thread_id') ->leftJoin(Phpfox::getT('forum'), 'f', 'f.forum_id = ft.forum_id') ->where('fs.thread_id = ' . (int) $iThreadId) ->execute('getSlaveRows'); if (count($aUsers)) { $sLink = Phpfox::getLib('url')->makeUrl('forum.thread', array('predirect' => $iPostId)); foreach ($aUsers as $aUser) { Phpfox::getService('notification.process')->add('forum_subscribed_post', $iPostId, $aUser['user_id']); Phpfox::getLib('mail')->to($aUser['user_id']) ->subject(array('forum.reply_to_thread_title', array('title' => $aUser['title']))) ->message(array('forum.full_name_has_just_replied_to_the_thread_title', array('full_name' => Phpfox::getUserBy('full_name'), 'title' => $aUser['title'], 'link' => $sLink))) ->notification('forum.subscribe_new_post') ->send(); } } }
/** * Class process method wnich is used to execute this component. */ public function process() { ($sPlugin = Phpfox_Plugin::get('friend.component_block_mini_process')) ? eval($sPlugin) : false; if (isset($bHideThisBlock)) { return false; } if (Phpfox::getUserBy('profile_page_id')) { return false; } if (!Phpfox::isUser()) { return false; } $iTotal = 20; if (Phpfox::getParam('friend.load_friends_online_ajax') && !PHPFOX_IS_AJAX) { $aRows = array(); $iCnt = 0; } else { list($iCnt, $aRows) = Phpfox::getService('friend')->get('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId(), 'ls.last_activity DESC', 0, $iTotal, true, false, true); } $this->template()->assign(array('sHeader' => '' . Phpfox::getPhrase('friend.friends_online') . ' (<span id="js_total_block_friends_onlin">' . $iCnt . '</span>)', 'aFriends' => $aRows, 'iTotalFriendsOnline' => $iCnt)); if (Phpfox::getUserParam('friend.can_remove_friends_from_dashboard')) { //$this->template()->assign('sDeleteBlock', 'dashboard'); } return 'block'; }
/** * Class process method wnich is used to execute this component. */ public function process() { if (Phpfox::getUserBy('profile_page_id') > 0) { return false; } if ($iVideoId = $this->request()->getInt('video_id')) { list($iCnt, $aVideos) = Phpfox::getService('video')->getRelatedVideos($iVideoId, $this->request()->get('video_title'), $this->request()->getInt('page_number') + 1); if (!count($aVideos)) { return false; } Phpfox::getLib('pager')->set(array('page' => $this->request()->getInt('page_number'), 'size' => Phpfox::getParam('video.total_related_videos'), 'count' => $iCnt)); if (Phpfox::getLib('pager')->getLastPage() <= $this->request()->getInt('page_number')) { return false; } $this->template()->assign(array('aRelatedVideos' => $aVideos, 'bIsLoadingMore' => true)); } else { $aVideo = $this->getParam('aVideo'); list($iCnt, $aVideos) = Phpfox::getService('video')->getRelatedVideos($aVideo['video_id'], $aVideo['title'], 1, true); if (!count($aVideos)) { return false; } $this->template()->assign(array('sHeader' => Phpfox::getPhrase('video.suggestions'), 'aRelatedVideos' => $aVideos)); Phpfox::getLib('pager')->set(array('page' => $this->request()->getInt('page_number'), 'size' => Phpfox::getParam('video.total_related_videos'), 'count' => $iCnt)); if ($iCnt >= Phpfox::getParam('video.total_related_videos')) { $this->template()->assign(array('aFooter' => array(Phpfox::getPhrase('video.load_more_suggestions') => '#'))); } return 'block'; } }
public function process() { if (!Phpfox::getUserId()) { $this->url()->send('user.login'); } if ($this->request()->get('del_submit')) { $iType = $this->request()->get('delete_time'); Phpfox::getService('interact.interactions')->massDelete($iType); $this->url()->send('current'); } $oTpl = $this->template(); $oDb = Phpfox::getLib('phpfox.database'); $oReq = $this->request(); $iPage = $oReq->getInt('page', 1); $iLimit = Phpfox::getParam('interact.interact_entries_per_page'); $aModActions = array(); $aModActions[] = array('phrase' => Phpfox::getPhrase('interact.delete'), 'action' => 'delete'); $aModeration = array('name' => 'interact', 'ajax' => 'interact.moderation', 'menu' => $aModActions); $this->setParam('global_moderation', $aModeration); list($iCnt, $aInteractions) = Phpfox::getService('interact.interactions')->getInbox(Phpfox::getUserId(), $iPage, $iLimit); foreach ($aInteractions as $aKey => $aInteraction) { Phpfox::getService('notification.process')->delete('interact', $aInteraction['id'], Phpfox::getUserId()); Phpfox::getService('interact.interactions')->toggleRead($aInteraction['id'], true); } $bShowMass = Phpfox::getService('interact.interactions')->getOldest(); Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt)); $aActions = Phpfox::getService('interact.manage')->getInteractions(); $aUserGroups = Phpfox::getService('user.group')->get(); foreach ($aUserGroups as $aKey => $aUserGroup) { if ($aUserGroups[$aKey]['user_group_id'] == 3 || $aUserGroups[$aKey]['user_group_id'] == 5) { unset($aUserGroups[$aKey]); } } $oTpl->setTitle(Phpfox::getPhrase('interact.interactions'))->setBreadcrumb(Phpfox::getPhrase('interact.interactions'))->assign(array('bShowMass' => $bShowMass, 'aUserGroups' => $aUserGroups, 'iUserGroupId' => Phpfox::getUserBy('user_group_id'), 'iCnt' => $iCnt, 'aInteractions' => $aInteractions, 'aActions' => $aActions, 'bIsSentbox' => false))->setHeader('cache', array('jquery/plugin/jquery.highlightFade.js' => 'static_script', 'quick_edit.js' => 'static_script', 'selector.js' => 'static_script', 'mail.js' => 'module_mail', 'pager.css' => 'style_css', 'mail.css' => 'style_css')); }
/** * 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())); }
public function getBlog($iBlogId) { (($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_getblog__start')) ? eval($sPlugin) : false); (($sPlugin = Phpfox_Plugin::get('blog.service_blog_getblog')) ? eval($sPlugin) : false); if (Phpfox::isModule('track')) { $this->database()->select("blog_track.item_id AS is_viewed, ")->leftJoin(Phpfox::getT('blog_track'), 'blog_track', 'blog_track.item_id = blog.blog_id AND blog_track.user_id = ' . Phpfox::getUserBy('user_id')); } if (Phpfox::isModule('friend')) { $this->database()->select('f.friend_id AS is_friend, ')->leftJoin(Phpfox::getT('friend'), 'f', "f.user_id = blog.user_id AND f.friend_user_id = " . Phpfox::getUserId()); } if (Phpfox::isModule('like')) { $this->database()->select('l.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'l', 'l.type_id = \'blog\' AND l.item_id = blog.blog_id AND l.user_id = ' . Phpfox::getUserId()); } $aRow = $this->database()->select("blog.*, " . (Phpfox::getParam('core.allow_html') ? "blog_text.text_parsed" : "blog_text.text") ." AS text, " . Phpfox::getUserField()) ->from($this->_sTable, 'blog') ->join(Phpfox::getT('blog_text'), 'blog_text', 'blog_text.blog_id = blog.blog_id') ->join(Phpfox::getT('user'), 'u', 'u.user_id = blog.user_id') ->where('blog.blog_id = ' . (int) $iBlogId) ->execute('getSlaveRow'); (($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_getblog__end')) ? eval($sPlugin) : false); if (!isset($aRow['is_friend'])) { $aRow['is_friend'] = 1; } return $aRow; }
/** * 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(); }
public function update() { $aVals = $this->get('val'); if (!isset($aVals['video_id'])) { return Phpfox_Error::set(Phpfox::getPhrase('video.unable_to_edit_this_video_as_there_is_no_video_id')); } Phpfox::getService('ban')->checkAutomaticBan($aVals['title'] . ' ' . $aVals['text'] . ' ' . $aVals['tag_list']); if ($mReturn = Phpfox::getService('video.process')->update($aVals['video_id'], $aVals)) { if (!is_bool($mReturn)) { $aVideo = Phpfox::getService('video')->getVideo($aVals['video_id'], true); $this->attr('#js_view_video_link', 'href', ($aVideo['module_id'] != 'video' ? Phpfox::getLib('url')->makeUrl('video', array('redirect' => $aVideo['video_id'])) : Phpfox::getService('video')->makeUrl(Phpfox::getUserBy('user_name'), $mReturn))); } $this->show('#js_save_video')->html('#js_save_video', '<span class="valid_message">'.Phpfox::getPhrase('video.done').'</span>', '.fadeOut(5000)'); } else { $this->html('#js_save_video', ''); } $this->attr('#js_save_button', 'disabled', false) ->removeClass('#js_save_button', 'disabled'); }
public function addFeedComment() { Phpfox::isUser(true); $aVals = (array) $this->get('val'); if (!defined('PAGE_TIME_LINE')) { // Check if this item is a page and is using time line if (isset($aVals['callback_module']) && $aVals['callback_module'] == 'pages' && isset($aVals['callback_item_id']) && Phpfox::getService('pages')->timelineEnabled($aVals['callback_item_id'])) { define('PAGE_TIME_LINE', true); } } if (Phpfox::getLib('parse.format')->isEmpty($aVals['user_status'])) { $this->alert(Phpfox::getPhrase('user.add_some_text_to_share')); $this->call('$Core.activityFeedProcess(false);'); return; } $aPage = Phpfox::getService('pages')->getPage($aVals['callback_item_id']); if (!isset($aPage['page_id'])) { $this->alert(Phpfox::getPhrase('pages.unable_to_find_the_page_you_are_trying_to_comment_on')); $this->call('$Core.activityFeedProcess(false);'); return; } $sLink = Phpfox::getService('pages')->getUrl($aPage['page_id'], $aPage['title'], $aPage['vanity_url']); $aCallback = array('module' => 'pages', 'table_prefix' => 'pages_', 'link' => $sLink, 'email_user_id' => $aPage['user_id'], 'subject' => Phpfox::getPhrase('pages.full_name_wrote_a_comment_on_your_page_title', array('full_name' => Phpfox::getUserBy('full_name'), 'title' => $aPage['title'])), 'message' => Phpfox::getPhrase('pages.full_name_wrote_a_comment_link', array('full_name' => Phpfox::getUserBy('full_name'), 'link' => $sLink, 'title' => $aPage['title'])), 'notification' => $this->get('custom_pages_post_as_page') ? null : 'pages_comment', 'feed_id' => 'pages_comment', 'item_id' => $aPage['page_id']); $aVals['parent_user_id'] = $aVals['callback_item_id']; if (isset($aVals['user_status']) && ($iId = Phpfox::getService('feed.process')->callback($aCallback)->addComment($aVals))) { Phpfox::getLib('database')->updateCounter('pages', 'total_comment', 'page_id', $aPage['page_id']); Phpfox::getService('feed')->callback($aCallback)->processAjax($iId); } else { $this->call('$Core.activityFeedProcess(false);'); } }
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)); }
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); }
/** * 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)); }
public function add($sType, $iId, $iUserId = null) { if (Phpfox::getUserBy('is_invisible')) { return false; } return Phpfox::callback($sType . '.addTrack', $iId, $iUserId); }
/** * 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)); }
/** * 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')); }
/** * 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)); }
/** * Controller */ public function process() { if (!Phpfox::isUser()) { return false; } $sImage = Phpfox::getLib('image.helper')->display(array('server_id' => Phpfox::getUserBy('server_id'), 'title' => Phpfox::getUserBy('full_name'), 'path' => 'core.url_user', 'file' => Phpfox::getUserBy('user_image'), 'suffix' => '_20_square', 'max_width' => 20, 'max_height' => 20, 'no_default' => true, 'style' => 'vertical-align:middle; padding-right:5px;')); $this->template()->assign(array('sUserGlobalImage' => $sImage, 'sUserCurrentStatus' => Phpfox::getUserBy('status'), 'iCurrentUserId' => Phpfox::getUserId())); }