Beispiel #1
0
 public function update()
 {
     ($sPlugin = Phpfox_Plugin::get('ad.component_ajax_update__start')) ? eval($sPlugin) : false;
     Phpfox::getBlock('ad.display', array('block_id' => $this->get('block_id')));
     $this->html('#js_ad_space_' . $this->get('block_id'), $this->getContent(false));
     ($sPlugin = Phpfox_Plugin::get('ad.component_ajax_update__end')) ? eval($sPlugin) : false;
 }
Beispiel #2
0
 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>';
 }
Beispiel #3
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if ($sPlugin = Phpfox_Plugin::get('core.component_controller_index_visitor_start')) {
         eval($sPlugin);
     }
     $this->template()->setHeader('cache', array('jquery/plugin/jquery.bt.js' => 'static_script', 'register.js' => 'module_user', 'country.js' => 'module_core', 'comment.css' => 'style_css'))->setPhrase(array('user.continue'))->setHeader('head', array("<!--[if IE ]>\n\t\t\t<script type=\"text/javascript\" src=\"" . Phpfox::getParam('core.url_static_script') . "jquery/plugin/excanvas.js\"></script>\n\t<![endif]-->"))->assign(array('aSettings' => Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), null, null, true)));
 }
Beispiel #4
0
	public function process()
	{
		(($sPlugin = Phpfox_Plugin::get('announcement.component_block_index__start')) ? eval($sPlugin) : false);
		$aAnnouncement = Phpfox::getService('announcement')->getLatest(null, true, Phpfox::getTime());
		
		if ($aAnnouncement === false) 
		{
			return false;
		}
		$aAnnouncement = reset($aAnnouncement);
		if (isset($aAnnouncement['is_seen']) && $aAnnouncement['is_seen'] == true) return false;
   
		if (Phpfox::getLib('phpfox.locale')->isPhrase($aAnnouncement['intro_var']))
		{
			$aAnnouncement['intro_var'] = Phpfox::getPhrase($aAnnouncement['intro_var']);
		}
		else
		{
			$aAnnouncement['intro_var']  = '';
		}		

		$this->template()->assign(array(
				'aAnnouncement' => $aAnnouncement
			)
		);
		(($sPlugin = Phpfox_Plugin::get('announcement.component_block_index__end')) ? eval($sPlugin) : false);
	}
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     if ($sPlugin = Phpfox_Plugin::get('core.component_controller_index_member_start')) {
         eval($sPlugin);
     }
     Phpfox::isUser(true);
     if ($this->request()->get('req3') == 'customize') {
         define('PHPFOX_IN_DESIGN_MODE', true);
         define('PHPFOX_CAN_MOVE_BLOCKS', true);
         if ($iTestStyle = $this->request()->get('test_style_id')) {
             if (Phpfox::getLib('template')->testStyle($iTestStyle)) {
             }
         }
         $aDesigner = array('current_style_id' => Phpfox::getUserBy('style_id'), 'design_header' => Phpfox::getPhrase('core.customize_dashboard'), 'current_page' => $this->url()->makeUrl(''), 'design_page' => $this->url()->makeUrl('core.index-member', 'customize'), 'block' => 'core.index-member', 'item_id' => Phpfox::getUserId(), 'type_id' => 'user');
         $this->setParam('aDesigner', $aDesigner);
         $this->template()->setPhrase(array('theme.are_you_sure'))->setHeader('cache', array('style.css' => 'style_css', 'video.css' => 'module_video', 'design.js' => 'module_theme', 'select.js' => 'module_theme'));
         if (Phpfox::getParam('profile.can_drag_drop_blocks_on_profile')) {
             $this->template()->setHeader('cache', array('jquery/ui.js' => 'static_script', 'sort.js' => 'module_theme'))->setHeader(array('<script type="text/javascript">$Behavior.core_controller_member_designonupdate = function() { function designOnUpdate() { $Core.design.updateSorting(); } };</script>', '<script type="text/javascript">$Behavior.core_controller_init = function() { $Core.design.init({type_id: \'user\'}); };</script>'));
         }
     } else {
         // $this->template()->setHeader('jquery/ui.js', 'static_script');
         $this->template()->setHeader('cache', array('sort.js' => 'module_theme', 'design.js' => 'module_theme', 'video.css' => 'module_video'))->setHeader(array());
     }
     if (Phpfox::getParam('video.convert_servers_enable')) {
         $this->template()->setHeader('<script type="text/javascript">document.domain = "' . Phpfox::getParam('video.convert_js_parent') . '";</script>');
     }
     Phpfox::getLib('module')->setCacheBlockData(array('table' => 'user_dashboard', 'field' => 'user_id', 'item_id' => Phpfox::getUserId(), 'controller' => 'core.index-member'));
     $this->template()->setHeader('cache', array('feed.js' => 'module_feed', 'welcome.css' => 'style_css', 'announcement.css' => 'style_css', 'comment.css' => 'style_css', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'player/flowplayer/flowplayer.js' => 'static_script'))->setEditor(array('load' => 'simple'));
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $aDeny = array('forum', 'profile');
     //Plugin call
     if ($sPlugin = Phpfox_Plugin::get('user.block_login-block_process__start')) {
         eval($sPlugin);
     }
     // If we are logged in lets not display the login block
     if (Phpfox::isUser()) {
         return false;
     }
     if (in_array(Phpfox::getLib('module')->getModuleName(), $aDeny)) {
         return false;
     }
     if (Phpfox::getLib('url')->isUrl(array('user/login', 'user/register', 'profile', 'user/password/request', 'forum'))) {
         return false;
     }
     $aFooter = array();
     if (Phpfox::getParam('user.allow_user_registration')) {
         $aFooter[Phpfox::getPhrase('user.sign')] = $this->url()->makeUrl('user.register');
     }
     $aFooter[Phpfox::getPhrase('user.forgot_password')] = $this->url()->makeUrl('user.password.request');
     // Assign the needed vars for the template
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('user.log'), 'aFooter' => $aFooter, 'sJanrainUrl' => Phpfox::isModule('janrain') ? Phpfox::getService('janrain')->getUrl() : ''));
     //Plugin call
     if ($sPlugin = Phpfox_Plugin::get('user.block_login-block_process__end')) {
         eval($sPlugin);
     }
     return 'block';
 }
 /**
  * Controller
  */
 public function process()
 {
     if ($sPlugin = Phpfox_Plugin::get('core.component_controller_index_visitor_start')) {
         eval($sPlugin);
     }
     $image = [];
     list($total, $featured) = Photo_Service_Photo::instance()->getFeatured();
     if (is_array($featured) && isset($featured[0])) {
         $photo = $featured[0];
         $url = Phpfox_Image_Helper::instance()->display(['server_id' => $photo['server_id'], 'path' => 'photo.url_photo', 'file' => $photo['destination'], 'suffix' => '_1024', 'return_url' => true]);
         $image = ['image' => $url, 'info' => strip_tags($photo['title']) . ' by ' . $photo['full_name']];
     }
     if (!$image) {
         $images = ['create-a-community-for-musicians.jpg' => 'Creating communities for Musicians', 'create-a-community-for-athletes.jpg' => 'Creating communities for Athletes', 'create-a-community-for-photographers.jpg' => 'Creating communities for Photographers', 'create-a-social-network-for-fine-cooking.jpg' => 'Creating communities for Fine Cooking'];
         $total = rand(1, count($images));
         $image = [];
         $cnt = 0;
         foreach ($images as $image => $info) {
             $cnt++;
             $image = ['image' => 'http://bg.m9.io/' . $image, 'info' => $info];
             if ($cnt === $total) {
                 break;
             }
         }
     }
     $this->template()->setHeader('cache', array('register.js' => 'module_user', 'country.js' => 'module_core', 'comment.css' => 'style_css'))->setBreadCrumb(Phpfox::getParam('core.site_title'))->setPhrase(array('user.continue'))->assign(array('aSettings' => Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), null, null, true), 'image' => $image));
 }
