コード例 #1
0
ファイル: search.class.php プロジェクト: googlesky/snsp.vn
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::getUserParam('forum.can_view_forum', true);
     $sView = $this->request()->get('view');
     $aCallback = false;
     if ($this->request()->get('item')) {
         $aGroup = Phpfox::getService('pages')->getPage($this->request()->get('item'), true);
         if (isset($aGroup['page_id'])) {
             $aCallback = array('group_id' => $aGroup['page_id'], 'url_home' => Phpfox::getService('pages')->getUrl($aGroup['page_id'], $aGroup['title'], $aGroup['vanity_url']), 'title' => $aGroup['title']);
             $this->setParam('aCallback', $aCallback);
         }
     }
     if ($aCallback === false) {
         Phpfox::getService('forum')->buildMenu();
     }
     if ($this->request()->getArray('search') || $this->request()->get('search-id') || !empty($sView)) {
         $this->template()->setFullSite();
         $this->setParam('bIsSearchQuery', true);
         return Phpfox::getLib('module')->setController('forum.forum');
     }
     Phpfox::getService('forum')->getSearchFilter();
     if (is_array($aCallback)) {
         $this->template()->setBreadcrumb('Pages', $this->url()->makeUrl('pages'))->setBreadcrumb($aCallback['title'], $aCallback['url_home'])->setBreadcrumb(Phpfox::getPhrase('forum.search'), $this->url()->makeUrl('forum.search', array('module' => 'pages', 'item' => $aCallback['group_id'])), true);
     } else {
         $this->template()->setTitle(Phpfox::getPhrase('forum.search'))->setBreadcrumb(Phpfox::getPhrase('forum.forum'), $this->url()->makeUrl('forum'))->setBreadcrumb(Phpfox::getPhrase('forum.search'), $this->url()->makeUrl('forum.search'));
     }
     $this->template()->setHeader('cache', array('pager.css' => 'style_css'))->assign(array('sForumList' => $aCallback === false ? Phpfox::getService('forum')->active($this->request()->get('id'))->getJumpTool(true) : '', 'iSearchId' => $this->request()->get('id'), 'aCallback' => $aCallback));
 }
コード例 #2
0
 /**
  * change time stamp, add blog image
  * @param $aRow
  * @param $iUserId
  * @return array
  */
 private function _process(&$aRow, $iUserId)
 {
     $aRow['info'] = Phpfox::getLib('parse.output')->parse($aRow['description_parsed']);
     $aRow['image_path'] = Phpfox::getLib('image.helper')->display(array('path' => 'event.url_image', 'server_id' => $aRow['server_id'], 'file' => $aRow['image_path'], 'suffix' => '_120', 'return_url' => true));
     $aRow['start_time_micro'] = Phpfox::getTime('Y-m-d', $aRow['start_time']);
     $aCategories = Phpfox::getService('event.category')->getCategoriesById($aRow['event_id']);
     if ($aCategories != null) {
         foreach ($aCategories as $iKey => $aCategory) {
             unset($aCategories[$iKey][1]);
         }
     } else {
         $aCategories = array();
     }
     $aRow['categories'] = $aCategories;
     $aRow['start_event_date'] = Phpfox::getTime(Phpfox::getParam('event.event_basic_information_time'), $aRow['start_time']);
     $aRow['end_event_date'] = Phpfox::getTime(Phpfox::getParam('event.event_basic_information_time'), $aRow['end_time']);
     $aRow['map_location'][] = $aRow['location'];
     if (!empty($aRow['address'])) {
         $aRow['map_location'][] = $aRow['address'];
     }
     if (!empty($aRow['city'])) {
         $aRow['map_location'][] = $aRow['city'];
     }
     if (!empty($aRow['postal_code'])) {
         $aRow['map_location'][] = $aRow['postal_code'];
     }
     if (!empty($aRow['country_child_id'])) {
         $aRow['map_location'][] = Phpfox::getService('core.country')->getChild($aRow['country_child_id']);
     }
     if (!empty($aRow['country_iso'])) {
         $aRow['map_location'][] = Phpfox::getService('core.country')->getCountry($aRow['country_iso']);
     }
     $aRow['map_location'] = array_values($aRow['map_location']);
     $bCanPostComment = true;
     if (isset($aRow['privacy_comment']) && $aRow['user_id'] != $iUserId && !Phpfox::getUserParam('privacy.can_comment_on_all_items')) {
         switch ($aRow['privacy_comment']) {
             // Everyone is case 0. Skipped.
             // Friends only
             case 1:
                 if (!Phpfox::getService('friend')->isFriend($iUserId, $aRow['user_id'])) {
                     $bCanPostComment = false;
                 }
                 break;
                 // Friend of friends
             // Friend of friends
             case 2:
                 if (!Phpfox::getService('friend')->isFriendOfFriend($aRow['user_id'])) {
                     $bCanPostComment = false;
                 }
                 break;
                 // Only me
             // Only me
             case 3:
                 $bCanPostComment = false;
                 break;
         }
     }
     $aRow['can_post_comment'] = $bCanPostComment;
     $aRow['feed_callback'] = array('module' => 'event', 'table_prefix' => 'event_', 'ajax_request' => 'event.addFeedComment', 'item_id' => $aRow['event_id'], 'disable_share' => $bCanPostComment ? false : true);
 }
