コード例 #1
0
ファイル: ajax.class.php プロジェクト: Lovinity/EQM
 public function viewMore()
 {
     Phpfox::getComponent('search.index', array(), 'controller');
     $this->remove('#feed_view_more');
     $this->append('#js_feed_content', $this->getContent(false));
     $this->call('$Core.loadInit();');
 }
コード例 #2
0
ファイル: ajax.class.php プロジェクト: noikiy/phpfox-v3-dist
 public function widget()
 {
     $this->setTitle(Phpfox::getPhrase('pages.widgets'));
     Phpfox::getComponent('pages.widget', array(), 'controller');
     ($sPlugin = Phpfox_Plugin::get('pages.component_ajax_widget')) ? eval($sPlugin) : false;
     echo '<script type="text/javascript">$Core.loadInit();</script>';
 }
コード例 #3
0
ファイル: profile.class.php プロジェクト: lev1976g/core
 /**
  * Controller
  */
 public function process()
 {
     ($sPlugin = Phpfox_Plugin::get('quiz.component_controller_profile_process_start')) ? eval($sPlugin) : false;
     $this->setParam('bIsProfile', true);
     Phpfox::getComponent('quiz.index', array('bNoTemplate' => true), 'controller');
     ($sPlugin = Phpfox_Plugin::get('quiz.component_controller_profile_process_end')) ? eval($sPlugin) : false;
 }
コード例 #4
0
ファイル: profile.class.php プロジェクト: googlesky/snsp.vn
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $this->setParam('bIsProfile', true);
     $aUser = $this->getParam('aUser');
     $this->template()->setMeta('keywords', Phpfox::getPhrase('blog.full_name_s_blogs', array('full_name' => $aUser['full_name'])));
     $this->template()->setMeta('description', Phpfox::getPhrase('blog.full_name_s_blogs_on_site_title', array('full_name' => $aUser['full_name'], 'site_title' => Phpfox::getParam('core.site_title'))));
     Phpfox::getComponent('blog.index', array('bNoTemplate' => true), 'controller');
 }
コード例 #5
0
ファイル: ajax.class.php プロジェクト: lev1976g/core
 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');
 }
コード例 #6
0
ファイル: profile.class.php プロジェクト: hoanghd/tools
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		$this->setParam('bIsProfile', true);
		
		$aUser = $this->getParam('aUser');		
		
		if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'video.display_on_profile'))
		{
			return Phpfox_Error::display(Phpfox::getPhrase('video.videos_for_this_profile_is_set_to_private'));
		}			
		
		Phpfox::getComponent('video.index', array('bNoTemplate' => true), 'controller');
	}
コード例 #7
0
ファイル: view.class.php プロジェクト: Lovinity/EQM
 public function process()
 {
     Phpfox::getLib('setting')->setParam(array('profiles.url_image' => Phpfox::getParam('core.url_pic') . 'profiles/'));
     $mUser = $this->request()->get('req2');
     $sSection = $this->request()->get('req3');
     $bIsPublicItemView = false;
     if (Phpfox::isPublicView()) {
         if (!empty($sSection) && Phpfox::isModule($sSection) && $sSection != 'designer' && Phpfox::hasCallback($sSection, 'getItemView') && Phpfox::callback($sSection . '.getItemView') === true) {
             $bIsPublicItemView = true;
         }
     }
     if (!$mUser) {
         if (Phpfox::isUser()) {
             $this->url()->send('profile');
         } else {
             Phpfox::isUser(true);
         }
     }
     $aExtraProfile = Phpfox::getService('profiles')->getProfile($mUser);
     if (count($aExtraProfile) == 0) {
         return Phpfox::getLib('module')->setController('error.404');
     }
     $aUser = Phpfox::getService('user')->get($aExtraProfile['user_id']);
     $this->setParam('aExtraProfile', $aExtraProfile);
     $this->template()->assign(array('aExtraProfile' => $aExtraProfile));
     if (Phpfox::getService('user.block')->isBlocked($aExtraProfile['user_id'], Phpfox::getUserId()) && !Phpfox::getUserParam('user.can_override_user_privacy')) {
         $this->url()->send($aUser['user_name']);
     }
     if (!Phpfox::getService('user.privacy')->hasAccess($aExtraProfile['user_id'], 'profile.view_profile')) {
         $this->url()->send($aUser['user_name']);
     }
     if (!empty($sSection) && $sSection == 'photo') {
         $this->setParam('aParentModule', array('module_id' => 'profiles', 'item_id' => $aExtraProfile['extra_id'], 'url' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url'])));
         $this->template()->setTitle($aExtraProfile['title'])->setBreadcrumb($aExtraProfile['title'], $this->url()->makeUrl('profiles', $aExtraProfile['title_url']));
         $this->url()->aRewrite['photo/add/'] = 'profiles/redirect/photo/add/' . $aExtraProfile['extra_id'];
         $this->url()->aReverseRewrite['profiles/redirect/photo/add/' . $aExtraProfile['extra_id']] = 'photo/add/';
     }
     Phpfox::getUserParam('profile.can_view_users_profile', true);
     $this->template()->setHeader('cache', array('profile.css' => 'style_css', 'feed.js' => 'module_feed'));
     $this->template()->setMeta('description', Phpfox::getPhrase('profiles.meta_description', array('extra_name' => $aExtraProfile['title'], 'site_title' => Phpfox::getParam('core.site_title'), 'meta_description_profile' => Phpfox::getParam('core.meta_description_profile'))));
     $sPageTitle = $aExtraProfile['title'];
     $this->setParam('aFeed', array('comment_type_id' => 'profiles', 'privacy' => 0, 'comment_privacy' => 0, 'item_id' => $aExtraProfile['extra_id'], 'like_type_id' => 'profiles', 'feed_is_liked' => isset($aExtraProfile['is_liked']) ? $aExtraProfile['is_liked'] : false, 'user_id' => $aExtraProfile['user_id'], 'total_comment' => $aExtraProfile['total_comment'], 'total_like' => 0, 'feed_link' => $this->url()->makeUrl('profiles', $aExtraProfile['title_url']), 'feed_title' => $aExtraProfile['title'], 'feed_display' => 'view', 'report_module' => 'profiles', 'report_phrase' => Phpfox::getPhrase('profiles.report_this_profile')));
     $this->template()->setTitle($sPageTitle)->setEditor(array('load' => 'simple', 'wysiwyg' => Phpfox::isModule('comment') && Phpfox::getParam('comment.wysiwyg_comments') && Phpfox::getUserParam('comment.wysiwyg_on_comments')))->setUrl('profiles')->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'));
     if ($this->request()->get('update')) {
         $this->template()->setHeader('<script type="text/javascript">window.parent.tb_remove();</script>');
     }
     Phpfox::getComponent('photo.index', array('bNoTemplate' => true), 'controller');
     $this->setParam('global_moderation', array('name' => 'photo', 'ajax' => 'profiles.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('photo.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('photo.approve'), 'action' => 'approve'))));
 }
コード例 #8
0
ファイル: profile.class.php プロジェクト: hoanghd/tools
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		$this->setParam('bIsProfile', true);
		
		if ($this->request()->get('req3') == 'albums')
		{
			$this->template()->assign('sReq3', 'albums');
			Phpfox::getComponent('photo.albums', array('bNoTemplate' => true), 'controller');			
		}
		else 
		{
			$this->template()->assign('sReq3', 'photo');
			Phpfox::getComponent('photo.index', array('bNoTemplate' => true), 'controller');
		}
	}