Beispiel #8
0
 public function favoriteContest($iContestId, $iUserId, $iType)
 {
     $iParticipantId = Phpfox::getService('contest.participant.process')->insertNewParticipantEntryIfNeccessary($iContestId, $iUserId);
     if ($iType == 1) {
         //follow
         $aUpdate = array('is_favorite' => 1);
         $bResult = $this->database()->update($this->_sTable, $aUpdate, 'participant_id = ' . $iParticipantId);
         $iItemId = $iParticipantId;
         if (PHpfox::isModule('foxfavorite')) {
             ($sPlugin = Phpfox_Plugin::get('contest.service_process_addfavorite_end')) ? eval($sPlugin) : false;
         }
         if ($bResult) {
             Phpfox::getService('contest.contest.process')->sendNotificationAndEmail('favorite_contest', $iContestId);
         }
         return $bResult;
     } else {
         if ($iType == 0) {
             //un follow
             $aUpdate = array('is_favorite' => 0);
             $iItemId = $iParticipantId;
             if (PHpfox::isModule('foxfavorite')) {
                 ($sPlugin = Phpfox_Plugin::get('contest.service_process_deletefavorite_end')) ? eval($sPlugin) : false;
             }
             return $this->database()->update($this->_sTable, $aUpdate, 'participant_id = ' . $iParticipantId);
         }
     }
 }