コード例 #3
0
 /**
  * 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));
 }
コード例 #4
0
ファイル: ajax.class.php プロジェクト: Lovinity/EQM
 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();');
     }
 }
コード例 #5
0
ファイル: index.class.php プロジェクト: Lovinity/EQM
 /**
  * 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()));
 }
コード例 #6
0
ファイル: email.class.php プロジェクト: lev1976g/core
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('share.can_send_emails', true);
     $sText = Phpfox::getPhrase('share.hi_check_this_out_url', array('url' => $this->request()->get('url'), 'full_name' => Phpfox::getUserBy('full_name'), 'user_name' => Phpfox::getUserBy('user_name'), 'email' => Phpfox::getUserBy('email'), 'user_id' => Phpfox::getUserBy('user_id')));
     $this->template()->assign(array('sTitle' => $this->request()->get('title'), 'sMessage' => str_replace("\n", "", $sText), 'iEmailLimit' => Phpfox::getUserParam('share.total_emails_per_round'), 'bCanSendEmails' => Phpfox::getService('share')->canSendEmails()));
 }
コード例 #7
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $iUserId = $this->getParam('user_id') ? $this->getParam('user_id') : Phpfox::getUserId();
     if ($iBlogId = $this->request()->get('blog_id')) {
         $aBlog = Phpfox::getService('blog')->getBlogForEdit($iBlogId);
         if (isset($aBlog['blog_id']) && ($aBlog['user_id'] == Phpfox::getUserId() && Phpfox::getUserParam('blog.can_delete_own_blog_category')) || Phpfox::getUserParam('blog.can_delete_other_blog_category')) {
             $iUserId = $aBlog['user_id'];
         }
     }
     if (Phpfox::getUserParam('blog.blog_add_categories')) {
         switch ($this->getParam('sType')) {
             case 'personal':
                 $sCond = 'AND c.user_id IN(' . $iUserId . ')';
                 $sOrder = 'added DESC';
                 break;
             case 'used':
                 $sCond = 'AND c.user_id IN(0,' . $iUserId . ')';
                 $sOrder = 'used DESC';
                 break;
             case 'public':
                 $sCond = 'AND c.user_id IN(0)';
                 $sOrder = 'added DESC';
                 break;
             default:
                 $sCond = 'AND c.user_id IN(0,' . $iUserId . ')';
                 $sOrder = 'added DESC';
         }
     } else {
         $sCond = 'AND c.user_id IN(0)';
         $sOrder = 'added DESC';
     }
     $aItems = Phpfox::getService('blog.category')->getCategories(array($sCond), $sOrder);
     $this->template()->assign(array('aItems' => $aItems));
     ($sPlugin = Phpfox_Plugin::get('blog.component_block_add_category_list_process')) ? eval($sPlugin) : false;
 }
コード例 #8
0
ファイル: mini.class.php プロジェクト: hoanghd/tools
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		if (Phpfox::getUserBy('profile_page_id'))
		{
			return false;
		}
		
		if (!Phpfox::isUser())
		{
			return false;
		}
		
		$iTotal = 20;		
		list($iCnt, $aRows) = Phpfox::getService('friend')->get('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId(), 'ls.last_activity DESC', 0, $iTotal, true, false, true);

		$this->template()->assign(array(
				'sHeader' => '' . Phpfox::getPhrase('friend.friends_online') . ' (' . $iCnt . ')',
				'aFriends' => $aRows			
			)
		);
		
		if (Phpfox::getUserParam('friend.can_remove_friends_from_dashboard'))
		{
			//$this->template()->assign('sDeleteBlock', 'dashboard');
		}

		return 'block';	
	}	
コード例 #9
0
ファイル: index.class.php プロジェクト: nima7r/phpfox-dist
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('comment.can_moderate_comments', true);
     $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' => 'cmt'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'comments', 'filters' => $aFilters, 'search' => 'search'));
     if ($this->request()->get('view') == 'approval') {
         $oSearch->setCondition('AND cmt.view_id = 1');
     } else {
         $oSearch->setCondition('AND cmt.view_id = 9');
     }
     list($iCnt, $aComments) = Phpfox::getService('comment')->get('cmt.*', $oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay(), null, true);
     foreach ($aComments as $iKey => $aComment) {
         if (Phpfox::hasCallback($aComment['type_id'], 'getItemName')) {
             $aComments[$iKey]['item_name'] = Phpfox::callback($aComment['type_id'] . '.getItemName', $aComment['comment_id'], $aComment['owner_full_name']);
         }
     }
     Phpfox_Pager::instance()->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('aComments' => $aComments, 'bIsCommentAdminPanel' => true));
 }
コード例 #10
0
ファイル: index.class.php プロジェクト: hoanghd/tools
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{	
		Phpfox::getUserParam('language.can_manage_lang_packs', true);
		
		if (($sExportId = $this->request()->get('export')))
		{
			$oArchiveExport = Phpfox::getLib('archive.export')->set(array('zip'));
			
			if (($aData = Phpfox::getService('language')->exportForDownload($sExportId, ($this->request()->get('custom') ? true : false))))
			{
				$oArchiveExport->download('phpfox-language-' . $aData['name'] . '', 'zip', $aData['folder']);
			}
		}
		
		$aLanguages = Phpfox::getService('language')->getForAdminCp();
		
		if ($iDefault = $this->request()->get('default'))
		{
			if (Phpfox::getService('language.process')->setDefault($iDefault))
			{
				$this->url()->send('admincp', 'language', Phpfox::getPhrase('language.default_language_package_reset'));
			}
		}
		
		$this->template()->assign(array(
			'aLanguages' => $aLanguages
		))->setTitle(Phpfox::getPhrase('language.manage_language_packages'))
			->setBreadCrumb(Phpfox::getPhrase('language.manage_language_packages'));
	}
コード例 #11
0
 /**	
  * get user group settings
  */
 function getUserSettings()
 {
     foreach ($this->_aSettingUserGroup as $sVarname) {
         $aUserSettings[$sVarname] = Phpfox::getUserParam($sVarname);
     }
     return $aUserSettings;
 }