コード例 #9
0
ファイル: profile.class.php プロジェクト: Lovinity/EQM
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $this->setParam('bIsProfile', true);
     if ($sPlugin = Phpfox_Plugin::get('photo.component_controller_profile_1')) {
         eval($sPlugin);
         if (isset($mReturnFromPlugin)) {
             return $mReturnFromPlugin;
         }
     }
     $aUser = $this->getParam('aUser');
     $aInfo = array('total_albums' => Phpfox::getService('photo.album')->getAlbumCount($aUser['user_id']), 'total_photos' => $aUser['total_photo']);
     $bShowPhotos = $this->request()->get('req3') != 'albums';
     if ($this->request()->get('req3') == '') {
         $bShowPhotos = Phpfox::getParam('photo.in_main_photo_section_show') != 'albums';
     }
     $this->template()->setHeader(array('profile.css' => 'module_photo'))->assign(array('aInfo' => $aInfo, 'bShowPhotos' => $bShowPhotos, 'sLinkPhotos' => $this->url()->makeUrl($aUser['user_name'] . '.photo.photos'), 'sLinkAlbums' => $this->url()->makeUrl($aUser['user_name'] . '.photo.albums')));
     if ($this->request()->get('req3') == 'albums') {
         $this->template()->assign('sReq3', 'albums');
         Phpfox::getComponent('photo.albums', array('bNoTemplate' => true), 'controller');
     } else {
         $this->template()->assign('sReq3', 'photo');
         Phpfox::getComponent('photo.index', array('bNoTemplate' => true), 'controller');
     }
 }
