/** * 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; }
/** * Controller */ public function process() { Phpfox::getUserParam('music.can_access_music', true); define('PHPFOX_SKIP_IM', true); $aAlbum = Phpfox::getService('music.album')->getForPlayer($this->request()->getInt('album')); $bPlayAll = $this->request()->getInt('play') == 1 ? true : false; if (!isset($aAlbum['album_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('music.album_you_are_looking_for_cannot_be_found')); } $aTracks = Phpfox::getService('music.album')->getTracks($aAlbum['user_id'], $aAlbum['album_id']); $sPlaylist = '{'; $sNextSong = '{'; foreach ($aTracks as $iKey => $aTrack) { //$sPlaylist .= '{sPath : "' . $aTrack['song_path'] . '", iId : ' . $aTrack['song_id'] . '},'; $sPlaylist .= '' . $aTrack['song_id'] . ' : "' . $aTrack['song_path'] . '",'; if ($iKey > 0) { // adding this song's id to the previous song's index $sNextSong .= ' ' . $aTracks[$iKey - 1]['song_id'] . ' : ' . $aTracks[$iKey]['song_id'] . ','; } } // add the first song to the last song $sNextSong .= ' ' . $aTracks[$iKey]['song_id'] . ' : ' . $aTracks[0]['song_id']; $sNextSong .= '}'; $sPlaylist = rtrim($sPlaylist, ',') . '}'; $this->template()->setTitle($aAlbum['name'])->assign(array('aAlbum' => $aAlbum, 'bPlayAll' => true))->setHeader(array('blank.css' => 'style_css', '<script type="text/javascript">$Behavior.music_player_load_player = function() { $Core.player.load({id: \'js_music_player' . ($bPlayAll ? '_all' : '') . '\', type: \'music\', playlist: ' . $sPlaylist . ', aNextSong: ' . $sNextSong . '}); };</script>'))->setTemplate('blank'); }
public function process() { if ($aVals = $this->request()->getArray('val')) { if (Phpfox::getService('custom.relation.process')->add($aVals)) { $this->url()->send('admincp.custom.relationships', array(), Phpfox::getPhrase('custom.status_added')); } } if ($iId = $this->request()->getInt('delete')) { if (Phpfox::getService('custom.relation.process')->delete($iId)) { $this->url()->send('admincp.custom.relationships', array(), Phpfox::getPhrase('custom.status_deleted')); } } $aStatuses = Phpfox::getService('custom.relation')->getAll(); /* If we're editing lets make it easier and just find the one we're looking for here */ if ($iEdit = $this->request()->getInt('edit')) { $aEdit = array(); foreach ($aStatuses as $aStatus) { if ($aStatus['relation_id'] == $iEdit) { $aEdit = $aStatus; break; } } if (empty($aEdit)) { Phpfox_Error::display(Phpfox::getPhrase('custom.not_found')); } else { $this->template()->assign(array('aEdit' => $aEdit)); } } $this->template()->setTitle(Phpfox::getPhrase('custom.admin_menu_manage_relationships'))->setBreadcrumb(Phpfox::getPhrase('custom.admin_menu_manage_relationships'))->setPhrase(array())->assign(array('aStatuses' => $aStatuses)); }
/** * Controller */ public function process() { Phpfox::isUser(true); if ($this->request()->getInt('forum')) { $aForum = Phpfox::getService('forum')->id($this->request()->getInt('forum'))->getForum(); if (!isset($aForum['forum_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('forum.not_a_valid_forum')); } if (Phpfox::getService('forum.thread.process')->markRead($aForum['forum_id'])) { $this->url()->send('forum', array($aForum['name_url'] . '-' . $aForum['forum_id']), Phpfox::getPhrase('forum.forum_successfully_marked_as_read')); } } elseif (($sModule = $this->request()->get('module')) && ($iItemId = $this->request()->getInt('item'))) { $aCallback = Phpfox::callback($sModule . '.addForum', $iItemId); if (isset($aCallback['module'])) { if (Phpfox::getService('forum.thread.process')->markRead(0, $aCallback['item'])) { $this->url()->send($aCallback['url_home'], array('forum'), Phpfox::getPhrase('forum.forum_successfully_marked_as_read')); } } } else { $aForums = Phpfox::getService('forum')->live()->getForums(); foreach ($aForums as $aForum) { Phpfox::getService('forum.thread.process')->markRead($aForum['forum_id']); $aChildrens = Phpfox::getService('forum')->id($aForum['forum_id'])->getChildren(); if (!is_array($aChildrens)) { continue; } foreach ($aChildrens as $iForumid) { Phpfox::getService('forum.thread.process')->markRead($iForumid); } } $this->url()->send('forum', null, Phpfox::getPhrase('forum.forum_successfully_marked_as_read')); } }
/** * Controller */ public function process() { $bIsEdit = false; $sIso = ''; $mCountry = ''; if ($sIso = $this->request()->get('iso')) { $mCountry = Phpfox::getService('core.country')->getCountry($sIso); if ($mCountry === false) { return Phpfox_Error::display(Phpfox::getPhrase('admincp.not_a_valid_country')); } } elseif ($iChild = $this->request()->getInt('id')) { if ($aChild = Phpfox::getService('core.country')->getChildEdit($iChild)) { $bIsEdit = true; $this->template()->assign(array('aForms' => $aChild)); } } if ($aVals = $this->request()->getArray('val')) { if ($bIsEdit) { if (Phpfox::getService('core.country.child.process')->update($aChild['child_id'], $aVals)) { $this->url()->send('admincp.core.country.child', array('id' => $aChild['country_iso']), Phpfox::getPhrase('admincp.state_province_successfully_updated')); } } else { if (Phpfox::getService('core.country.child.process')->add($aVals)) { $this->url()->send('admincp.core.country.child', array('id' => $aVals['country_iso']), Phpfox::getPhrase('admincp.state_province_successfully_added')); } } } $this->template()->setTitle(Phpfox::getPhrase('admincp.country_manager'))->setBreadcrumb(Phpfox::getPhrase('admincp.country_manager'), $this->url()->makeUrl('admincp.core.country'))->setBreadcrumb($bIsEdit ? Phpfox::getPhrase('admincp.editing_state_province') . ': ' : Phpfox::getPhrase('admincp.adding_state_province') . ': ' . $mCountry, null, true)->assign(array('bIsEdit' => $bIsEdit, 'sIso' => $sIso)); }
/** * Class process method wnich is used to execute this component. */ public function process() { Phpfox::getUserParam('photo.can_view_photos', true); if (!Phpfox::getParam('photo.can_rate_on_photos')) { return Phpfox_Error::display(Phpfox::getPhrase('photo.photo_rating_is_disabled')); } Phpfox::getUserParam('photo.can_rate_on_photos', true); if ($iPhotoId = $this->request()->getInt('photo-id')) { Phpfox::getService('photo.rate.process')->add($this->request()->getInt('photo-id'), $this->request()->getInt('rating')); } $sCategory = null; if ($this->request()->get('req3') == 'category') { $sCategory = $this->request()->getInt('req4'); } ($sPlugin = Phpfox_Plugin::get('photo.component_controller_rate_process_start')) ? eval($sPlugin) : false; $aPhoto = Phpfox::getService('photo.rate')->getForRating($sCategory, $this->request()->get('id', null)); $sBar = ''; for ($i = 1; $i <= 10; $i++) { $sBar .= '<li><a href="' . ($sCategory === null ? $this->url()->makeUrl('photo.rate', array('photo-id' => $aPhoto['photo_id'], 'rating' => $i)) : $this->url()->permalink('photo.rate.category', $this->request()->getInt('req4'), $this->request()->get('req5'), false, null, array('photo-id' => $aPhoto['photo_id'], 'rating' => $i))) . '" class="js_rating_bar">' . $i . '</a></li>'; } $sBar .= '<li><a href="' . ($sCategory === null ? $this->url()->makeUrl('photo.rate') : $this->url()->permalink('photo.rate.category', $this->request()->getInt('req4'), $this->request()->get('req5'))) . '">' . Phpfox::getPhrase('photo.skip') . '</a></li>'; $this->setParam('sPhotoCategorySubSystem', 'rate'); $this->setParam('aPhoto', $aPhoto); $this->setParam('sCurrentCategory', $sCategory); Phpfox::getService('photo')->buildMenu(); $this->template()->setTitle(Phpfox::getPhrase('photo.rate_photos'))->setBreadcrumb(Phpfox::getPhrase('photo.photos'), $this->url()->makeUrl('photo'))->setHeader('cache', array('rate_bar.css' => 'style_css'))->assign(array('sRatingBar' => $sBar, 'aPhoto' => $aPhoto, 'aCallback' => null)); ($sPlugin = Phpfox_Plugin::get('photo.component_controller_rate_process_end')) ? eval($sPlugin) : false; }
/** * Class process method wnich is used to execute this component. */ public function process() { return Phpfox_Error::display('This section has been depreciated'); Phpfox::getUserParam('comment.can_moderate_comments', true); if ($aIds = $this->request()->getArray('id')) { if ($this->request()->get('approve')) { foreach ($aIds as $iId) { Phpfox::getService('feed.process')->approve($iId); } $this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_approved')); } else { foreach ($aIds as $iId) { Phpfox::getService('feed.process')->deleteFeed($iId); } $this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_deleted')); } } $iPage = $this->request()->getInt('page'); $aPages = array(20, 30, 40, 50); $aDisplays = array(); foreach ($aPages as $iPageCnt) { $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt)); } $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'feed'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC')); $oSearch = Phpfox::getLib('search')->set(array('type' => 'feeds', 'filters' => $aFilters, 'search' => 'search')); $oSearch->setCondition('AND feed.view_id = 1'); list($iCnt, $aFeeds) = Phpfox::getService('feed')->getForBrowse($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay()); Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt))); $this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aFeeds' => $aFeeds, 'bIsCommentAdminPanel' => true)); }
/** * Class process method wnich is used to execute this component. */ public function process() { if (!($aPurchase = Phpfox::getService('subscribe.purchase')->getInvoice($this->request()->getInt('id')))) { return Phpfox_Error::display(Phpfox::getPhrase('subscribe.unable_to_find_this_invoice')); } $this->template()->setTitle(Phpfox::getPhrase('subscribe.membership_packages'))->setBreadcrumb(Phpfox::getPhrase('subscribe.membership_packages'), $this->url()->makeUrl('subscribe'))->setBreadcrumb(Phpfox::getPhrase('subscribe.subscriptions'), $this->url()->makeUrl('subscribe.list'))->setBreadcrumb(Phpfox::getPhrase('subscribe.order_purchase_id_title', array('purchase_id' => $aPurchase['purchase_id'], 'title' => Phpfox::getLib('locale')->convert($aPurchase['title']))), null, true)->assign(array('aPurchase' => $aPurchase)); }
/** * 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)); }
/** * 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 ($iCommentId = $this->request()->getInt('req3')) { $aComment = Phpfox::getService('comment')->getComment($iCommentId); if (!isset($aComment['comment_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist')); } if (Phpfox::hasCallback('comment', 'getRedirectRequest')) { $this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id'])); } if (Phpfox::hasCallback($aComment['type_id'], 'getParentItemCommentUrl')) { $sNewUrl = Phpfox::callback($aComment['type_id'] . '.getParentItemCommentUrl', $aComment); if ($sNewUrl !== false) { $aComment['callback_url'] = $sNewUrl; } } $this->template()->setTitle(Phpfox::getPhrase('comment.viewing_comment'))->setHeader(array('view.css' => 'module_comment'))->setBreadcrumb(Phpfox::getPhrase('comment.viewing_comment'))->assign(array('aComment' => $aComment)); } else { $aComment = Phpfox::getService('comment')->getComment($this->request()->getInt('id')); if (!isset($aComment['comment_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist')); } $this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id'])); } }
/** * 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; }
/** * Add thread * @param $iFourmId * @param $sTitle * @param $sText * @param $iSubscribed * @return bool|null */ public function addThread($iFourmId, $sTitle, $sText, $iSubscribed) { $aForum = Phpfox::getService('forum')->id($iFourmId)->getForum(); if (!isset($aForum['forum_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('forum.not_a_valid_forum')); } if ($aForum['is_closed']) { return Phpfox_Error::display(Phpfox::getPhrase('forum.forum_is_closed')); } $bPass = false; if (Phpfox::getUserParam('forum.can_add_new_thread') || Phpfox::getService('forum.moderate')->hasAccess($aForum['forum_id'], 'add_thread')) { $bPass = true; } if ($bPass === false) { return Phpfox_Error::display(Phpfox::getPhrase('forum.insufficient_permission_to_reply_to_this_thread')); } $aVals = array('forum_id' => $iFourmId, 'title' => $sTitle, 'text' => $sText, 'is_subscribed' => $iSubscribed); if (($iFlood = Phpfox::getUserParam('forum.forum_thread_flood_control')) !== 0) { $aFlood = array('action' => 'last_post', 'params' => array('field' => 'time_stamp', 'table' => Phpfox::getT('forum_thread'), 'condition' => 'user_id = ' . Phpfox::getUserId(), 'time_stamp' => $iFlood * 60)); // actually check if flooding if (Phpfox::getLib('spam')->check($aFlood)) { Phpfox_Error::set(Phpfox::getPhrase('forum.posting_a_new_thread_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime()); } } //add thread if (Phpfox_Error::isPassed() && ($iId = Phpfox::getService('forum.thread.process')->add($aVals, false))) { //return thread return $this->getThreadById($iId, 1, 10, null); } return null; }
/** * Class process method wnich is used to execute this component. */ public function process() { if (Phpfox::isPackage(array('1', '2'))) { return Phpfox_Error::display('Not able to use this feature.'); } $this->template()->setTitle(Phpfox::getPhrase('friend.friend_suggestions'))->setBreadcrumb(Phpfox::getPhrase('friend.my_friends'), $this->url()->makeUrl('friend'))->setBreadcrumb(Phpfox::getPhrase('friend.suggestions'), null, true)->assign(array('aSuggestions' => Phpfox::getService('friend.suggestion')->get())); }
/** * Controller */ public function process() { $aLanguage = Phpfox::getService('language')->getLanguage($this->request()->get('id')); if (!isset($aLanguage['language_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('language.not_a_valid_language_package')); } $iPage = $this->request()->getInt('page', 0); $aXml = Phpfox::getService('core')->getModulePager('phrases', $iPage, 5); if ($aXml === false) { $sPhrase = Phpfox::getPhrase('language.successfully_imported_missing_phrases'); Phpfox::getLib('cache')->remove('locale', 'substr'); if ($this->request()->get('check') == 'true') { $this->url()->send('admincp.language', null, $sPhrase); } else { $this->url()->send('admincp.language.missing', array('id' => $aLanguage['language_id'], 'check' => 'true')); } } $aModules = array(); if (is_array($aXml)) { $iMissing = Phpfox::getService('language.phrase.process')->findMissingPhrases($aLanguage['language_id'], $aXml, $this->request()->get('check') == 'true' ? true : false); foreach ($aXml as $sModule => $sPhrases) { $aModules[] = $sModule; } $this->template()->setHeader('<meta http-equiv="refresh" content="2;url=' . $this->url()->makeUrl('admincp.language.missing', array('id' => $aLanguage['language_id'], 'check' => $this->request()->get('check'), 'page' => $iPage + 1)) . '">'); } $this->template()->setTitle(Phpfox::getPhrase('language.find_missing_phrases'))->setBreadcrumb(Phpfox::getPhrase('language.manage_language_packages'), $this->url()->makeUrl('admincp.language'))->setBreadcrumb(Phpfox::getPhrase('language.find_missing_phrases'), $this->url()->makeUrl('current'))->setBreadcrumb($aLanguage['title'], null, true)->assign(array('aModules' => $aModules, 'iMissing' => $iMissing)); }
/** * 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)); }
public function doPoke() { if (!Phpfox::getUserParam('poke.can_poke')) { return Phpfox_Error::display(Phpfox::getPhrase('poke.you_are_not_allowed_to_send_pokes')); } if (Phpfox::getUserParam('poke.can_only_poke_friends') && !Phpfox::getService('friend')->isFriend(Phpfox::getUserId(), $this->get('user_id'))) { return Phpfox_Error::display(Phpfox::getPhrase('poke.you_can_only_poke_your_own_friends')); } if (Phpfox::getService('poke.process')->sendPoke($this->get('user_id'))) { /* Type 1 is when poking back from the display block*/ if ($this->get('type') == '1') { $this->call('$("#poke_' . $this->get('user_id') . '").hide().remove();'); } else { $this->call('$("#liPoke").hide().remove();'); $this->alert(Phpfox::getPhrase('poke.poke_sent')); } } else { $this->alert(Phpfox::getPhrase('poke.poke_could_not_be_sent')); } list($iTotalPokes, $aPokes) = Phpfox::getService('poke')->getPokesForUser(Phpfox::getUserId()); if (!$iTotalPokes) { $this->call('$("#js_block_border_poke_display").remove();'); } else { $this->call('$("#poke_' . $this->get('user_id') . '").hide().remove();'); } }
/** * Class process method wnich is used to execute this component. */ public function process() { $aValidation = array('name' => Phpfox::getPhrase('photo.provide_a_name_for_your_photo_category')); $oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_form', 'aParams' => $aValidation)); if (($aOrder = $this->request()->getArray('order')) && Phpfox::getUserParam('photo.can_edit_photo_categories', true) && Phpfox::getService('photo.category.process')->updateOrder($aOrder)) { $this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_order_successfully_updated')); } if (!Phpfox::getUserParam('photo.can_add_public_categories') && !Phpfox::getUserParam('photo.can_edit_photo_categories')) { return Phpfox_Error::display(Phpfox::getPhrase('photo.invalid_section')); } if ($aVals = $this->request()->getArray('val')) { if ($oValid->isValid($aVals)) { if (isset($aVals['delete']) && Phpfox::getUserParam('photo.can_edit_photo_categories', true)) { if (Phpfox::getService('photo.category.process')->delete($aVals['edit_id'])) { $this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_successfully_deleted')); } } else { if (isset($aVals['edit_id'])) { Phpfox::getUserParam('photo.can_edit_photo_categories', true); if (Phpfox::getService('photo.category.process')->update($aVals)) { $this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_successfully_updated')); } } else { Phpfox::getUserParam('photo.can_add_public_categories', true); if (Phpfox::getService('photo.category.process')->add($aVals)) { $this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_successfully_added')); } } } } } $this->template()->setTitle(Phpfox::getPhrase('photo.manage_photo_categories'))->setBreadCrumb(Phpfox::getPhrase('photo.manage_photo_categories'), $this->url()->makeUrl('admincp.photo'))->setHeader('cache', array('admin.js' => 'module_photo', 'jquery/ui.js' => 'static_script', 'sort.js' => 'module_photo'))->assign(array('sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm())); }
/** * Class process method wnich is used to execute this component. */ public function process() { $aValidation = array('message' => Phpfox::getPhrase('mail.add_reply')); $oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_form', 'aParams' => $aValidation)); $aMail = Phpfox::getService('mail')->getMail($this->request()->getInt('id')); if (!isset($aMail['mail_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('mail.invalid_message')); } $bCanView = false; if ($aMail['viewer_user_id'] == Phpfox::getUserId() || $aMail['owner_user_id'] == Phpfox::getUserId()) { $bCanView = true; } if ($bCanView === false) { return Phpfox_Error::display(Phpfox::getPhrase('mail.invalid_message')); } if ($aVals = $this->request()->getArray('val')) { if ($oValid->isValid($aVals)) { $aVals['to'] = $aMail['owner_user_id']; if ($iNewId = Phpfox::getService('mail.process')->add($aVals)) { $this->url()->send('mail.view', array('id' => $iNewId)); } } } if ($aMail['viewer_user_id'] == Phpfox::getUserId()) { Phpfox::getService('mail.process')->toggleView($aMail['mail_id'], false); } $this->template()->assign(array('bMobileInboxIsActive' => true, 'aMail' => $aMail)); }
/** * Class process method which is used to execute this component. */ public function process() { Phpfox::getUserParam('apps.can_view_app', true); if ($this->request()->get('req2') == 'view') { $this->url()->forward($this->url()->makeUrl('apps', array($this->request()->get('req3'), $this->request()->get('req4')))); } if ($this->request()->get('req2') == 'category') { $aApp = Phpfox::getService('apps')->getAppById($this->request()->get('req3')); } else { $aApp = Phpfox::getService('apps')->getAppById($this->request()->get('req2')); } /* if there is no app */ if (empty($aApp)) { return Phpfox_Error::display(Phpfox::getPhrase('apps.that_app_was_not_found_check')); } if (empty($aApp['is_installed'])) { if ($this->request()->get('force') && Phpfox::getUserParam('apps.can_moderate_apps')) { } else { $this->setParam('aApp', $aApp); /* loading another controller as a safety measure vs loading the app and * a hovering block*/ return Phpfox::getLib('module')->setController('apps.install'); } } $sKey = Phpfox::getService('apps')->getKey($aApp['app_id']); $sFrameUrl = '' . $aApp['app_url'] . '?key=' . $sKey; $this->template() ->setEditor() ->assign(array( 'aApp' => $aApp, 'iUserId' => Phpfox::getUserId(), // 'sToken' => $sToken, 'sFrameUrl' => $sFrameUrl ) ) ->setHeader(array( // '<script type="text/javascript">oParams["apps.keep_alive"] = ' . Phpfox::getParam('apps.token_keep_alive') . ';</script>', 'view.js' => 'module_apps' ) ); }
/** * Class process method wnich is used to execute this component. */ public function process() { $sLink = Phpfox::getService('user')->getLink($this->request()->get('id')); if ($sLink === false) { return Phpfox_Error::display(Phpfox::getPhrase('feed.invalid_user')); } $this->url()->send($sLink); }
/** * Class process method wnich is used to execute this component. */ public function process() { $sUrl = Phpfox::callback($this->request()->get('req3') . '.getRedirectRequest', $this->request()->get('id')); if ($sUrl === false) { return Phpfox_Error::display(Phpfox::getPhrase('request.invalid_request_redirect')); } $this->url()->forward($sUrl); }
/** * Class process method wnich is used to execute this component. */ public function process() { $aThread = Phpfox::getService('forum.thread')->getActualThread($this->request()->get('thread_id')); if (!isset($aThread['thread_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('forum.not_a_valid_thread_to_copy')); } $this->template()->assign(array('sForums' => Phpfox::getService('forum')->active($aThread['forum_id'])->getJumpTool(true), 'aThread' => $aThread)); }
/** * Class process method wnich is used to execute this component. */ public function process() { $aUser = $this->getParam('aUser'); if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'favorite.view_favorite')) { return Phpfox_Error::display('<div class="extra_info">' . Phpfox::getPhrase('favorite.full_name_has_closed_their_favorites_section', array('user_link' => $this->url()->makeUrl($aUser['user_name']), 'full_name' => Phpfox::getLib('parse.output')->clean($aUser['full_name']))) . '</div>'); } list($iOwnerUserId, $aFavorites) = Phpfox::getService('favorite')->get($aUser['user_id']); $this->template()->setHeader('cache', array('favorite.js' => 'module_favorite'))->setTitle(Phpfox::getPhrase('favorite.full_name_s_favorites', array('full_name' => $aUser['full_name'])))->setBreadcrumb(Phpfox::getPhrase('favorite.full_name_s_favorites', array('full_name' => $aUser['full_name'])), $this->url()->makeUrl($aUser['user_name'], 'favorite'))->assign(array('aFavorites' => $aFavorites, 'iFavoriteUserId' => $iOwnerUserId)); }
public function getAppById($iId, $iUserId) { $aApp = $this->database()->select('a.*, p.page_id, p.total_like, au.install_id as is_installed, ac.category_id, ac.name as category_name, ' . Phpfox::getUserField())->from(Phpfox::getT('app'), 'a')->join(Phpfox::getT('user'), 'u', 'u.user_id = a.user_id')->leftjoin(Phpfox::getT('app_installed'), 'au', 'au.app_id = a.app_id AND au.user_id = ' . $iUserId)->leftjoin(Phpfox::getT('app_category_data'), 'acd', 'acd.app_id = a.app_id')->leftjoin(Phpfox::getT('app_category'), 'ac', 'ac.category_id = acd.category_id')->leftjoin(Phpfox::getT('pages'), 'p', 'p.app_id = a.app_id')->where('a.public_key = \'' . $iId . '\'')->execute('getSlaveRow'); if (empty($aApp)) { return Phpfox_Error::display(Phpfox::getPhrase('apps.this_app_does_not_exist')); } $aApp['category_name'] = Phpfox::getLib('locale')->convert($aApp['category_name']); return $aApp; }
public function showQuickContact() { // Phpfox::getUserParam(''); $iUserId = Phpfox::getParam('pages.admin_in_charge_of_page_claims'); if (empty($iUserId)) { return Phpfox_Error::display(Phpfox::getPhrase('contact.no_admin_has_been_set_to_handle_this_type_of_issues')); } Phpfox::getComponent('mail.compose', array('claim_page' => true, 'page_id' => $this->get('page_id'), 'id' => $iUserId), 'controller'); }
/** * Controller */ public function process() { $aThread = Forum_Service_Thread_Thread::instance()->getActualThread($this->request()->get('thread_id')); if (!isset($aThread['thread_id'])) { return Phpfox_Error::display(Phpfox::getPhrase('forum.not_a_valid_thread_to_move')); } $bIsGroup = $aThread['group_id'] > 0 ? true : false; $this->template()->assign(array('aThread' => $aThread, 'sForums' => $bIsGroup ? '' : Phpfox::getService('forum')->active($aThread['forum_id'])->getJumpTool(true), 'bIsGroup' => $bIsGroup)); }
/** * Controller */ public function process() { Phpfox::isUser(true); if (!Phpfox::getParam('mail.threaded_mail_conversation')) { $this->url()->send('mail'); } $aVals = $this->request()->get('val'); if ($aVals && ($iNewId = Mail_Service_Process::instance()->add($aVals))) { list($aCon, $aMessages) = Mail_Service_Mail::instance()->getThreadedMail($iNewId); $aMessages = array_reverse($aMessages); Phpfox_Template::instance()->assign(array('aMail' => $aMessages[0], 'aCon' => $aCon, 'bIsLastMessage' => true))->getTemplate('mail.block.entry'); $content = ob_get_contents(); ob_clean(); return ['append' => ['to' => '#mail_threaded_new_message', 'with' => $content]]; } $iThreadId = $this->request()->getInt('id'); list($aThread, $aMessages) = Mail_Service_Mail::instance()->getThreadedMail($iThreadId); if ($aThread === false) { return Phpfox_Error::display(Phpfox::getPhrase('mail.unable_to_find_a_conversation_history_with_this_user')); } $aValidation = array('message' => Phpfox::getPhrase('mail.add_reply')); $oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aValidation)); if ($aThread['user_is_archive']) { $this->request()->set('view', 'trash'); } Mail_Service_Mail::instance()->buildMenu(); Mail_Service_Process::instance()->threadIsRead($aThread['thread_id']); $iUserCnt = 0; $sUsers = ''; $bCanViewThread = false; foreach ($aThread['users'] as $aUser) { if ($aUser['user_id'] == Phpfox::getUserId()) { $bCanViewThread = true; } if ($aUser['user_id'] == Phpfox::getUserId()) { continue; } $iUserCnt++; if ($iUserCnt == count($aThread['users']) - 1 && count($aThread['users']) - 1 > 1) { $sUsers .= ' & '; } else { if ($iUserCnt != '1') { $sUsers .= ', '; } } $sUsers .= $aUser['full_name']; } if (!$bCanViewThread) { return Phpfox_Error::display('Unable to view this thread.'); } else { $this->template()->setBreadcrumb(Phpfox::getPhrase('mail.mail'), $this->url()->makeUrl('mail'))->setBreadcrumb($sUsers, $this->url()->makeUrl('mail.thread', array('id' => $iThreadId)), true); } $this->template()->setTitle($sUsers)->setTitle(Phpfox::getPhrase('mail.mail'))->setHeader('cache', array('mail.js' => 'module_mail', 'jquery/plugin/jquery.scrollTo.js' => 'static_script'))->assign(array('sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(false), 'aMessages' => $aMessages, 'aThread' => $aThread, 'sCurrentPageCnt' => $this->request()->getInt('page', 0) + 1)); $this->setParam('attachment_share', array('type' => 'mail', 'id' => 'js_form_mail')); $this->setParam('global_moderation', array('name' => 'mail', 'ajax' => 'mail.mailThreadAction', 'custom_fields' => '<div><input type="hidden" name="forward_thread_id" value="' . $aThread['thread_id'] . '" id="js_forward_thread_id" /></div>', 'menu' => array(array('phrase' => Phpfox::getPhrase('mail.forward'), 'action' => 'forward')))); }
/** * Class process method wnich is used to execute this component. */ public function process() { phpfox::isUser(true); if (!Phpfox::isUser()) { return Phpfox_Error::display('Need to be logged in!'); } Phpfox::getUserParam('blog.can_import_blog', true); //check if user able to access this page $this->template()->setBreadcrumb(phpfox::getPhrase('blog.blogs'), $this->url()->makeUrl('blog'))->setBreadcrumb(phpfox::getPhrase('blog.import_blog_s'), $this->url()->makeUrl('blog.import'), true)->setHeader('cache', array('jquery/plugin/jquery.highlightFade.js' => 'static_script', 'switch_legend.js' => 'static_script', 'switch_menu.js' => 'static_script', 'quick_edit.js' => 'static_script', 'pager.css' => 'style_css')); }
/** * Class process method wnich is used to execute this component. */ public function process() { $iCommunityId = $this->request()->getInt('id'); $aCommunity = Phpfox::getService('community')->getCommunity($iCommunityId); if (!isset($aCommunity['community_id'])) { Phpfox_Error::display('Community not found!'); } $this->setParam('aCommunity', $aCommunity); $this->template()->setHeader(array('community.css' => 'module_community', 'aCommunity' => $aCommunity)); }