コード例 #12
0
ファイル: process.class.php プロジェクト: hoanghd/tools
	/**
	 * Unfeatures a member and clears the cache
	 * @param INT $iUser user_id
	 * @return bool
	 */
	public function unfeature($iUser)
	{
		if (!Phpfox::getUserParam('user.can_feature'))	return false;
		$this->database()->delete($this->_sTable, 'user_id = ' . (int)$iUser);
		$this->cache()->remove('featured_users');
		return true;
	}
コード例 #13
0
ファイル: mini.class.php プロジェクト: Lovinity/EQM
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     ($sPlugin = Phpfox_Plugin::get('friend.component_block_mini_process')) ? eval($sPlugin) : false;
     if (isset($bHideThisBlock)) {
         return false;
     }
     if (Phpfox::getUserBy('profile_page_id')) {
         return false;
     }
     if (!Phpfox::isUser()) {
         return false;
     }
     $iTotal = 20;
     if (Phpfox::getParam('friend.load_friends_online_ajax') && !PHPFOX_IS_AJAX) {
         $aRows = array();
         $iCnt = 0;
     } else {
         list($iCnt, $aRows) = Phpfox::getService('friend')->get('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId(), 'ls.last_activity DESC', 0, $iTotal, true, false, true);
     }
     $this->template()->assign(array('sHeader' => '' . Phpfox::getPhrase('friend.friends_online') . ' (<span id="js_total_block_friends_onlin">' . $iCnt . '</span>)', 'aFriends' => $aRows, 'iTotalFriendsOnline' => $iCnt));
     if (Phpfox::getUserParam('friend.can_remove_friends_from_dashboard')) {
         //$this->template()->assign('sDeleteBlock', 'dashboard');
     }
     return 'block';
 }