コード例 #10
0
ファイル: index.class.php プロジェクト: googlesky/snsp.vn
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (Phpfox::getParam('photo.show_info_on_mouseover')) {
         $this->template()->setHeader(array('index.css' => 'module_photo', 'index.js' => 'module_photo'));
     }
     if (defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW')) {
         $aUser = !defined('PHPFOX_IS_PAGES_VIEW') ? $this->getParam('aUser') : $this->getParam('aPage');
         $bShowPhotos = $this->request()->get('req3') != 'albums' || $this->request()->get('req4') != 'albums';
         if ($this->request()->get('req3') == '' || $this->request()->get('req4') == '') {
             $bShowPhotos = Phpfox::getParam('photo.in_main_photo_section_show') != 'albums';
         }
         if (defined('PHPFOX_IS_PAGES_VIEW')) {
             $this->template()->setHeader(array('photo.css' => 'module_pages'));
             if (empty($aUser['vanity_url'])) {
                 $aUser['user_name'] = 'pages.' . $aUser['page_id'];
             } else {
                 $aUser['user_name'] = $aUser['vanity_url'];
             }
             $aUser['profile_page_id'] = 0;
             $aInfo = array('total_albums' => Phpfox::callback('pages.getAlbumCount', $aUser['page_id']), 'total_photos' => Phpfox::callback('pages.getPhotoCount', $aUser['page_id']));
         } else {
             $aInfo = array('total_albums' => Phpfox::getService('photo.album')->getAlbumCount($aUser['user_id']), 'total_photos' => $aUser['total_photo']);
         }
         $bSpecialMenu = !defined('PHPFOX_IS_AJAX_CONTROLLER');
         $this->template()->assign(array('bSpecialMenu' => $bSpecialMenu, 'aInfo' => $aInfo, 'bShowPhotos' => $bShowPhotos, 'sLinkPhotos' => $this->url()->makeUrl($aUser['user_name'] . '.photo.photos'), 'sLinkAlbums' => $this->url()->makeUrl($aUser['user_name'] . '.photo.albums')));
     } else {
         $this->template()->assign(array('bSpecialMenu' => false));
     }
     if (Phpfox::getParam('photo.show_info_on_mouseover') && isset($aUser['use_timeline']) && $aUser['use_timeline']) {
         $this->template()->setFullSite();
     }
     if (!$this->request()->get('delete') && defined('PHPFOX_IS_PAGES_VIEW') && ($this->request()->get('req3') == 'albums' || $this->request()->get('req4') == 'albums')) {
         Phpfox::getComponent('photo.albums', array('bNoTemplate' => true), 'controller');
         return;
     }
     if ((defined('PHPFOX_IS_USER_PROFILE') || !defined('PHPFOX_IS_USER_PROFILE')) && $this->request()->get('req3') != 'photos' && !in_array($this->request()->get('view'), array('my', 'photos', 'pending')) && !is_numeric($this->request()->get('req2')) && Phpfox::getParam('photo.in_main_photo_section_show') == 'albums' && !$this->request()->get('delete') && !$this->request()->get('search-id')) {
         Phpfox::getComponent('photo.albums', array('bNoTemplate' => true), 'controller');
         return;
     }
     $sAssert = $this->request()->get('req4', false);
     if (($this->request()->get('req3') == 'photos' || $this->request()->get('req3') == 'albums') && $sAssert == false) {
     } else {
         if (defined('PHPFOX_IS_USER_PROFILE') && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle)) {
             if (($sLegacyPhoto = $this->request()->get('req4')) && !empty($sLegacyPhoto)) {
                 $aLegacyItem = Phpfox::getService('core')->getLegacyItem(array('field' => array('photo_id', 'title'), 'table' => 'photo', 'redirect' => 'photo', 'title' => $sLegacyPhoto));
             } else {
                 $aLegacyItem = Phpfox::getService('core')->getLegacyItem(array('field' => array('album_id', 'name'), 'table' => 'photo_album', 'redirect' => 'photo.album', 'title' => $sLegacyTitle, 'search' => 'name_url'));
             }
         }
     }
     Phpfox::getUserParam('photo.can_view_photos', true);
     if ($this->request()->get('req2') == 'category') {
         $_SESSION['photo_category'] = $this->request()->get('req3');
         $this->template()->setHeader(array('<script type="text/javascript"> var sPhotoCategory = "' . $this->request()->get('req3') . '"; </script>'))->assign(array('sPhotoCategory' => $this->request()->get('req3')));
     } else {
         $_SESSION['photo_category'] = '';
     }
     $aParentModule = $this->getParam('aParentModule');
     if (($iRedirectId = $this->request()->getInt('redirect')) && ($aPhoto = Phpfox::getService('photo')->getForEdit($iRedirectId))) {
         if ($aPhoto['group_id']) {
             $aGroup = Phpfox::getService('group')->getGroup($aPhoto['group_id'], true);
             $this->url()->send('group', array($aGroup['title_url'], 'photo', 'view', $aPhoto['title_url']));
         } else {
             $this->url()->send($aPhoto['user_name'], array('photo', $aPhoto['album_id'] ? $aPhoto['album_url'] : 'view', $aPhoto['title_url']));
         }
     }
     if (($iRedirectAlbumId = $this->request()->getInt('aredirect')) && ($aAlbum = Phpfox::getService('photo.album')->getForEdit($iRedirectAlbumId))) {
         $this->url()->send($aAlbum['user_name'], array('photo', $aAlbum['name_url']));
     }
     if (($iUnFeature = $this->request()->getInt('unfeature')) && Phpfox::getUserParam('photo.can_feature_photo')) {
         if (Phpfox::getService('photo.process')->feature($iUnFeature, 0)) {
             $this->url()->send('photo', null, Phpfox::getPhrase('photo.photo_successfully_unfeatured'));
         }
     }
     if (empty($aParentModule) && $this->request()->get('req1') == 'pages') {
         $aParentModule = array('module_id' => 'pages', 'item_id' => $this->request()->get('req2'), 'url' => Phpfox::getService('pages')->getUrl($this->request()->get('req2')));
         define('PHPFOX_IS_PAGES_VIEW', true);
     }
     if ($aParentModule === null && $this->request()->getInt('req2') > 0) {
         return Phpfox::getLib('module')->setController('photo.view');
     }
     if (($sLegacyTitle = $this->request()->get('req2')) && !empty($sLegacyTitle) && !is_numeric($sLegacyTitle)) {
         if ((defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW')) && $sLegacyTitle == 'photo') {
         } else {
             if ($this->request()->get('req3') != '') {
                 $sLegacyTitle = $this->request()->get('req3');
             }
             $aLegacyItem = Phpfox::getService('core')->getLegacyItem(array('field' => array('category_id', 'name'), 'table' => 'photo_category', 'redirect' => 'photo.category', 'title' => $sLegacyTitle, 'search' => 'name_url'));
         }
     }
     $bIsUserProfile = false;
     if (defined('PHPFOX_IS_AJAX_CONTROLLER') || defined('PHPFOX_LOADING_DELAYED')) {
         if ($this->request()->get('profile_id', null) !== null) {
             $aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
             $bIsUserProfile = true;
             $this->setParam('aUser', $aUser);
         } else {
             if ($this->request()->get('req1', null) !== null) {
                 if ($aUser = Phpfox::getService('user')->get($this->request()->get('req1'), false)) {
                     $bIsUserProfile = true;
                     $this->setParam('aUser', $aUser);
                 }
             }
         }
     }
     // Used to control privacy
     $bNoAccess = false;
     if (defined('PHPFOX_IS_USER_PROFILE')) {
         $bIsUserProfile = true;
         $aUser = $this->getParam('aUser');
         if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'photo.display_on_profile')) {
             $bNoAccess = true;
         }
     }
     if (isset($aUser) && $aUser['profile_page_id'] != 0) {
         $bIsUserProfile = false;
         $aParentModule = array('module_id' => 'pages', 'item_id' => $aUser['profile_page_id'], 'url' => Phpfox::getService('pages')->getUrl($aUser['profile_page_id']));
         define('PHPFOX_IS_PAGES_VIEW', true);
     }
     $aCallback = $this->getParam('aCallback', null);
     if (PHPFOX_IS_AJAX) {
         if ($this->request()->get('req1') == 'group') {
             $aGroup = Phpfox::getService('group')->getGroup($this->request()->get('req2'));
             if (isset($aGroup['group_id'])) {
                 $aCallback = array('group_id' => $aGroup['group_id'], 'url_home' => 'group.' . $aGroup['title_url'] . '.photo', 'url_home_array' => array('group', array($aGroup['title_url'])));
             }
         }
     }
     // http://www.phpfox.com/tracker/view/15103
     if (!isset($aUser) && defined('PHPFOX_IS_PAGES_VIEW')) {
         $aUser = $this->getParam('aUser');
     }
     $sCategory = null;
     $aSearch = $this->request()->getArray('search');
     $bIsTagSearch = false;
     $sPhotoUrl = $bIsUserProfile ? $this->url()->makeUrl($aUser['user_name'], 'photo') : ($aParentModule === null ? $this->url()->makeUrl('photo') : $aParentModule['url'] . 'photo/');
     $this->setParam('sTagType', 'photo');
     $sView = $this->request()->get('view', false);
     if ($iDeleteId = $this->request()->get('delete')) {
         if (Phpfox::getService('photo.process')->delete($iDeleteId)) {
             $this->url()->forward($sPhotoUrl, Phpfox::getPhrase('photo.photo_successfully_deleted'));
         }
     }
     $aSort = array('latest' => array('photo.photo_id', Phpfox::getPhrase('photo.latest')), 'most-viewed' => array('photo.total_view', Phpfox::getPhrase('photo.most_viewed')), 'most-talked' => array('photo.total_comment', Phpfox::getPhrase('photo.most_discussed')));
     if (Phpfox::getParam('photo.can_rate_on_photos')) {
         $aSort['top-rating'] = array('photo.total_rating', Phpfox::getPhrase('photo.top_rated'));
     }
     if (Phpfox::getParam('photo.enable_photo_battle')) {
         $aSort['top-battle'] = array('photo.total_battle', Phpfox::getPhrase('photo.top_battle'));
     }
     $aPhotoDisplays = Phpfox::getUserParam('photo.total_photos_displays');
     $this->search()->set(array('type' => 'photo', 'field' => 'photo.photo_id', 'search_tool' => array('table_alias' => 'photo', 'search' => array('action' => $sPhotoUrl, 'default_value' => Phpfox::getPhrase('photo.search_photos'), 'name' => 'search', 'field' => 'photo.title'), 'sort' => $aSort, 'show' => (array) $aPhotoDisplays)));
     $aBrowseParams = array('module_id' => 'photo', 'alias' => 'photo', 'field' => 'photo_id', 'table' => Phpfox::getT('photo'), 'hide_view' => array('pending', 'my'));
     $bIsMassEditUpload = false;
     $bRunPlugin = false;
     if (($sPlugin = Phpfox_Plugin::get('photo.component_controller_index_brunplugin1')) && eval($sPlugin) === false) {
         return false;
     }
     switch ($sView) {
         case 'pending':
             Phpfox::getUserParam('photo.can_approve_photos', true);
             $this->search()->setCondition('AND photo.view_id = 1');
             $this->template()->assign('bIsInApproveMode', true);
             break;
         case 'my':
             Phpfox::isUser(true);
             $this->search()->setCondition('AND photo.user_id = ' . Phpfox::getUserId());
             if ($this->request()->get('mode') == 'edit') {
                 list($iAlbumCnt, $aAlbums) = Phpfox::getService('photo.album')->get('pa.user_id = ' . Phpfox::getUserId());
                 $this->template()->assign('bIsEditMode', true);
                 $this->template()->assign('aAlbums', $aAlbums);
                 if ($sEditPhotos = $this->request()->get('photos')) {
                     $sEditPhotos = base64_decode(urldecode($sEditPhotos));
                     $aEditPhotos = explode(',', $sEditPhotos);
                     $sPhotoList = '';
                     foreach ($aEditPhotos as $iPhotoId) {
                         if (empty($iPhotoId)) {
                             continue;
                         }
                         $sPhotoList .= (int) $iPhotoId . ',';
                     }
                     $sPhotoList = rtrim($sPhotoList, ',');
                     if (!empty($sPhotoList)) {
                         $bIsMassEditUpload = true;
                         $this->search()->setCondition('AND photo.photo_id IN(' . $sPhotoList . ')');
                     }
                 }
             }
             break;
         default:
             if ($bRunPlugin) {
                 ($sPlugin = Phpfox_Plugin::get('photo.component_controller_index_plugin1')) ? eval($sPlugin) : false;
             } elseif ($bIsUserProfile) {
                 $this->search()->setCondition('AND photo.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND photo.user_id = ' . (int) $aUser['user_id']);
             } else {
                 if (defined('PHPFOX_IS_PAGES_VIEW')) {
                     $this->search()->setCondition('AND photo.view_id = 0 AND photo.module_id = \'' . Phpfox::getLib('database')->escape($aParentModule['module_id']) . '\' AND photo.group_id = ' . (int) $aParentModule['item_id'] . ' AND photo.privacy IN(%PRIVACY%)');
                 } else {
                     $this->search()->setCondition('AND photo.view_id = 0 AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(%PRIVACY%)');
                 }
             }
             break;
     }
     if ($this->request()->get('req2') == 'category') {
         $sCategory = $iCategory = $this->request()->getInt('req3');
         $sWhere = 'AND pcd.category_id = ' . (int) $sCategory;
         if (!is_int($iCategory)) {
             $iCategory = Phpfox::getService('photo.category')->getCategoryId($sCategory);
         }
         // Get sub-categories
         $aSubCategories = Phpfox::getService('photo.category')->getForBrowse($iCategory);
         if (!empty($aSubCategories) && is_array($aSubCategories)) {
             $aSubIds = Phpfox::getService('photo.category')->extractCategories($aSubCategories);
             if (!empty($aSubIds)) {
                 $sWhere = 'AND pcd.category_id IN (' . (int) $sCategory . ',' . join(',', $aSubIds) . ')';
             }
         }
         $this->search()->setCondition($sWhere);
         $this->setParam('hasSubCategories', true);
     }
     if ($this->request()->get('req2') == 'tag') {
         if ($aTag = Phpfox::getService('tag')->getTagInfo('photo', $this->request()->get('req3'))) {
             $this->template()->setBreadCrumb(Phpfox::getPhrase('tag.topic') . ': ' . $aTag['tag_text'] . '', $this->url()->makeUrl('current'), true);
             $this->search()->setCondition('AND tag.tag_text = \'' . Phpfox::getLib('database')->escape($aTag['tag_text']) . '\'');
         }
     }
     if ($sView == 'featured') {
         $this->search()->setCondition('AND photo.is_featured = 1');
     }
     Phpfox::getService('photo.browse')->category($sCategory);
     if (!Phpfox::getParam('photo.display_profile_photo_within_gallery')) {
         $this->search()->setCondition('AND photo.is_profile_photo = 0');
     }
     $this->search()->browse()->params($aBrowseParams)->execute();
     if ($bNoAccess == false) {
         $aPhotos = $this->search()->browse()->getRows();
         $iCnt = $this->search()->browse()->getCount();
     } else {
         $aPhotos = array();
         $iCnt = 0;
     }
     foreach ($aPhotos as $aPhoto) {
         $this->template()->setMeta('keywords', $this->template()->getKeywords($aPhoto['title']));
     }
     $aPager = array('page' => $this->search()->getPage(), 'size' => $this->search()->getDisplay(), 'count' => $this->search()->browse()->getCount());
     if (Phpfox::getParam('photo.show_info_on_mouseover')) {
         $aPager['ajax'] = 'photo.browse';
     }
     if ($aPager['size'] > Phpfox::getUserParam('photo.max_photo_display_limit')) {
         $aPager['size'] = Phpfox::getUserParam('photo.max_photo_display_limit');
     }
     Phpfox::getLib('pager')->set($aPager);
     $this->template()->setTitle($bIsUserProfile ? Phpfox::getPhrase('photo.full_name_s_photos', array('full_name' => $aUser['full_name'])) : Phpfox::getPhrase('photo.photos'))->setBreadcrumb(Phpfox::getPhrase('photo.photos'), $sPhotoUrl)->setMeta('keywords', Phpfox::getParam('photo.photo_meta_keywords'))->setMeta('description', Phpfox::getParam('photo.photo_meta_description'));
     //->setMeta('description', Phpfox::getPhrase('photo.site_title_has_a_total_of_total_photo_s', array('site_title' => Phpfox::getParam('core.site_title'), 'total' => $iCnt)))
     if (defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW')) {
         $this->template()->setMeta('description', Phpfox::getPhrase('photo.site_title_has_a_total_of_total_photo_s', array('site_title' => $aUser['full_name'], 'total' => $iCnt)));
     } else {
         $this->template()->setMeta('description', Phpfox::getPhrase('photo.site_title_has_a_total_of_total_photo_s', array('site_title' => Phpfox::getParam('core.site_title'), 'total' => $iCnt)));
     }
     $this->template()->setPhrase(array('photo.loading'))->setHeader('cache', array('progress.js' => 'static_script', 'browse.js' => 'module_photo', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/imgnotes/jquery.tag.js' => 'static_script', 'imgnotes.css' => 'style_css', 'quick_edit.js' => 'static_script', 'comment.css' => 'style_css', 'pager.css' => 'style_css', 'view.js' => 'module_photo', 'photo.js' => 'module_photo', 'switch_legend.js' => 'static_script', 'switch_menu.js' => 'static_script', 'view.css' => 'module_photo', 'feed.js' => 'module_feed', 'browse.css' => 'module_photo', 'edit.css' => 'module_photo', 'index.js' => 'module_photo'))->assign(array('aPhotos' => $aPhotos, 'bIsAjax' => PHPFOX_IS_AJAX, 'sPhotoUrl' => $sPhotoUrl, 'sView' => $sView, 'bIsMassEditUpload' => $bIsMassEditUpload, 'iPhotosPerRow' => 3));
     if ($this->request()->get('req2') == 'category' && isset($aPhoto) && isset($aPhoto['category_name']) && isset($aPhoto['category_id'])) {
         $sCatUrl = str_replace(' ', '-', strtolower($aPhoto['category_name']));
         $this->template()->setBreadcrumb($aPhoto['category_name'], $this->url()->makeUrl('photo.category.' . $aPhoto['category_id'] . '.') . $sCatUrl . '/');
     }
     if ($aParentModule === null) {
         Phpfox::getService('photo')->buildMenu();
     }
     if (!empty($sCategory)) {
         $aCategories = Phpfox::getService('photo.category')->getParentBreadcrumb($sCategory);
         $iCnt = 0;
         foreach ($aCategories as $aCategory) {
             $iCnt++;
             $this->template()->setTitle($aCategory[0]);
             /*
             if ($aCallback !== null)
             {
             	$sHomeUrl = '/' . Phpfox::getLib('url')->doRewrite($aCallback['url_home_array'][0]) . '/' . implode('/', $aCallback['url_home_array'][1]) . '/' . Phpfox::getLib('url')->doRewrite('photo') . '/';	
             	$aCategory[1] = preg_replace('/^http:\/\/(.*?)\/' . Phpfox::getLib('url')->doRewrite('photo') . '\/(.*?)$/i', 'http://\\1' . $sHomeUrl . '\\2', $aCategory[1]);						
             }				
             */
             $this->template()->setBreadcrumb($aCategory[0], $aCategory[1], $iCnt === count($aCategories) ? true : false);
         }
     }
     $this->setParam('sCurrentCategory', $sCategory);
     $this->setParam('global_moderation', array('name' => 'photo', 'ajax' => 'photo.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('photo.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('photo.approve'), 'action' => 'approve'))));
     $iStartCheck = 0;
     if (!empty($sCategory)) {
         $iStartCheck = 5;
     }
     if (!defined('PHPFOX_ALLOW_ID_404_CHECK')) {
         $iAllowIds = uniqid();
         define('PHPFOX_ALLOW_ID_404_CHECK', $iAllowIds);
     } else {
         $iAllowIds = PHPFOX_ALLOW_ID_404_CHECK;
     }
     $aRediAllow = array('category', $iAllowIds);
     if (defined('PHPFOX_IS_USER_PROFILE') && PHPFOX_IS_USER_PROFILE) {
         $aRediAllow[] = 'photo';
     }
     $aCheckParams = array('url' => $this->url()->makeUrl('photo'), 'start' => $iStartCheck, 'reqs' => array('2' => $aRediAllow, '3' => $aRediAllow), 'reserved' => array('mode', 'photos'));
     if (Phpfox::getParam('core.force_404_check') && !Phpfox::getService('core.redirect')->check404($aCheckParams)) {
         return Phpfox::getLib('module')->setController('error.404');
     }
 }
