本文整理汇总了PHP中Phpfox::getParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getParam方法的具体用法?PHP Phpfox::getParam怎么用?PHP Phpfox::getParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::getParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (Phpfox::getUserBy('profile_page_id') > 0) {
return false;
}
if ($iVideoId = $this->request()->getInt('video_id')) {
list($iCnt, $aVideos) = Phpfox::getService('video')->getRelatedVideos($iVideoId, $this->request()->get('video_title'), $this->request()->getInt('page_number') + 1);
if (!count($aVideos)) {
return false;
}
Phpfox::getLib('pager')->set(array('page' => $this->request()->getInt('page_number'), 'size' => Phpfox::getParam('video.total_related_videos'), 'count' => $iCnt));
if (Phpfox::getLib('pager')->getLastPage() <= $this->request()->getInt('page_number')) {
return false;
}
$this->template()->assign(array('aRelatedVideos' => $aVideos, 'bIsLoadingMore' => true));
} else {
$aVideo = $this->getParam('aVideo');
list($iCnt, $aVideos) = Phpfox::getService('video')->getRelatedVideos($aVideo['video_id'], $aVideo['title'], 1, true);
if (!count($aVideos)) {
return false;
}
$this->template()->assign(array('sHeader' => Phpfox::getPhrase('video.suggestions'), 'aRelatedVideos' => $aVideos));
Phpfox::getLib('pager')->set(array('page' => $this->request()->getInt('page_number'), 'size' => Phpfox::getParam('video.total_related_videos'), 'count' => $iCnt));
if ($iCnt >= Phpfox::getParam('video.total_related_videos')) {
$this->template()->assign(array('aFooter' => array(Phpfox::getPhrase('video.load_more_suggestions') => '#')));
}
return 'block';
}
}
示例2: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
// assign the categories
$this->template()->assign(array('aCategories' => Phpfox::getService('contact.contact')->getCategories()));
// create the captcha check JS
// they need to input some text always
$aValidation = array('text' => Phpfox::getPhrase('contact.fill_in_some_text_for_your_message'), 'category_id' => Phpfox::getPhrase('contact.you_need_to_choose_a_category'), 'subject' => Phpfox::getPhrase('contact.provide_a_subject'), 'full_name' => Phpfox::getPhrase('contact.provide_your_full_name'));
// do they need to complete a captcha challenge?
if (Phpfox::isModule('captcha') && Phpfox::getParam('contact.contact_enable_captcha')) {
$aValidation['image_verification'] = Phpfox::getPhrase('captcha.complete_captcha_challenge');
}
// They always need to input their email address
$aValidation['email'] = array('def' => 'email', 'title' => Phpfox::getPhrase('contact.provide_a_valid_email'));
$oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_contact_form', 'aParams' => $aValidation));
// check if we're getting a request:
if ($aVals = $this->request()->getArray('val')) {
// check the fields are valid
if ($oValid->isValid($aVals)) {
if (Phpfox::getService('contact.contact')->sendContactMessage($aVals)) {
if (!empty($aVals['category_id']) && $aVals['category_id'] == 'phpfox_sales_ticket') {
$this->url()->send('contact', array('sent' => 'true'));
} else {
$this->url()->send('contact', null, Phpfox::getPhrase('contact.your_message_was_successfully_sent'));
}
} else {
$this->template()->assign(array('aContactErrors' => Phpfox_Error::set(Phpfox::getPhrase('error.site_email_not_set'))));
}
}
}
if (Phpfox::isUser()) {
$this->template()->assign(array('sFullName' => Phpfox::getUserBy('full_name'), 'sEmail' => Phpfox::getUserBy('email')));
}
$this->template()->setTitle(Phpfox::getPhrase('contact.contact_us'))->setBreadcrumb(Phpfox::getPhrase('contact.contact_us'))->assign(array('sCreateJs' => $oValid->createJs(), 'sGetJsForm' => $oValid->getJsForm(), 'bIsSent' => $this->request()->get('sent')))->setFullSite();
}
示例3: __construct
/**
* Based on what CDN module is selected here is where we load the CDN class and initiat the object.
*
* @param array $aParams Array of any special params to pass to the module CDN class
*/
public function __construct($aParams = array())
{
if (!$this->_oObject) {
$sCdn = Phpfox::getParam('core.cdn_service') == '' ? 's3' : Phpfox::getParam('core.cdn_service');
$this->_oObject = Phpfox::getLib('phpfox.cdn.module.' . $sCdn, $aParams);
}
}
示例4: process
/**
* 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));
}
}
示例5: process
/**
* 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));
}
示例6: getNotificationAction
/** This function catches all the "actions" (Dislike, and in the future maybe others)
* */
public function getNotificationAction($aNotification)
{
//d($aNotification);die();
// get the type of item that was marked ("blog", "photo"...)
$aAction = $this->database()->select('*')->from(Phpfox::getT('action'))->where('action_id = ' . (int) $aNotification['item_id'])->limit(1)->execute('getSlaveRow');
if (empty($aAction) || !isset($aAction['item_type_id'])) {
return false;
throw new Exception('No type for this action (' . print_r($aAction, true) . ')');
}
// Check if the module is a sub module
if (preg_match('/(?P<module>[a-z]+)[_]?(?P<submodule>[a-z]{0,99})/i', $aAction['item_type_id'], $aMatch) < 1) {
throw new Exception('Malformed item_type');
}
// Call the module and get the title
if (!Phpfox::isModule($aMatch['module'])) {
return false;
}
$aRow = Phpfox::getService($aMatch['module'])->getInfoForAction($aAction);
$sUsers = Phpfox::getService('notification')->getUsers($aNotification);
$sTitle = Phpfox::getLib('parse.output')->shorten($aRow['title'], Phpfox::getParam('notification.total_notification_title_length'), '...');
$sPhrase = '';
if ($aNotification['user_id'] == $aRow['user_id']) {
// {users} disliked {gender} own {item} "{title}"
$sPhrase = Phpfox::getPhrase('like.users_disliked_gender_own_item_title', array('users' => $sUsers, 'gender' => Phpfox::getService('user')->gender($aRow['gender'], 1), 'title' => $sTitle, 'item' => $aAction['item_type_id']));
} elseif ($aRow['user_id'] == Phpfox::getUserId()) {
// {users} liked your blog "{title}"
$sPhrase = Phpfox::getPhrase('like.users_disliked_your_item_title', array('users' => $sUsers, 'title' => $sTitle, 'item' => $aAction['item_type_id']));
} else {
$sPhrase = Phpfox::getPhrase('like.users_disliked_users_item', array('users' => $sUsers, 'row_full_name' => $aRow['full_name'], 'title' => $sTitle, 'item' => $aAction['item_type_id']));
}
return array('link' => $aRow['link'], 'message' => $sPhrase, 'icon' => Phpfox_Template::instance()->getStyle('image', 'activity.png', 'blog'));
}
示例7: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
define('PHPFOX_DONT_SAVE_PAGE', true);
if (Phpfox::isUser()) {
$this->url()->send('profile');
}
switch (Phpfox::getParam('user.login_type')) {
case 'user_name':
$aValidation['login'] = Phpfox::getPhrase('user.provide_your_user_name');
break;
case 'email':
$aValidation['login'] = Phpfox::getPhrase('user.provide_your_email');
break;
default:
$aValidation['login'] = Phpfox::getPhrase('user.provide_your_user_name_email');
}
$aValidation['password'] = Phpfox::getPhrase('user.provide_your_password');
$oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_login_form', 'aParams' => $aValidation));
if ($aVals = $this->request()->getArray('val')) {
if ($oValid->isValid($aVals)) {
list($bLogged, $aUser) = Phpfox::getService('user.auth')->login($aVals['login'], $aVals['password'], isset($aVals['remember_me']) ? true : false, Phpfox::getParam('user.login_type'));
if ($bLogged) {
$this->url()->send('');
}
}
}
}
示例8: process
/**
* Process the controller
*
*/
public function process()
{
if (Phpfox::isUser()) {
$this->url()->send('');
}
if ($sRequest = $this->request()->get('id')) {
if ($aVals = $this->request()->getArray('val')) {
if (!isset($aVals['newpassword']) || !isset($aVals['newpassword2']) || $aVals['newpassword'] != $aVals['newpassword2']) {
Phpfox_Error::set(Phpfox::getPhrase('user.your_confirmed_password_does_not_match_your_new_password'));
} else {
if (Phpfox::getService('user.password')->updatePassword($sRequest, $aVals)) {
$this->url()->send('user.password.verify', null, Phpfox::getPhrase('user.password_successfully_updated'));
}
}
}
if (Phpfox::getParam('user.shorter_password_reset_routine')) {
if (Phpfox::getService('user.password')->isValidRequest($sRequest) == true) {
$this->template()->assign(array('sRequest' => $sRequest));
} else {
}
} else {
if (Phpfox::getService('user.password')->verifyRequest($sRequest)) {
$this->url()->send('user.password.verify', null, Phpfox::getPhrase('user.new_password_successfully_sent_check_your_email_to_use_your_new_password'));
}
}
}
$this->template()->setTitle(Phpfox::getPhrase('user.password_request_verification'))->setBreadcrumb(Phpfox::getPhrase('user.password_request_verification'));
}
示例9: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
$sView = $this->request()->get('view');
$aCond = array();
switch ($sView) {
case 'pending':
$aCond[] = 'AND a.is_custom = 2';
break;
case 'payment':
$aCond[] = 'AND a.is_custom = 1';
break;
case 'denied':
$aCond[] = 'AND a.is_custom = 4';
break;
default:
$aCond[] = 'AND a.is_custom = 3';
break;
}
$aCond[] = 'AND a.user_id = ' . Phpfox::getUserId();
if (Phpfox::getParam('ad.multi_ad')) {
$aCond[] = ' AND a.location = 50';
}
$aAds = Ad_Service_Ad::instance()->getForUser($aCond);
Ad_Service_Ad::instance()->getSectionMenu();
$this->template()->setTitle(Phpfox::getPhrase('ad.ad_management'))->setFullSite()->setBreadcrumb(Phpfox::getPhrase('ad.advertise'), $this->url()->makeUrl('ad'))->setBreadcrumb(Phpfox::getPhrase('ad.advertise'), $this->url()->makeUrl('ad.manage'), true)->setHeader(array('table.css' => 'style_css', 'manage.js' => 'module_ad'))->assign(array('aAllAds' => $aAds, 'sView' => $sView, 'bNewPurchase' => $this->request()->get('payment')));
}
示例10: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (Phpfox::getParam('core.phpfox_is_hosted')) {
$this->url()->send('admincp');
}
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('theme.style.process')->addCss($aVals)) {
$this->url()->send('admincp.theme.style.css.add', null, Phpfox::getPhrase('theme.css_file_successfully_added'));
}
}
if (Phpfox::getParam('core.enabled_edit_area')) {
$this->template()->setHeader(array('editarea/edit_area_full.js' => 'static_script', '<script type="text/javascript">
editAreaLoader.init({
id: "js_template_content"
,start_highlight: true
,allow_resize: "both"
,allow_toggle: false
,word_wrap: false
,language: "en"
,syntax: "css"
});
</script>'));
}
$this->template()->setTitle(Phpfox::getPhrase('theme.creating_css_file'))->setBreadcrumb(Phpfox::getPhrase('theme.creating_css_file'))->assign(array('aStyles' => Phpfox::getService('theme.style')->get()));
}
示例11: getDashboardMenus
public function getDashboardMenus()
{
if (!Phpfox::getParam('subscribe.enable_subscription_packages')) {
return false;
}
return array('subscribe.upgrades' => '#subscribe.listUpgrades?id=js_core_dashboard');
}
示例12: check
public function check()
{
if (!Phpfox::getParam('user.check_promotion_system')) {
return false;
}
if (!Phpfox::isUser()) {
return false;
}
$sCacheId = $this->cache()->set('promotion_' . Phpfox::getUserBy('user_group_id'));
$aPromotion = array();
if (!($aPromotion = $this->cache()->get($sCacheId))) {
$aPromotion = $this->database()->select('*')->from($this->_sTable)->where('user_group_id = ' . Phpfox::getUserBy('user_group_id'))->execute('getSlaveRow');
$this->cache()->save($sCacheId, $aPromotion);
}
if (isset($aPromotion['promotion_id'])) {
if ((int) Phpfox::getUserBy('activity_points') >= (int) $aPromotion['total_activity'] && (int) $aPromotion['total_activity']) {
$this->database()->update(Phpfox::getT('user'), array('user_group_id' => $aPromotion['upgrade_user_group_id']), 'user_id = ' . Phpfox::getUserId());
Phpfox_Url::instance()->send('user.promotion');
} else {
if ((int) $aPromotion['total_day'] > 0) {
if (str_replace('-', '', Phpfox::getUserBy('joined') - PHPFOX_TIME) >= $aPromotion['total_day'] * 86400) {
$this->database()->update(Phpfox::getT('user'), array('user_group_id' => $aPromotion['upgrade_user_group_id']), 'user_id = ' . Phpfox::getUserId());
Phpfox_Url::instance()->send('user.promotion');
}
}
}
}
}
示例13: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$aListing = $this->getParam('aListing');
list($iCnt, $aListings) = Phpfox::getService('marketplace')->getUserListings($aListing['listing_id'], $aListing['user_id']);
if (!$iCnt)
{
return false;
}
$this->template()->assign(array(
'sHeader' => 'More From Seller',
'aMyListings' => $aListings
)
);
if ($iCnt > Phpfox::getParam('marketplace.total_listing_more_from'))
{
$this->template()->assign(array(
'aFooter' => array(
Phpfox::getPhrase('marketplace.view_more') => $this->url()->makeUrl($aListing['user_name'], array('marketplace'))
)
)
);
}
return 'block';
}
示例14: playInFeed
public function playInFeed()
{
$aSong = Phpfox::getService('music')->getSong($this->get('id'));
if (!isset($aSong['song_id']))
{
$this->alert(Phpfox::getPhrase('music.unable_to_find_the_song_you_are_trying_to_play'));
return false;
}
Phpfox::getService('music.process')->play($aSong['song_id']);
$sSongPath = $aSong['song_path'];
$sWidth = '425px';
if ($this->get('track'))
{
$sWidth = '100%';
}
$sDivId = 'js_tmp_music_player_' . $aSong['song_id'];
$this->call('$Core.loadStaticFile(\'' . $this->template()->getStyle('static_script', 'player/' . Phpfox::getParam('core.default_music_player') . '/core.js') . '\');');
if ($this->get('feed_id'))
{
$this->call('$(\'#js_item_feed_' . $this->get('feed_id') . '\').find(\'.activity_feed_content_link:first\').html(\'<div id="' . $sDivId . '" style="width:425px; height:30px;"></div>\');');
}
else
{
$this->call('$(\'#' . ($this->get('track') ? $this->get('track') : 'js_controller_music_play_' . $this->get('id') . '') . '\').html(\'<div id="' . $sDivId . '" style="width:' . $sWidth . '; height:30px;"></div>\');');
}
$this->call('$Core.player.load({id: \'' . $sDivId . '\', auto: true, type: \'music\', play: \'' . $sSongPath . '\'});');
}
示例15: process
/**
* Controller
*/
public function process()
{
if (Phpfox::getParam('core.phpfox_is_hosted')) {
$this->url()->send('admincp');
}
$oArchiveExport = Phpfox::getLib('archive.export')->set(array('zip'));
$oArchiveImport = Phpfox::getLib('archive.import')->set(array('zip'));
if (($sExportId = $this->request()->get('id')) && !empty($sExportId)) {
if ($sData = Phpfox::getService('emoticon')->export($sExportId)) {
$oArchiveExport->download('phpfox-emoticon-' . $sExportId, 'xml', $sData);
}
}
if (isset($_FILES['import']) && ($aFile = $_FILES['import'])) {
if (preg_match('/^phpfox-emoticon-(.*?)\\.xml$/i', $aFile['name'], $aMatches)) {
if ($sXmlData = file_get_contents($aFile['tmp_name'])) {
$aParams = Phpfox::getLib('xml.parser')->parse($sXmlData);
if (($mReturn = Phpfox::getService('emoticon.process')->import($this->request()->getArray('val'), $aParams)) && is_array($mReturn)) {
$this->url()->send('admincp.emoticon.view', array('id' => $mReturn['id']), Phpfox::getPhrase('emoticon.emoticon_package_successfully_created', array('success' => $mReturn['success'], 'failed' => $mReturn['failed'])));
}
}
} else {
Phpfox_Error::set(Phpfox::getPhrase('emoticon.not_a_valid_emoticon_package_to_import'));
}
}
$this->template()->setTitle(Phpfox::getPhrase('emoticon.import_emoticons'))->setBreadcrumb(Phpfox::getPhrase('emoticon.emoticons'), $this->url()->makeUrl('admincp.emoticon.package'))->setBreadCrumb(Phpfox::getPhrase('emoticon.import_emoticons'), null, true);
}