コード例 #14
0
ファイル: designdnd.class.php プロジェクト: Lovinity/EQM
 public function process()
 {
     if (!Phpfox::getUserParam('core.can_design_dnd')) {
         return false;
     }
     $this->template()->assign(array('bEnabled' => PHPFOX_DESIGN_DND));
 }
コード例 #15
0
ファイル: process.class.php プロジェクト: lev1976g/core
 public function updateActivity($iId, $iType)
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('admincp.has_admin_access', true);
     $this->database()->update($this->_sTable, array('is_active' => (int) ($iType == '1' ? 1 : 0)), 'component_id = ' . (int) $iId);
     $this->cache()->remove('component');
 }
コード例 #16
0
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('core.can_gift_points', true);
     $aUser = Phpfox::getService('user')->get($this->getParam('user_id'), true);
     $this->template()->assign(array('aUser' => $aUser, 'iCurrentAvailable' => Phpfox::getUserBy('activity_points'), 'iTrgUserId' => $this->getParam('user_id')));
 }
コード例 #17
0
ファイル: player.class.php プロジェクト: nima7r/phpfox-dist
 /**
  * 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');
 }
コード例 #18
0
ファイル: process.class.php プロジェクト: lev1976g/core
 public function updateActivity($iId, $iType)
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('admincp.has_admin_access', true);
     $this->database()->update($this->_sTable, array('is_active' => (int) ($iType == '1' ? 1 : 0)), 'currency_id = \'' . $this->database()->escape($iId) . '\'');
     $this->cache()->remove('currency');
 }
コード例 #19
0
ファイル: privacy.class.php プロジェクト: lev1976g/core
 /**
  * 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));
 }
コード例 #20
0
 public function process()
 {
     $aUser = $this->getParam('aUser');
     #
     # Check User Privacy Settings
     if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'megapoke.who_can_poke')) {
         return false;
     }
     # Check for User Group Permission
     if (!Phpfox::getUserParam('megapoke.canmegapoke')) {
         return false;
     }
     # User can't Poke themself
     if ($aUser['user_id'] == Phpfox::getUserId()) {
         return false;
     }
     # User must be logged in to Poke
     if (!Phpfox::getUserId()) {
         return false;
     }
     #GET POKES
     $aPokes = phpfox::getLib('phpfox.database')->select('*')->from(Phpfox::getT('megapoke'))->where("poke_active = '0' ")->order('poke_text')->execute('getSlaveRows');
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('megapoke.profilepoketitle'), 'aPokes' => $aPokes, 'sSendText' => Phpfox::getPhrase('megapoke.poke_send', array('user_name' => $aUser['full_name'])), 'pokeFormUrl' => Phpfox::getLib('url')->makeUrl('megapoke')));
     return 'block';
 }
コード例 #21
0
ファイル: index.class.php プロジェクト: Lovinity/EQM
 /**
  * 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));
 }
コード例 #22
0
ファイル: index.class.php プロジェクト: noikiy/phpfox-dist
 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('admincp.can_manage_modules', true);
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('admincp.module.process')->updateActive($aVals)) {
             $this->url()->send('admincp.module', null, Phpfox::getPhrase('admincp.module_s_updated'));
         }
     }
     if ($sDeleteId = $this->request()->get('delete')) {
         $sCachePhrase = Phpfox::getPhrase('admincp.module_successfully_deleted');
         if (Phpfox::getService('admincp.module.process')->delete($sDeleteId)) {
             $this->url()->send('admincp.module', null, $sCachePhrase);
         }
     }
     if ($sModuleInstall = $this->request()->get('install')) {
         if (Phpfox::getService('admincp.module.process')->install($sModuleInstall, array('table' => true, 'post_install' => true, 'insert' => true))) {
             $sCachePhrase = Phpfox::getPhrase('admincp.module_successfully_installed');
             Phpfox::getLib('cache')->remove();
             $this->url()->send('admincp.module', null, $sCachePhrase);
         }
     }
     $modules = [];
     $aModules = Phpfox::getService('admincp.module')->get(true);
     if (!isset($aModules['3rdparty'])) {
         $aModules['3rdparty'] = [];
     }
     foreach ($aModules['3rdparty'] as $key => $value) {
         if ($value['product_id'] == 'phpfox' && $this->request()->get('view') != 'all') {
             continue;
         }
         $modules[$key] = $value;
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.manage_modules'))->setBreadCrumb(Phpfox::getPhrase('admincp.manage_modules'))->assign(array('aModules' => $modules));
 }
コード例 #23
0
ファイル: add.class.php プロジェクト: Lovinity/EQM
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::getUserParam('language.can_manage_lang_packs', true);
     $bNoJsValidation = $this->getParam('bNoJsValidation');
     $aModules = Phpfox::getService('admincp.module')->getModules();
     $aLanguages = Phpfox::getService('language')->get();
     if ($sPhrase = $this->getParam('sVar')) {
         $aParts = explode('.', $sPhrase);
         $sPhrase = $aParts[1];
     }
     /*
     $aValidation = array(
     	'var_name' => array(
     		'def' => 'required',
     		'title' => Phpfox::getPhrase('language.select_varname')
     	)
     );
     */
     $aValidation = array();
     $oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_phrase_form', 'aParams' => $aValidation));
     if ($aVals = $this->request()->getArray('val')) {
         if (empty($aVals['var_name']) && isset($aVals['text']['en'])) {
             $aVals['var_name'] = $aVals['text']['en'];
         }
         if (empty($aVals['var_name'])) {
             Phpfox_Error::set('Provide a var name.');
         }
         // Check that all the fields are valid
         if ($oValid->isValid($aVals)) {
             // Check to make sure the phrase has not already been added
             if ($sIsPhrase = Phpfox::getService('language.phrase')->isPhrase($aVals)) {
                 Phpfox_Error::set(Phpfox::getPhrase('language.phrase_already_created', array('phrase' => $sIsPhrase)) . ' - ' . Phpfox::getPhrase($sIsPhrase));
                 $sCachePhrase = $sIsPhrase;
             } else {
                 $sVarName = Phpfox::getService('language.phrase.process')->prepare($aVals['var_name']);
                 if (isset($aVals['module'])) {
                     $aParts = explode('|', $aVals['module']);
                     $sVarName = $aParts[1] . '.' . $sVarName;
                 }
                 $sCached = Phpfox::getPhrase('language.phrase_added', array('phrase' => $sVarName));
                 // Add the new phrase
                 $sPhrase = Phpfox::getService('language.phrase.process')->add($aVals);
                 // Verify if we have a return URL, if we do send them there instead
                 if ($sReturn = $this->request()->get('return')) {
                     $this->url()->forward($sReturn, $sCached);
                 } else {
                     Phpfox::getLib('session')->set('cache_new_phrase', $sVarName);
                     // Phrase added lets send them back to the same page with a message that the phrase was added
                     $this->url()->send('admincp.language.phrase.add', array('last-module' => $aParts[1]), $sCached);
                 }
             }
         }
     }
     if (!isset($sCachePhrase) && ($sCachePhrase = Phpfox::getLib('session')->get('cache_new_phrase'))) {
         Phpfox::getLib('session')->remove('cache_new_phrase');
     }
     // Assign needed vars to the template
     $this->template()->assign(array('aProducts' => Phpfox::getService('admincp.product')->get(), 'aModules' => $aModules, 'aLanguages' => $aLanguages, 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $bNoJsValidation ? 'return true;' : $oValid->getJsForm(), 'sReturn' => ($sReturn = $this->request()->get('return')) ? $sReturn : $this->getParam('sReturnUrl'), 'sVar' => $sPhrase, 'sCachePhrase' => isset($sCachePhrase) ? $sCachePhrase : '', 'sLastModuleId' => $this->request()->get('last-module')))->setBreadCrumb(Phpfox::getPhrase('language.add_phrase'))->setTitle(Phpfox::getPhrase('language.add_phrase'));
     ($sPlugin = Phpfox_Plugin::get('language.component_controller_admincp_phrase_add_process')) ? eval($sPlugin) : false;
 }