コード例 #11
0
ファイル: token.php プロジェクト: googlesky/snsp.vn
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: token.php 7004 2013-12-20 14:23:28Z Raymond_Benc $
 */
// Make sure we are running PHP5
if (version_compare(phpversion(), '5', '<') === true) {
    exit('phpFox 2 or higher requires PHP 5 or newer.');
}
ob_start();
/**
 * Key to include phpFox
 *
 */
define('PHPFOX', true);
/**
 * Directory Seperator
 *
 */
define('PHPFOX_DS', DIRECTORY_SEPARATOR);
/**
 * phpFox Root Directory
 *
 */
define('PHPFOX_DIR', dirname(__FILE__) . PHPFOX_DS);
define('PHPFOX_START_TIME', array_sum(explode(' ', microtime())));
// Require phpFox Init
require PHPFOX_DIR . 'include' . PHPFOX_DS . 'init.inc.php';
Phpfox::getComponent('api.token', array(), 'controller');
ob_end_flush();
コード例 #12
0
ファイル: view.class.php プロジェクト: laiello/kr-indian
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::getUserParam('organization.can_view_browse_organization', true);
     $mId = $this->request()->getInt('req2');
     if (!($aOrganization = Phpfox::getService('organization')->getForView($mId))) {
         return Phpfox_Error::display(Phpfox::getPhrase('organization.the_organization_you_are_looking_for_cannot_be_found'));
     }
     if ($this->request()->get('req3') != '') {
         $this->template()->assign(array('bRefreshPhoto' => true));
     }
     if (Phpfox::getUserParam('organization.can_moderate_organization') || $aOrganization['is_admin']) {
     } else {
         if ($aOrganization['view_id'] != '0') {
             return Phpfox_Error::display(Phpfox::getPhrase('organization.the_organization_you_are_looking_for_cannot_be_found'));
         }
     }
     if ($aOrganization['view_id'] == '2') {
         return Phpfox_Error::display(Phpfox::getPhrase('organization.the_organization_you_are_looking_for_cannot_be_found'));
     }
     if (Phpfox::isMobile()) {
         $aPageMenus = Phpfox::getService('organization')->getMenu($aOrganization);
         $aFilterMenu = array();
         foreach ($aPageMenus as $aPageMenu) {
             $aFilterMenu[$aPageMenu['phrase']] = $aPageMenu['url'];
         }
         $this->template()->buildSectionMenu('organization', $aFilterMenu);
     }
     if (Phpfox::getUserBy('profile_organization_id') <= 0 && Phpfox::isModule('privacy')) {
         Phpfox::getService('privacy')->check('organization', $aOrganization['organization_id'], $aOrganization['user_id'], $aOrganization['privacy'], isset($aOrganization['is_friend']) ? $aOrganization['is_friend'] : 0);
     }
     $bCanViewPage = true;
     // http://www.phpfox.com/tracker/view/15190/
     $sCurrentModule = Phpfox::getLib('url')->reverseRewrite($this->request()->get($this->request()->get('req1') == 'organization' ? 'req3' : 'req2'));
     Phpfox::getService('organization')->buildWidgets($aOrganization['organization_id']);
     if ($aOrganization['designer_style_id']) {
         $this->template()->setStyle(array('style_id' => $aOrganization['designer_style_id'], 'style_folder_name' => $aOrganization['designer_style_folder'], 'theme_folder_name' => $aOrganization['designer_theme_folder'], 'theme_parent_id' => $aOrganization['theme_parent_id'], 'total_column' => $aOrganization['total_column'], 'l_width' => $aOrganization['l_width'], 'c_width' => $aOrganization['c_width'], 'r_width' => $aOrganization['r_width']));
     }
     ($sPlugin = Phpfox_Plugin::get('organization.component_controller_view_build')) ? eval($sPlugin) : false;
     $this->setParam('aParentModule', array('module_id' => 'organization', 'item_id' => $aOrganization['organization_id'], 'url' => Phpfox::getService('organization')->getUrl($aOrganization['organization_id'], $aOrganization['title'], $aOrganization['vanity_url'])));
     if (isset($aOrganization['is_admin']) && $aOrganization['is_admin']) {
         define('PHPFOX_IS_ORGANIZATION_ADMIN', true);
     }
     $sModule = $sCurrentModule;
     // http://www.phpfox.com/tracker/view/15190/
     if (empty($sModule) && !empty($aOrganization['landing_organization'])) {
         $sModule = $aOrganization['landing_organization'];
         $sCurrentModule = $aOrganization['landing_organization'];
     }
     ($sPlugin = Phpfox_Plugin::get('organization.component_controller_view_assign')) ? eval($sPlugin) : false;
     if (isset($aOrganization['use_timeline']) && $aOrganization['use_timeline']) {
         $aPageMenus = Phpfox::getService('organization')->getMenu($aOrganization);
         if (!defined('ORGANIZATION_TIME_LINE')) {
             define('ORGANIZATION_TIME_LINE', true);
         }
         $aOrganization['user_name'] = $aOrganization['title'];
         $this->template()->setFullSite()->assign(array('aUser' => $aOrganization, 'aProfileLinks' => $aPageMenus))->setHeader(array('<script type="text/javascript">oParams["keepContent4"] = false;</script>'));
     }
     $this->setParam('aOrganization', $aOrganization);
     $this->template()->assign(array('aOrganization' => $aOrganization, 'sCurrentModule' => $sCurrentModule, 'bCanViewOrganization' => $bCanViewPage, 'iViewCommentId' => $this->request()->getInt('comment-id'), 'bHasPermToViewOrganizationFeed' => Phpfox::getService('organization')->hasPerm($aOrganization['organization_id'], 'organization.view_browse_updates')))->setHeader('cache', array('profile.css' => 'style_css', 'pages.css' => 'style_css', 'organization.js' => 'module_organization', 'player/flowplayer/flowplayer.js' => 'static_script'));
     if (Phpfox::isMobile()) {
         $this->template()->setBreadcrumb($aOrganization['title'], Phpfox::getService('organization')->getUrl($aOrganization['organization_id'], $aOrganization['title'], $aOrganization['vanity_url']), true);
     }
     $this->setParam('aCallbackShoutbox', array('module' => 'organization', 'item' => $aOrganization['organization_id']));
     if ($bCanViewPage && $sModule != 'photo' && $sModule && Phpfox::isModule($sModule) && Phpfox::hasCallback($sModule, 'getOrganizationSubMenu') && !$this->request()->getInt('comment-id')) {
         if (Phpfox::hasCallback($sModule, 'canViewOrganizationSection') && !Phpfox::callback($sModule . '.canViewOrganizationSection', $aOrganization['organization_id'])) {
             return Phpfox_Error::display(Phpfox::getPhrase('organization.unable_to_view_this_section_due_to_privacy_settings'));
         }
         $this->template()->assign('bIsOrganizationViewSection', true);
         $this->setParam('bIsOrganizationViewSection', true);
         $this->setParam('sCurrentOrganizationModule', $sModule);
         Phpfox::getComponent($sModule . '.index', array('bNoTemplate' => true), 'controller');
     } elseif ($bCanViewPage && $sModule != 'photo' && $sModule && Phpfox::getService('organization')->isWidget($sModule) && !$this->request()->getInt('comment-id')) {
         define('PHPFOX_IS_ORGANIZATION_WIDGET', true);
         $this->template()->assign(array('aWidget' => Phpfox::getService('organization')->getWidget($sModule)));
     } else {
         $sSubController = $this->request()->get('req3');
         if ($sSubController == 'info') {
             return Phpfox::getComponent('organization.info', array('bNoTemplate' => true), 'controller');
         } else {
             if ($sSubController == 'volunteer') {
                 return Phpfox::getComponent('organization.volunteer', array('bNoTemplate' => true), 'controller');
             } else {
                 if ($sSubController == 'photo') {
                     return Phpfox::getComponent('organization.photo', array('bNoTemplate' => true), 'controller');
                 }
             }
         }
         $bCanPostComment = true;
         if ($sCurrentModule == 'pending') {
             $this->template()->assign('aPendingUsers', Phpfox::getService('organization')->getPendingUsers($aOrganization['organization_id']));
             $this->setParam('global_moderation', array('name' => 'organization', 'ajax' => 'organization.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('organization.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('organization.approve'), 'action' => 'approve'))));
         }
         if (Phpfox::getService('organization')->isAdmin($aOrganization)) {
             define('PHPFOX_FEED_CAN_DELETE', true);
         }
         if (Phpfox::getUserId()) {
             $bIsBlocked = Phpfox::getService('user.block')->isBlocked($aOrganization['user_id'], Phpfox::getUserId());
             if ($bIsBlocked) {
                 $bCanPostComment = false;
             }
         }
         // http://www.phpfox.com/tracker/view/15316/
         if ($sCurrentModule != 'info') {
             define('PHPFOX_IS_ORGANIZATION_IS_INDEX', true);
         }
         $this->setParam('aFeedCallback', array('module' => 'organization', 'table_prefix' => 'organization_', 'ajax_request' => 'organization.addFeedComment', 'item_id' => $aOrganization['organization_id'], 'disable_share' => $bCanPostComment ? false : true, 'feed_comment' => 'organization_comment'));
         if (isset($aOrganization['text']) && !empty($aOrganization['text'])) {
             $this->template()->setMeta('description', $aOrganization['text']);
         }
         $this->template()->setTitle($aOrganization['title'])->setEditor()->setHeader('cache', array('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', 'index.css' => 'module_organization', 'feed.js' => 'module_feed'));
         if (Phpfox::getParam('video.convert_servers_enable')) {
             $this->template()->setHeader('<script type="text/javascript">document.domain = "' . Phpfox::getParam('video.convert_js_parent') . '";</script>');
         }
         if ($sModule == 'designer' && $aOrganization['is_admin']) {
             Phpfox::getUserParam('organization.can_design_organization', true);
             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' => $aOrganization['designer_style_id'], 'design_header' => 'Customize organization', 'current_organization' => Phpfox::getService('organization')->getUrl($aOrganization['organization_id'], $aOrganization['title'], $aOrganization['vanity_url']), 'design_organization' => Phpfox::getService('organization')->getUrl($aOrganization['organization_id'], $aOrganization['title'], $aOrganization['vanity_url']) . 'designer/', 'block' => 'organization.view', 'item_id' => $aOrganization['organization_id'], 'type_id' => 'organization');
             $this->setParam('aDesigner', $aDesigner);
             $this->template()->setHeader('cache', array('jquery/ui.js' => 'static_script', 'sort.js' => 'module_theme', 'style.css' => 'style_css', 'select.js' => 'module_theme', 'design.js' => 'module_theme'))->setHeader(array('<script type="text/javascript">$Behavior.organization_controller_view_designonuptade = function() { function designOnUpdate() { $Core.design.updateSorting(); } };</script>', '<script type="text/javascript">$Behavior.organization_controller_view_design_init = function() { $Core.design.init({type_id: \'organization\', item_id: \'' . $aOrganization['organization_id'] . '\'}); };</script>'))->assign('sCustomDesignId', $aOrganization['organization_id']);
         }
     }
 }