Beispiel #9
0
 public function __call($sMethod, $aArguments)
 {
     if ($sPlugin = Phpfox_Plugin::get('younetcore.service_process__call')) {
         return eval($sPlugin);
     }
     Phpfox_Error::trigger('Call to undefined method ' . __CLASS__ . '::' . $sMethod . '()', E_USER_ERROR);
 }
Beispiel #10
0
 /**
  * Run cron jobs
  *
  * @param int $iId Is the optional ID of the cron job
  */
 public function exec($iId = null)
 {
     if (is_bool($this->_aCrons)) {
         return false;
     }
     // Run a specific cron. Used via AdminCP or cli
     if ($iId && isset($this->_aCrons[$iId])) {
         // Run the PHP code
         eval($this->_aCrons[$iId]['php_code']);
         // Update the cron cache
         $this->_update($this->_aCrons[$iId]['cron_id'], $this->_getNextRun($this->_aCrons[$iId]['type_id'], $this->_aCrons[$iId]['every']));
     } else {
         // Get all the crons
         foreach ($this->_aCrons as $aCron) {
             // Make sure this cron needs to be executed
             if ($aCron['next_run'] < PHPFOX_TIME) {
                 // Get the cron file
                 //require_once(PHPFOX_DIR_CRON . 'source' . PHPFOX_DS . $aCron['file_name']);
                 eval($aCron['php_code']);
                 // Update the cron cache
                 $this->_update($aCron['cron_id'], $this->_getNextRun($aCron['type_id'], $aCron['every']));
             }
         }
     }
     ($sPlugin = Phpfox_Plugin::get('cron_exec')) ? eval($sPlugin) : false;
 }
Beispiel #11
0
 /**
  * Class process method which is used to execute this component.
  */
 public function process()
 {
     $this->template()->setTitle(Phpfox::getPhrase('user.email_verification'))->setBreadcrumb(Phpfox::getPhrase('user.email_verification'))->assign(array('iVerifyUserId' => Phpfox::getLib('session')->get('cache_user_id')));
     $sHash = $this->request()->get('link', '');
     if ($sHash == '') {
     } elseif (Phpfox::getService('user.verify.process')->verify($sHash)) {
         if ($sPlugin = Phpfox_Plugin::get('user.component_verify_process_redirection')) {
             eval($sPlugin);
         }
         $sRedirect = Phpfox::getParam('user.redirect_after_signup');
         if (!empty($sRedirect)) {
             Phpfox::getLib('session')->set('redirect', str_replace('.', '/', $sRedirect));
         }
         if (Phpfox::isMobile()) {
             $this->url()->send('mobile.user.login', null, Phpfox::getPhrase('user.your_email_has_been_verified_please_log_in_with_the_information_you_provided_during_sign_up'));
         }
         // send to the log in and say everything is ok
         Phpfox::getLib('session')->set('verified_do_redirect', '1');
         $this->url()->send('user.login', null, Phpfox::getPhrase('user.your_email_has_been_verified_please_log_in_with_the_information_you_provided_during_sign_up'));
     } else {
         //send to the log in and say there was an error
         Phpfox_Error::set(Phpfox::getPhrase('user.invalid_verification_link'));
         $iTime = Phpfox::getParam('user.verify_email_timeout');
         if ($iTime < 60) {
             $sTime = Phpfox::getPhrase('user.time_minutes', array('time' => $iTime));
         } elseif ($iTime < 60 * 60 * 24) {
             $sTime = $iTime == 60 ? Phpfox::getPhrase('user.time_hour', array('time' => round($iTime / 60))) : Phpfox::getPhrase('user.time_hours', array('time' => round($iTime / 60)));
         } else {
             $sTime = Phpfox::getPhrase('user.time_days', array('time' => $sTime));
         }
         Phpfox::getService('user.verify.process')->sendMail(Phpfox::getLib('session')->get('cache_user_id'));
         $this->template()->assign(array('sTime' => $sTime));
     }
 }