コード例 #24
0
ファイル: ajax.class.php プロジェクト: Lovinity/EQM
 /**
  * Get the latest shoutbox messages.
  *
  */
 public function getMessages()
 {
     // Lets make sure this user group can actually view the shoutbox
     Phpfox::getUserParam('shoutbox.can_view_shoutbox', true);
     $iItem = $this->get('item', null);
     $sModule = $this->get('module', null);
     $aCallback = array();
     if ($iItem !== null && $sModule !== null) {
         $aCallback = array('module' => $sModule, 'item' => $iItem);
     }
     // Connect to our service and get the latest messages.
     $aShoutouts = Phpfox::getService('shoutbox')->callback($aCallback)->getMessages(Phpfox::getParam('shoutbox.shoutbox_display_limit'));
     // Run the for loop
     foreach ($aShoutouts as $iKey => $aShoutout) {
         // Assign the needed variables for each shoutout
         $this->template()->assign(array('iShoutCount' => $iKey, 'aShoutout' => $aShoutout, 'iShoutoutWordWrap' => Phpfox::getParam('shoutbox.shoutbox_wordwrap')))->getTemplate('shoutbox.block.entry');
     }
     // Update the sites shoutout with the latest shoutouts
     $this->html('#js_shoutbox_messages', $this->getContent(false));
     // Should we refresh the data?
     if (Phpfox::getParam('shoutbox.shoutbox_is_live')) {
         // Add a refresh timeout()
         $this->call('setTimeout("$.ajaxCall(\'shoutbox.getMessages\', (typeof $Core.Shoutbox != \'undefined\' && typeof $Core.Shoutbox.sParams != \'undefined\') ? $Core.Shoutbox.sParams : ' . (isset($aCallback['module']) ? '\'module=' . $aCallback['module'] . '&item=' . $aCallback['item'] . '\'' : '\'\'') . ', \'GET\');", ' . Phpfox::getParam('shoutbox.shoutbox_refresh') * 1000 . ');');
     }
     if (Phpfox::getParam('core.defer_loading_user_images')) {
         // http://www.phpfox.com/tracker/view/14632/
         $this->call('$Behavior.defer_images();');
         //$this->call('$Core.loadInit();');
     }
 }