コード例 #13
0
ファイル: ajax.class.php プロジェクト: nima7r/phpfox-dist
 public function composeProcess()
 {
     Phpfox::isUser(true);
     $this->errorSet('#js_ajax_compose_error_message');
     $oObject = Phpfox::getComponent('mail.compose', null, 'controller');
     $this->call('$(\'#\' + tb_get_active()).find(\'.js_box_content:first\').html(\'<div class="message">' . str_replace("'", "\\'", Phpfox::getPhrase('mail.your_message_was_successfully_sent')) . '</div>\'); setTimeout(\'tb_remove();\', 2000);');
 }
コード例 #14
0
ファイル: ajax.class.php プロジェクト: hoanghd/tools
	public function composeProcess()
	{
		Phpfox::isUser(true);
		
		$this->errorSet('#js_ajax_compose_error_message');
		
		$oObject = Phpfox::getComponent('mail.compose', null, 'controller');
		
		if ($oObject->getReturn())
		{
			$this->call('$(\'#\' + tb_get_active()).find(\'.js_box_content:first\').html(\'<div class="message">Your message was successfully sent</div>\'); setTimeout(\'tb_remove();\', 2000);');
		}
	}
コード例 #15
0
ファイル: ajax.class.php プロジェクト: Lovinity/EQM
 public function view()
 {
     Phpfox::getComponent('photo.view', array(), 'controller');
     $aHeaderFiles = Phpfox::getLib('template')->getHeader(true);
     $aPhrases = Phpfox::getLib('template')->getPhrases();
     $sLoadFiles = '';
     $sEchoData = '';
     foreach ($aHeaderFiles as $sHeaderFile) {
         if (preg_match('/<style(.*)>(.*)<\\/style>/i', $sHeaderFile)) {
             continue;
         }
         $sHeaderFile = strip_tags($sHeaderFile);
         $sNew = preg_replace('/\\s+/', '', $sHeaderFile);
         if (empty($sNew)) {
             continue;
         }
         if (substr($sNew, 0, 13) == 'oTranslations') {
             continue;
         }
         if (strpos($sHeaderFile, 'custom.css') !== false) {
             continue;
         }
         $sLoadFiles .= '\'' . str_replace("'", "\\'", $sHeaderFile) . '\',';
     }
     $sLoadFiles = rtrim($sLoadFiles, ',');
     $sContent = $this->getContent(false);
     if (count($aPhrases) && is_array($aPhrases)) {
         $sPhrases = '<script type="text/javascript">';
         foreach ($aPhrases as $sKey => $sValue) {
             $sPhrases .= 'oTranslations[\'' . $sKey . '\'] = \'' . str_replace("'", "\\'", $sValue) . '\';';
         }
         $sPhrases .= '</script>';
         echo $sPhrases;
     }
     echo '<script type="text/javascript">$Core.loadStaticFiles([' . $sLoadFiles . ']);</script>';
     echo $sContent;
     echo '<script type="text/javascript">$Core.loadInit();</script>';
 }