Beispiel #12
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     ($sPlugin = Phpfox_Plugin::get('friend.component_block_mini_process')) ? eval($sPlugin) : false;
     if (isset($bHideThisBlock)) {
         return false;
     }
     if (Phpfox::getUserBy('profile_page_id')) {
         return false;
     }
     if (!Phpfox::isUser()) {
         return false;
     }
     $iTotal = 20;
     if (Phpfox::getParam('friend.load_friends_online_ajax') && !PHPFOX_IS_AJAX) {
         $aRows = array();
         $iCnt = 0;
     } else {
         list($iCnt, $aRows) = Phpfox::getService('friend')->get('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId(), 'ls.last_activity DESC', 0, $iTotal, true, false, true);
     }
     $this->template()->assign(array('sHeader' => '' . Phpfox::getPhrase('friend.friends_online') . ' (<span id="js_total_block_friends_onlin">' . $iCnt . '</span>)', 'aFriends' => $aRows, 'iTotalFriendsOnline' => $iCnt));
     if (Phpfox::getUserParam('friend.can_remove_friends_from_dashboard')) {
         //$this->template()->assign('sDeleteBlock', 'dashboard');
     }
     return 'block';
 }
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     header('Content-Type: text/json');
     $oServiceAccountapi = Phpfox::getService('accountapi');
     // get username password from url
     $sAppId = $oServiceAccountapi->getReq(3);
     $sUsername = $oServiceAccountapi->getReq(4);
     $sPassword = $oServiceAccountapi->getReq(5);
     // if fail to get
     // -> get from $_POST
     if (empty($sAppId) && empty($sUsername) && empty($sPassword)) {
         if (isset($_POST['email'])) {
             $sUsername = $_POST['email'];
         }
         if (isset($_POST['password'])) {
             $sPassword = $_POST['password'];
         }
     }
     if (!is_int($sAppId)) {
         $sPassword = $sUsername;
         $sUsername = $sAppId;
         $sAppId = Phpfox::getParam('accountapi.app_id');
     }
     if (empty($sUsername)) {
         $sUsername = $this->request()->get('email');
         $sPassword = $this->request()->get('password');
     }
     if (!$sAppId || !$sUsername || !$sPassword) {
         echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.missing_parameters')));
         exit;
     }
     $aUser = Phpfox::getService('accountapi')->getUserByEmailOrUsername($sUsername);
     if (!$aUser || !is_array($aUser)) {
         echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.username_invalid')));
         exit;
     }
     if (Phpfox::isModule('semigrator') && strlen($aUser['password_salt']) > 3) {
         if ($aUser['password'] !== Phpfox::getService('semigrator.se.user')->setHash($sPassword, $aUser['password_salt'])) {
             echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.password_invalid')));
             exit;
         }
     } else {
         if ($aUser['password'] !== Phpfox::getLib('hash')->setHash($sPassword, $aUser['password_salt'])) {
             echo json_encode(array('status' => 'error', 'message' => Phpfox::getPhrase('accountapi.password_invalid')));
             exit;
         }
     }
     if (isset($aUser['status_id']) && $aUser['status_id'] == 1 && Phpfox::getParam('user.verify_email_at_signup')) {
         echo json_encode(array('status' => 'error', 'message' => strip_tags(Phpfox::getPhrase('user.you_need_to_verify_your_email_address_before_logging_in', array('email' => $aUser['email'])))));
         exit;
     }
     $aKey = Phpfox::getService('accountapi.user')->checkKey($sAppId, $aUser);
     if (!$aKey) {
         exit;
     }
     ($sPlugin = Phpfox_Plugin::get('accountapi.component_controller_checkkey_get_json_value')) ? eval($sPlugin) : false;
     echo json_encode($aKey);
     exit;
 }
Beispiel #14
0
 public function update()
 {
     Phpfox::massCallback('getGlobalNotifications');
     if ($sPlugin = Phpfox_Plugin::get('notification.component_ajax_update_1')) {
         eval($sPlugin);
     }
     $this->call('$Core.notification.setTitle();');
 }
