本文整理汇总了PHP中Phpfox::getUserParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getUserParam方法的具体用法?PHP Phpfox::getUserParam怎么用?PHP Phpfox::getUserParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::getUserParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* 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: _process
/**
* 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: process
/**
* 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: doPoke
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: process
/**
* 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: process
/**
* 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: process
/**
* 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: process
/**
* 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: process
/**
* 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: process
/**
* 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: getUserSettings
/**
* get user group settings
*/
function getUserSettings()
{
foreach ($this->_aSettingUserGroup as $sVarname) {
$aUserSettings[$sVarname] = Phpfox::getUserParam($sVarname);
}
return $aUserSettings;
}
示例12: unfeature
/**
* 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: process
/**
* 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: process
public function process()
{
if (!Phpfox::getUserParam('core.can_design_dnd')) {
return false;
}
$this->template()->assign(array('bEnabled' => PHPFOX_DESIGN_DND));
}
示例15: updateActivity
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');
}