コード例 #16
0
ファイル: user-mobile.class.php プロジェクト: Lovinity/EQM
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::getComponent('feed.user', array(), 'controller');
 }
コード例 #17
0
ファイル: ajax.class.php プロジェクト: noikiy/phpfox-dist
 public function mainBrowse()
 {
     Phpfox::getComponent('user.browse', array(), 'controller');
     $this->remove('.js_pager_view_more_link');
     $this->call("if(\$('#js_view_more_users').length == 0) { \$('#delayed_block').append('<div id=\"js_view_more_users\"></div>'); } ");
     $this->append('#js_view_more_users', $this->getContent(false));
     $this->call('$Core.loadInit();');
 }
コード例 #18
0
ファイル: ajax.class.php プロジェクト: googlesky/snsp.vn
 public function viewMore()
 {
     Phpfox::getComponent('blog.index', array(), 'controller');
     $this->remove('.js_pager_view_more_link');
     $this->append('#js_pager_view_more_holder', $this->getContent(false));
     $this->call('$Core.loadInit();');
 }
コード例 #19
0
ファイル: auth.php プロジェクト: noikiy/phpfox-v3-dist
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: auth.php 7004 2013-12-20 14:23:28Z Raymond_Benc $
 */
// Make sure we are running PHP5
if (version_compare(phpversion(), '5', '<') === true) {
    exit('phpFox 2 or higher requires PHP 5 or newer.');
}
ob_start();
/**
 * Key to include phpFox
 *
 */