Beispiel #15
0
	/**
	 * Creates an MD5 hash with the password itself wrapped in MD5 as
	 * well as support for a random salt that is also wrapped in MD5
	 *
	 * @see md5()
	 * @param string $sPassword Password to create a hash for
	 * @param string $sSalt Optional random salt to make the hash unique
	 * @return string Returns a 32 character MD5 string
	 */
	public function setHash($sPassword, $sSalt = '')
	{
		if (!$sSalt)
		{
			$sSalt = Phpfox::getParam('core.salt');
		}
		if ($sPlugin = Phpfox_Plugin::get('hash_sethash__end')){eval($sPlugin);}
		return md5(md5($sPassword) . md5($sSalt));
	}
Beispiel #16
0
 /**
  * Garbage collector. Is executed after this class has completed
  * its job and the template has also been displayed.
  */
 public function clean()
 {
     ($sPlugin = Phpfox_Plugin::get('privacy.component_block_form_clean')) ? eval($sPlugin) : false;
     $this->template()->clean(array('sPrivacyFormName', 'sPrivacyFormInfo', 'bPrivacyNoCustom', 'sPrivacyArray'));
     $this->clearParam('privacy_no_custom');
     $this->clearParam('privacy_custom_id');
     $this->clearParam('privacy_array');
     $this->clearParam('default_privacy');
 }
Beispiel #17
0
 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);
         }
     }
     // If we are unable to find a user lets make sure we return a 404 page not found error
     $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']);
     }
     //This is where I want to add $this->request()->get('req3') == gallery
     if (!empty($sSection) && $sSection == 'photo') {
         Phpfox::getLib('module')->setController('profiles.view');
     }
     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')));
     if ($this->request()->get('req3') != 'photo') {
         $this->template()->setBreadcrumb($sPageTitle, Phpfox::getLib('url')->makeUrl('profiles.browse'));
     } elseif ($this->request()->get('req3') == '') {
         $this->template()->setBreadcrumb(Phpfox::getPhrase('profiles.extra_profiles'), Phpfox::getLib('url')->makeUrl('profiles.browse'));
     }
     $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>');
     }
     if ($sPlugin = Phpfox_Plugin::get('profiles.component_controller_index_end')) {
         eval($sPlugin);
         if (isset($mReturnFromPlugin)) {
             return $mReturnFromPlugin;
         }
     }
 }
Beispiel #18
0
 /**
  * Removes a session.
  *
  * @param mixed $mName STRING name of session, ARRAY of sessions.
  */
 public function remove($mName)
 {
     if (!is_array($mName)) {
         $mName = array($mName);
     }
     ($sPlugin = Phpfox_Plugin::get('session_remove__start')) ? eval($sPlugin) : false;
     foreach ($mName as $sName) {
         unset($_SESSION[$this->_sPrefix][$sName]);
     }
 }
Beispiel #19
0
	/**
	 * Garbage collector. Is executed after this class has completed
	 * its job and the template has also been displayed.
	 */
	public function clean()
	{
		(($sPlugin = Phpfox_Plugin::get('photo.component_block_detail_clean')) ? eval($sPlugin) : false);

		$this->template()->clean(array(
				'aPhotoDetails',
				'sEmbedCode'
			)
		);
	}