コード例 #25
0
ファイル: add.class.php プロジェクト: lev1976g/core
 /**
  * Controller
  */
 public function process()
 {
     $aValidation = array('name' => Phpfox::getPhrase('forum.provide_a_name_for_your_forum'));
     $oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aValidation));
     $bIsEdit = false;
     if ($iId = $this->request()->getInt('id')) {
         $bIsEdit = true;
         Phpfox::getUserParam('forum.can_edit_forum', true);
         $aForum = Phpfox::getService('forum')->getForEdit($iId);
         $this->template()->assign('aForms', $aForum);
     } else {
         Phpfox::getUserParam('forum.can_add_new_forum', true);
     }
     if ($aVals = $this->request()->getArray('val')) {
         if ($oValid->isValid($aVals)) {
             if ($bIsEdit) {
                 if (Phpfox::getService('forum.process')->update($aForum['forum_id'], $aVals)) {
                     $this->url()->send('admincp.forum', null, Phpfox::getPhrase('forum.forum_successfully_updated'));
                 }
             } else {
                 if (Phpfox::getService('forum.process')->add($aVals)) {
                     $this->url()->send('admincp.forum.add', null, Phpfox::getPhrase('forum.forum_successfully_added'));
                 }
             }
         }
     }
     $sTitle = $bIsEdit ? Phpfox::getPhrase('forum.editing_forum') . ': ' . $aForum['name'] : Phpfox::getPhrase('forum.create_new_form');
     $this->template()->setTitle($sTitle)->setBreadCrumb($sTitle, $this->url()->makeUrl('admincp.forum'))->assign(array('sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(), 'sForumParents' => Phpfox::getService('forum')->active($bIsEdit ? $aForum['parent_id'] : $this->request()->getInt('child'))->edit($bIsEdit ? $aForum['forum_id'] : 0)->getJumpTool(true, $bIsEdit)));
 }
コード例 #26
0
ファイル: rate.class.php プロジェクト: googlesky/snsp.vn
 /**
  * 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;
 }
コード例 #27
0
ファイル: change.class.php プロジェクト: Lovinity/EQM
 public function process()
 {
     Phpfox::isUser(true);
     Phpfox::getUserParam('profiles.is_enabled', true);
     if ($sName = $this->request()->get('req3')) {
         $aExtraProfile = Phpfox::getService('profiles')->getProfile($sName);
     }
     if (count($aExtraProfile) == 0) {
         return Phpfox::getLib('module')->setController('error.404');
     }
     if (Phpfox::getUserId() != $aExtraProfile['user_id']) {
         Phpfox::getUserParam('profiles.can_edit_others', true);
         if (($aUser = Phpfox::getService('user')->getUser($aExtraProfile['user_id'], 'u.user_group_id')) && isset($aUser['user_group_id'])) {
             $iUserGroupId = $aUser['user_group_id'];
         }
     } else {
         $iUserGroupId = Phpfox::getUserBy('user_group_id');
     }
     $bIsEdit = false;
     if ($iId = $this->request()->getInt('id', false)) {
         $iUserGroupId = $iId;
         if ($aVals = $this->request()->getArray('custom') && !empty($aVals)) {
             $bIsEdit = true;
             if (Phpfox::getService('profiles.process')->updateFields($aExtraProfile['extra_id'], $aExtraProfile['user_id'], $aVals)) {
                 $this->url()->send('profiles.' . $aExtraProfile['title_url'], null, Phpfox::getPhrase('profiles.successfully_updated_name_profile', array('extra_name' => $aExtraProfile['title'])));
             }
         }
     }
     $aCustomFields = Phpfox::getService('profiles')->getFields(array('extra_main', 'extra_panel', 'extra_side'), $aExtraProfile['extra_id'], $iUserGroupId);
     $this->template()->setTitle(Phpfox::getPhrase('profiles.edit_extra_profiles'))->setBreadcrumb($aExtraProfile['title']);
     $this->template()->setHeader(array('custom.js' => 'module_profiles'))->assign(array('aExtraProfile' => $aExtraProfile, 'aSettings' => $aCustomFields, 'bIsEdit' => $bIsEdit));
 }
コード例 #28
0
ファイル: folder.class.php プロジェクト: lev1976g/core
 public function reachedLimit()
 {
     if ($this->database()->select('COUNT(*)')->from($this->_sTable)->where('user_id = ' . Phpfox::getUserId())->execute('getField') >= Phpfox::getUserParam('mail.total_folders')) {
         return true;
     }
     return false;
 }
コード例 #29
0
ファイル: ajax.class.php プロジェクト: Lovinity/EQM
 /**
  * Need this to take over photo moderation
  * Enter description here ...
  */
 public function moderation()
 {
     Phpfox::isUser(true);
     switch ($this->get('action')) {
         case 'approve':
             Phpfox::getUserParam('photo.can_approve_photos', true);
             foreach ((array) $this->get('item_moderate') as $iId) {
                 Phpfox::getService('photo.process')->approve($iId);
                 $this->call('$(\'#js_photo_id_' . $iId . '\').remove();');
             }
             $sMessage = Phpfox::getPhrase('photo.photo_s_successfully_approved');
             $this->alert($sMessage, 'Moderation', 300, 150, true);
             break;
         case 'delete':
             Phpfox::getUserParam('photo.can_delete_other_photos', true);
             $item = $this->get('item_moderate')[0];
             $bReload = Phpfox::getService('profiles')->getUserAndProfile($item);
             if ($bReload) {
                 $this->call('location.reload();');
             }
             foreach ((array) $this->get('item_moderate') as $iId) {
                 Phpfox::getService('photo.process')->delete($iId);
                 $this->call('$(\'#js_photo_id_' . $iId . '\').remove();');
             }
             $sMessage = Phpfox::getPhrase('photo.photo_s_successfully_deleted');
             break;
     }
     $this->updateCount();
     $this->hide('.moderation_process');
 }
コード例 #30
0
ファイル: index.class.php プロジェクト: googlesky/snsp.vn
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if (Phpfox::getParam('core.phpfox_is_hosted')) {
         $this->url()->send('admincp');
     }
     Phpfox::getUserParam('admincp.can_manage_modules', true);
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('admincp.module.process')->updateActive($aVals)) {
             $this->url()->send('admincp.module', null, Phpfox::getPhrase('admincp.module_s_updated'));
         }
     }
     if ($sDeleteId = $this->request()->get('delete')) {
         $sCachePhrase = Phpfox::getPhrase('admincp.module_successfully_deleted');
         if (Phpfox::getService('admincp.module.process')->delete($sDeleteId)) {
             $this->url()->send('admincp.module', null, $sCachePhrase);
         }
     }
     if ($sModuleInstall = $this->request()->get('install')) {
         if (Phpfox::getService('admincp.module.process')->install($sModuleInstall, array('table' => true, 'post_install' => true, 'insert' => true))) {
             $sCachePhrase = Phpfox::getPhrase('admincp.module_successfully_installed');
             Phpfox::getLib('cache')->remove();
             $this->url()->send('admincp.module', null, $sCachePhrase);
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.manage_modules'))->setBreadCrumb(Phpfox::getPhrase('admincp.manage_modules'))->assign(array('aModules' => Phpfox::getService('admincp.module')->get(true)));
 }