define('PHPFOX', true);
/**
 * Directory Seperator
 *
 */
define('PHPFOX_DS', DIRECTORY_SEPARATOR);
/**
 * phpFox Root Directory
 *
 */
define('PHPFOX_DIR', dirname(__FILE__) . PHPFOX_DS);
define('PHPFOX_START_TIME', array_sum(explode(' ', microtime())));
// Require phpFox Init
require PHPFOX_DIR . 'include' . PHPFOX_DS . 'init.inc.php';
Phpfox::getComponent('apps.view', array(), 'controller');
ob_end_flush();
コード例 #20
0
ファイル: ajax.class.php プロジェクト: laiello/kr-indian
 public function forgetPasswordForm()
 {
     $this->setTitle('Password Request');
     Phpfox::getComponent('user.password.request', null, 'controller');
 }
コード例 #21
0
ファイル: view.class.php プロジェクト: noikiy/phpfox-dist
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('pages.can_view_browse_pages', true);
     $mId = $this->request()->getInt('req2');
     if (!($aPage = Phpfox::getService('pages')->getForView($mId))) {
         return Phpfox_Error::display(Phpfox::getPhrase('pages.the_page_you_are_looking_for_cannot_be_found'));
     }
     if ($this->request()->get('req3') != '') {
         $this->template()->assign(array('bRefreshPhoto' => true));
     }
     if (Phpfox::getUserParam('pages.can_moderate_pages') || $aPage['is_admin']) {
     } else {
         if ($aPage['view_id'] != '0') {
             return Phpfox_Error::display(Phpfox::getPhrase('pages.the_page_you_are_looking_for_cannot_be_found'));
         }
     }
     if ($aPage['view_id'] == '2') {
         return Phpfox_Error::display(Phpfox::getPhrase('pages.the_page_you_are_looking_for_cannot_be_found'));
     }
     if (Phpfox::getUserBy('profile_page_id') <= 0 && Phpfox::isModule('privacy')) {
         Privacy_Service_Privacy::instance()->check('pages', $aPage['page_id'], $aPage['user_id'], $aPage['privacy'], isset($aPage['is_friend']) ? $aPage['is_friend'] : 0);
     }
     $bCanViewPage = true;
     // http://www.phpfox.com/tracker/view/15190/
     $sCurrentModule = Phpfox_Url::instance()->reverseRewrite($this->request()->get($this->request()->get('req1') == 'pages' ? 'req3' : 'req2'));
     Phpfox::getService('pages')->buildWidgets($aPage['page_id']);
     ($sPlugin = Phpfox_Plugin::get('pages.component_controller_view_build')) ? eval($sPlugin) : false;
     $this->setParam('aParentModule', array('module_id' => 'pages', 'item_id' => $aPage['page_id'], 'url' => Phpfox::getService('pages')->getUrl($aPage['page_id'], $aPage['title'], $aPage['vanity_url'])));
     if (isset($aPage['is_admin']) && $aPage['is_admin']) {
         define('PHPFOX_IS_PAGE_ADMIN', true);
     }
     $sModule = $sCurrentModule;
     // http://www.phpfox.com/tracker/view/15190/
     if (empty($sModule) && !empty($aPage['landing_page'])) {
         $sModule = $aPage['landing_page'];
         $sCurrentModule = $aPage['landing_page'];
     }
     ($sPlugin = Phpfox_Plugin::get('pages.component_controller_view_assign')) ? eval($sPlugin) : false;
     /*
     if (isset($aPage['use_timeline']) && $aPage['use_timeline'])
     {
     	$aPageMenus = Phpfox::getService('pages')->getMenu($aPage);
     	if (!defined('PAGE_TIME_LINE'))
     	{
     		define('PAGE_TIME_LINE', true);
     	}
     	$aPage['user_name'] = $aPage['title'];
     
     	$this->template()->setFullSite()
     		->assign(array(
     		    'aUser' => $aPage,
     		    'aProfileLinks' => $aPageMenus))
     		->setHeader(array(
     			'<script type="text/javascript">oParams["keepContent4"] = false;</script>'
     			));
     }
     */
     $this->setParam('aPage', $aPage);
     $this->template()->assign(array('aPage' => $aPage, 'sCurrentModule' => $sCurrentModule, 'bCanViewPage' => $bCanViewPage, 'iViewCommentId' => $this->request()->getInt('comment-id'), 'bHasPermToViewPageFeed' => Phpfox::getService('pages')->hasPerm($aPage['page_id'], 'pages.view_browse_updates')))->setHeader('cache', array('profile.css' => 'style_css', 'pages.css' => 'style_css', 'pages.js' => 'module_pages'));
     if (Phpfox::isMobile()) {
         $this->template()->setBreadcrumb($aPage['title'], Phpfox::getService('pages')->getUrl($aPage['page_id'], $aPage['title'], $aPage['vanity_url']), true);
     }
     /*
     $this->setParam('aCallbackShoutbox', array(
     		'module' => 'pages',
     		'item' => $aPage['page_id']
     	)
     );
     */
     if ($bCanViewPage && $sModule && Phpfox::isModule($sModule) && Phpfox::hasCallback($sModule, 'getPageSubMenu') && !$this->request()->getInt('comment-id')) {
         if (Phpfox::hasCallback($sModule, 'canViewPageSection') && !Phpfox::callback($sModule . '.canViewPageSection', $aPage['page_id'])) {
             return Phpfox_Error::display(Phpfox::getPhrase('pages.unable_to_view_this_section_due_to_privacy_settings'));
         }
         $this->template()->assign('bIsPagesViewSection', true);
         $this->setParam('bIsPagesViewSection', true);
         $this->setParam('sCurrentPageModule', $sModule);
         Phpfox::getComponent($sModule . '.index', array('bNoTemplate' => true), 'controller');
         Phpfox_Module::instance()->resetBlocks();
     } elseif ($bCanViewPage && $sModule && Phpfox::getService('pages')->isWidget($sModule) && !$this->request()->getInt('comment-id')) {
         define('PHPFOX_IS_PAGES_WIDGET', true);
         $this->template()->assign(array('aWidget' => Phpfox::getService('pages')->getWidget($sModule)));
     } else {
         $bCanPostComment = true;
         if ($sCurrentModule == 'pending') {
             $this->template()->assign('aPendingUsers', Pages_Service_Pages::instance()->getPendingUsers($aPage['page_id']));
             $this->setParam('global_moderation', array('name' => 'pages', 'ajax' => 'pages.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('pages.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('pages.approve'), 'action' => 'approve'))));
         }
         if (Phpfox::getService('pages')->isAdmin($aPage)) {
             define('PHPFOX_FEED_CAN_DELETE', true);
         }
         if (Phpfox::getUserId()) {
             $bIsBlocked = Phpfox::getService('user.block')->isBlocked($aPage['user_id'], Phpfox::getUserId());
             if ($bIsBlocked) {
                 $bCanPostComment = false;
             }
         }
         // http://www.phpfox.com/tracker/view/15316/
         if ($sCurrentModule != 'info') {
             define('PHPFOX_IS_PAGES_IS_INDEX', true);
         }
         $this->setParam('aFeedCallback', array('module' => 'pages', 'table_prefix' => 'pages_', 'ajax_request' => 'pages.addFeedComment', 'item_id' => $aPage['page_id'], 'disable_share' => $bCanPostComment ? false : true, 'feed_comment' => 'pages_comment'));
         if (isset($aPage['text']) && !empty($aPage['text'])) {
             $this->template()->setMeta('description', $aPage['text']);
         }
         $this->template()->setTitle($aPage['title'])->setEditor()->setHeader('cache', array('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', 'index.css' => 'module_pages', 'feed.js' => 'module_feed'));
     }
 }