Beispiel #20
0
 public function getNew()
 {
     ($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_getnew__start')) ? eval($sPlugin) : false;
     return $this->database()->select('b.blog_id, b.time_stamp, b.title, bt.text_parsed, ' . Phpfox::getUserField())->from($this->_sTable, 'b')->join(Phpfox::getT('user'), 'u', 'u.user_id = b.user_id')->join(Phpfox::getT('blog_text'), 'bt', 'bt.blog_id = b.blog_id')->where('b.is_approved = 1 AND b.privacy = 0 AND b.post_status = 1')->limit((int) Phpfox::getParam('stnewblogs.how_many_nblogs'))->order('b.time_stamp DESC')->execute('getSlaveRows');
     foreach ($aRows as $iKey => $aRow) {
         $aRows[$iKey]['posted_on'] = Phpfox::getPhrase('blog.posted_on_post_time_by_user_link', array('post_time' => Phpfox::getTime(Phpfox::getParam('blog.blog_time_stamp'), $aRow['time_stamp']), 'user' => $aRow));
     }
     ($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_getnew__end')) ? eval($sPlugin) : false;
     return $aRows;
 }
Beispiel #21
0
	/**
	 * Garbage collector. Is executed after this class has completed
	 * its job and the template has also been displayed.
	 */
	public function clean()
	{
		(($sPlugin = Phpfox_Plugin::get('core.component_controller_index_clean')) ? eval($sPlugin) : false);
		
		// Clean template vars from memory
		$this->template()->clean(array(
				'sUserProfileUrl'
			)
		);
	}
Beispiel #22
0
 public function deleteImage()
 {
     ($sPlugin = Phpfox_Plugin::get('quiz.component_ajax_deleteimage_start')) ? eval($sPlugin) : false;
     $iQuiz = (int) $this->get('iQuiz');
     if (Phpfox::getService('quiz.process')->deleteImage($iQuiz, Phpfox::getUserId())) {
         $this->call('$("#js_submit_upload_image").show();');
         $this->call('$("#js_event_current_image").remove();');
     } else {
         $this->call('$("#js_event_current_image").after("' . Phpfox::getPhrase('quiz.an_error_occured_and_your_image_could_not_be_deleted_please_try_again') . '");');
     }
     ($sPlugin = Phpfox_Plugin::get('quiz.component_ajax_deleteimage_end')) ? eval($sPlugin) : false;
 }
Beispiel #23
0
	/**
	 * Garbage collector. Is executed after this class has completed
	 * its job and the template has also been displayed.
	 */
	public function clean()
	{
		(($sPlugin = Phpfox_Plugin::get('shoutbox.component_controller_index_clean')) ? eval($sPlugin) : false);
		
		// Remove template vars from memory
		$this->template()->clean(array(
				'aShoutouts',
				'iShoutboxRefresh',
				'iShoutoutWordWrap'
			)
		);
	}	
Beispiel #24
0
	public function edit()
	{	
		if (($sContent = Phpfox::getService('custom')->getFieldForEdit($this->get('field_id'), $this->get('item_id'), $this->get('edit_user_id'))))
		{		
			$this->call('$(\'#js_custom_field_' . $this->get('field_id') . '\').html(\'' . str_replace("'", "\'", $sContent) . '\');')
				->show('#js_custom_field_' . $this->get('field_id'));
				// ->hide('#js_custom_loader_' . $this->get('field_id'))
				// ->show('#js_custom_link_' . $this->get('field_id'));

			(($sPlugin = Phpfox_Plugin::get('custom.component_ajax_edit')) ? eval($sPlugin) : false);
		}
	}
Beispiel #25
0
 /**
  * If a call is made to an unknown method attempt to connect
  * it to a specific plug-in with the same name thus allowing 
  * plug-in developers the ability to extend classes.
  *
  * @param string $sMethod is the name of the method
  * @param array $aArguments is the array of arguments of being passed
  */
 public function __call($sMethod, $aArguments)
 {
     /**
      * Check if such a plug-in exists and if it does call it.
      */
     if ($sPlugin = Phpfox_Plugin::get('report.service_data_data__call')) {
         return eval($sPlugin);
     }
     /**
      * No method or plug-in found we must throw a error.
      */
     Phpfox_Error::trigger('Call to undefined method ' . __CLASS__ . '::' . $sMethod . '()', E_USER_ERROR);
 }
Beispiel #26
0
 /**
  * Hides the announcement block from the Dashboard
  */
 public function hide()
 {
     ($sPlugin = Phpfox_Plugin::get('announcement.component_ajax_hide__start')) ? eval($sPlugin) : false;
     if (Phpfox::getUserParam('announcement.can_close_announcement') == true) {
         if (Phpfox::getService('announcement.process')->hide($this->get('id'))) {
             $this->call(' $("#announcement").remove();');
             return true;
         }
     }
     ($sPlugin = Phpfox_Plugin::get('announcement.component_ajax_hide__end')) ? eval($sPlugin) : false;
     $this->alert(Phpfox::getPhrase('announcement.im_afraid_you_are_not_allowed_to_close_this_announcement'));
     return false;
 }
Beispiel #27
0
 public function updateFields()
 {
     $aVals = $this->get('custom');
     if (empty($aVals)) {
         $aVals = $this->get('val');
     }
     if (!empty($aVals)) {
         $aCustomFields = Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), Phpfox::getUserId(), Phpfox::getUserBy('user_group_id'), false, Phpfox::getUserId());
         foreach ($aCustomFields as $aCustomField) {
             if (empty($aVals[$aCustomField['field_id']]) && $aCustomField['is_required']) {
                 Phpfox_Error::set(Phpfox::getPhrase('user.the_field_field_is_required', array('field' => Phpfox::getPhrase($aCustomField['phrase_var_name']))));
             } else {
                 if ((!isset($aVals[$aCustomField['field_id']]) || empty($aVals[$aCustomField['field_id']])) && !$aCustomField['is_required']) {
                     Phpfox::getService('custom.process')->updateField($aCustomField, Phpfox::getUserId(), Phpfox::getUserId(), '');
                 }
             }
         }
         if ($sPlugin = Phpfox_Plugin::get('custom.component_ajax_updatefields__1')) {
             eval($sPlugin);
             if (isset($aPluginReturn)) {
                 return $aPluginReturn;
             }
         }
         if (Phpfox_Error::isPassed()) {
             $bReturnCustom = Phpfox::getService('custom.process')->updateFields(Phpfox::getUserId(), Phpfox::getUserId(), $aVals);
             $aUser = $this->get('val');
             $aUser['language_id'] = Phpfox::getUserBy('language_id');
             define('PHPFOX_IS_CUSTOM_FIELD_UPDATE', true);
             // http://www.phpfox.com/tracker/view/15441/
             $aUserFieldsRequired = array('location' => array('user.location' => $aUser['country_iso']), 'gender' => array('user.gender' => $aUser['gender']), 'day' => array('user.date_of_birth' => $aUser['day']), 'month' => array('user.date_of_birth' => $aUser['month']), 'year' => array('user.date_of_birth' => $aUser['year']));
             foreach ($aUserFieldsRequired as $aFieldRequired) {
                 foreach ($aFieldRequired as $sLangId => $mValue) {
                     if (empty($mValue)) {
                         Phpfox_Error::set(Phpfox::getPhrase('user.the_field_field_is_required', array('field' => Phpfox::getPhrase($sLangId))) . " ");
                     }
                 }
             }
             $bReturnUser = false;
             if (Phpfox_Error::isPassed()) {
                 $bReturnUser = Phpfox::getService('user.process')->update(Phpfox::getUserId(), $aUser);
             }
             // END!
             if ($bReturnCustom && $bReturnUser) {
                 $this->call('$(\'#js_custom_submit_button\').attr(\'disabled\', false).removeClass(\'disabled\'); $(\'#js_custom_update_info\').html(\'' . str_replace("'", "\\'", Phpfox::getPhrase('user.done')) . '\').fadeOut(5000);')->slideDown('#js_custom_public_message');
                 return true;
             }
         }
         $this->call('$(\'#js_custom_submit_button\').attr(\'disabled\', false).removeClass(\'disabled\'); $(\'#js_custom_update_info\').hide();');
     }
 }
Beispiel #28
0
 /**
  * Method used to compress data and then send it to the user to download on the spot.
  *
  * @param string $sName Name of the archive
  * @param string $sExt File extension of the archive (zip, tar.gz, xml)
  * @param string $sFolder Folder to compress. Must be located within the "file/cache/" folder.
  * @return bool Only returns false if we were unable to compress the data
  */
 public function download($sName, $sExt, $sFolder, $iServerId = 0)
 {
     if (!($sNewFile = Phpfox::getLib('phpfox.archive', $sExt)->compress($sName, $sFolder))) {
         return false;
     }
     if (Phpfox::getParam('core.allow_cdn')) {
         Phpfox::getLib('cdn')->put($sNewFile);
     }
     if (is_dir(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS)) {
         Phpfox_File::instance()->delete_directory(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS);
     }
     ($sPlugin = Phpfox_Plugin::get('archive_export_download')) ? eval($sPlugin) : false;
     // Phpfox::getlib('phpfox.file')->forceDownload($sNewFile, $sName . '.' . $sExt);
     Phpfox::getlib('phpfox.file')->forceDownload($sNewFile, $sName . '.' . $sExt, '', '', $iServerId);
 }
Beispiel #29
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     Phpfox::getUserParam('admincp.can_clear_site_cache', true);
     if ($this->request()->get('unlock')) {
         Phpfox::getLib('cache')->unlock();
         $this->url()->send('admincp.maintain.cache', null, Phpfox::getPhrase('admincp.cache_system_unlocked'));
     }
     if ($this->request()->get('all')) {
         Phpfox::getLib('cache')->remove();
         Phpfox::getLib('template.cache')->remove();
         Phpfox::getLib('cache')->removeStatic();
         $aParams = array('maintain', 'cache', 'clear' => 'done');
         if ($sPlugin = Phpfox_Plugin::get('admincp.component_controller_maintain_1')) {
             eval($sPlugin);
         }
         $this->url()->send('admincp', $aParams, Phpfox::getPhrase('admincp.cached_cleared'));
     }
     if ($aIds = $this->request()->getArray('id')) {
         foreach ($aIds as $sKey => $aItems) {
             foreach ($aItems as $sId) {
                 Phpfox::getLib('cache')->remove($sId, 'path');
             }
         }
         $this->url()->send('admincp', array('maintain', 'cache'), Phpfox::getPhrase('admincp.cached_cleared'));
     }
     $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));
     }
     $aSorts = array('time_stamp' => Phpfox::getPhrase('admincp.timestamp'), 'file_name' => Phpfox::getPhrase('admincp.cache_name'), 'data_size' => Phpfox::getPhrase('admincp.data_size'));
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND file_name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'time_stamp'), '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' => 'cache', 'filters' => $aFilters, 'search' => 'search'));
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aCaches) = Phpfox::getLib('cache')->getCachedFiles($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
     if ($this->request()->get('clear')) {
         $aCaches = array();
         $iCnt = 0;
     }
     if (Phpfox::isModule('Ad')) {
         $this->template()->setTitle(Phpfox::getPhrase('ad.cache_manager'))->setBreadCrumb(Phpfox::getPhrase('ad.cache_manager'));
     }
     $this->template()->assign(array('iCacheCnt' => $iCnt, 'aCaches' => $aCaches, 'aStats' => Phpfox::getLib('cache')->getStats(), 'bCacheLocked' => file_exists(PHPFOX_DIR_CACHE . 'cache.lock') ? true : false, 'sUnlockCache' => $this->url()->makeUrl('admincp.maintain.cache', array('unlock' => 'true'))));
 }