コード例 #22
0
ファイル: init.php プロジェクト: Lovinity/EQM
<?php

if (isset($_REQUEST['share-connect'])) {
    Phpfox::getComponent('share.connect', array(), 'controller');
    exit;
}
コード例 #23
0
ファイル: ajax.class.php プロジェクト: hoanghd/tools
	public function reply()
	{
		$this->setTitle(Phpfox::getPhrase('forum.post_a_reply'));
		Phpfox::getComponent('forum.post', array(), 'controller');	

		(($sPlugin = Phpfox_Plugin::get('forum.component_ajax_reply')) ? eval($sPlugin) : false);
		
		echo '<script type="text/javascript">$Core.loadInit();</script>';
	}
コード例 #24
0
ファイル: ajax.class.php プロジェクト: hoanghd/tools
	public function add()
	{
		echo '<div style="position:relative;">';
		Phpfox::getComponent('poll.add', array(), 'controller');
		echo '</div>';
		echo $this->template()->getHeader();
		echo '<script type="text/javascript">$Core.loadInit();</script>';
	}
コード例 #25
0
ファイル: ajax.class.php プロジェクト: lev1976g/core
 /**
  * Add a phrase using an inline method
  *
  */
 public function add()
 {
     Phpfox::getComponent('language.admincp.phrase.add', array('sReturnUrl' => $this->get('return'), 'sVar' => $this->get('phrase'), 'bNoJsValidation' => true), 'controller');
 }
コード例 #26
0
ファイル: frame.class.php プロジェクト: lev1976g/core
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getComponent('music.upload', array('bNoTemplate' => true), 'controller');
     exit;
 }
コード例 #27
0
ファイル: ajax.class.php プロジェクト: googlesky/snsp.vn
 public function reply()
 {
     if (!$this->get('edit') && !$this->get('quote')) {
         $this->setTitle(Phpfox::getPhrase('forum.post_a_reply'));
     }
     Phpfox::getComponent('forum.post', array(), 'controller');
     ($sPlugin = Phpfox_Plugin::get('forum.component_ajax_reply')) ? eval($sPlugin) : false;
     echo '<script type="text/javascript"> ' . (Phpfox::getParam('core.wysiwyg') == 'default' ? 'Editor.getEditor();' : '') . '$Core.loadInit();</script>';
 }
コード例 #28
0
ファイル: ajax.class.php プロジェクト: lev1976g/core
 /**
  * Process the AJAX request
  *
  * @return bool If we can load the component we return true, false on failure
  */
 public function process()
 {
     Phpfox::getService('log.session')->verifyToken();
     if (empty($this->_aRequest)) {
         return false;
     }
     $aParts = explode('.', $this->_aRequest['call']);
     $sModule = $aParts[0];
     if (isset($aParts[2])) {
         $sModule .= '.' . $aParts[1] . '.ajax';
         $sMethod = $aParts[2];
     } else {
         $sMethod = $aParts[1];
     }
     foreach ($this->_oReq->getRequests() as $sKey => $mValue) {
         self::$_aParams[$sKey] = $mValue;
         if (isset($mValue['call']) && strpos($mValue['call'], '.') !== false) {
             $aParts = explode('.', $mValue['call']);
             if (isset($aParts[1]) && $aParts[1] == 'moderation') {
                 $this->bIsModeration = true;
             }
         }
     }
     if ($sModule == 'im' && ($sMethod == 'getRooms' || $sMethod == 'getMessages')) {
         $sMethod = 'getUpdate';
     }
     ($sPlugin = Phpfox_Plugin::get('ajax_process')) ? eval($sPlugin) : false;
     $this->template()->assign('aGlobalUser', Phpfox::isUser() ? Phpfox::getUserBy(null) : array());
     $this->template()->assign('aGlobalProfilePageLogin', Phpfox::getUserBy('profile_page_id') ? Phpfox::getService('pages')->getLastLogin() : false);
     if (isset($this->_aRequest['is_user_profile']) && $this->_aRequest['is_user_profile'] && !defined('PHPFOX_IS_USER_PROFILE') && isset($this->_aRequest['profile_user_id'])) {
         define('PHPFOX_IS_USER_PROFILE', true);
         Profile_Service_Profile::instance()->setUserId($this->_aRequest['profile_user_id']);
     }
     $bCache = false;
     // Should we cache the data?
     if (isset(self::$_aParams[Phpfox::getTokenName()]['cache']) && self::$_aParams[Phpfox::getTokenName()]['cache']) {
         $bCache = true;
         $oCache = Phpfox::getLib('cache');
         $sCacheId = $oCache->set('ajax_' . strtolower($sModule) . '_' . strtolower($sMethod));
         if ($sContent = $oCache->get($sCacheId)) {
             echo $sContent;
             return true;
         }
     }
     // Lets get the Ajax component for this module
     if ($oObject = Phpfox::getComponent($sModule, array(), 'ajax')) {
         // Call the method for this component
         $oObject->{$sMethod}();
         if ($bCache) {
             $oCache->save($sCacheId, ob_get_contents());
         }
         return true;
     }
     // Since this is now an invalid call lets clear out the error message
     ob_clean();
     // Lets tell the dev that its an invalid call
     // $this->debug('Invalid Component: ' . $sModule . 'ajax');
     return false;
 }
コード例 #29
0
ファイル: profile.class.php プロジェクト: laiello/kr-indian
 public function process()
 {
     $this->setParam('bIsProfile', true);
     Phpfox::getComponent('organization.index', array('bNoTemplate' => true), 'controller');
 }
コード例 #30
0
ファイル: ajax.class.php プロジェクト: noikiy/phpfox-v3-dist
 public function viewMoreFriends()
 {
     Phpfox::getComponent('friend.index', array(), 'controller');
     // $this->remove('.js_friend_edit_order_submit');
     $this->remove('.js_pager_view_more_link');
     $this->append('#js_view_more_friends', $this->getContent(false));
     $this->call('$Core.loadInit();');
 }