Beispiel #30
0
 /**
  * Gets the HTML output of the current textarea editor.
  *
  * @param string $iId ID of the textarea name, which also creates a unique ID for the HTML <textarea>
  * @param array $aParams Any special params that the specific form behaves different from other forms can be passed here.
  * @return string Returns the HTML output of the <textarea>
  */
 public function get($iId, $aParams = array(), $bForce = false)
 {
     $sStr = '';
     if (isset($aParams['user_group_setting']) && Phpfox::getUserParam($aParams['user_group_setting']) == false) {
         $sStr .= '<div id="layer_' . $iId . '"><textarea name="val[' . $iId . ']" rows="' . (isset($aParams['rows']) ? $aParams['rows'] : '12') . '" cols="' . (isset($aParams['cols']) ? $aParams['cols'] : '50') . '" style="width:98%;">' . $this->getValue($iId) . '</textarea></div>';
         return $sStr;
     }
     if (Phpfox::getParam('core.wysiwyg') == 'default' || $bForce === true) {
         $sStr .= '<div class="edit_menu_container">' . "\n";
         $sStr .= '<div id="js_editor_menu_' . $iId . '" class="editor_menu"></div>' . "\n";
         $sStr .= '<script type="text/javascript">$Behavior.getEditor = function() { Editor.setId(\'' . $iId . '\'); };</script>' . "\n";
         $sStr .= '<div id="layer_' . $iId . '"><textarea name="val[' . $iId . ']" rows="' . (isset($aParams['rows']) ? $aParams['rows'] : '12') . '" cols="' . (isset($aParams['cols']) ? $aParams['cols'] : '50') . '" id="' . $iId . '"' . (isset($aParams['tabindex']) ? ' tabindex="' . $aParams['tabindex'] . '"' : '') . '>' . $this->getValue($iId, isset($aParams['default_value']) ? $aParams['default_value'] : null) . '</textarea></div>';
         $sStr .= "\n" . '</div>';
     } else {
         ($sPlugin = Phpfox_Plugin::get('editor_get')) ? eval($sPlugin) : null;
     }
     return $sStr;
 }