本文整理汇总了PHP中Phpfox::isUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::isUser方法的具体用法?PHP Phpfox::isUser怎么用?PHP Phpfox::isUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::isUser方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
if (Phpfox::getService('favorite.process')->add($this->request()->get('type'), $this->request()->get('id'))) {
Phpfox::getLib('ajax')->call('<script type="text/javascript">$(\'#js_footer_bar_favorite_content\').html(\'<!-- EMPTY_FOOTER_BAR -->\');</script>');
}
}
示例2: 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));
}
示例3: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
$sMessage = Phpfox::getPhrase('share.hi_check_this_out_bbcode', array('url' => $this->request()->get('url')));
$sMessage = str_replace("\n", "", $sMessage);
$this->template()->assign(array('sTitle' => $this->request()->get('title'), 'sMessage' => $sMessage));
}
示例4: 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('');
}
}
}
}
示例5: process
/**
* Controller
*/
public function process()
{
$this->url()->send('music');
Phpfox::isUser(true);
if (Phpfox::getParam('music.music_user_group_id') == Phpfox::getUserBy('user_group_id')) {
$this->url()->send('music');
}
$aUser = array('full_name' => Phpfox::getUserBy('full_name'));
$aSettings = Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), Phpfox::getUserId(), Phpfox::getParam('music.music_user_group_id'));
$aParams = array('full_name' => Phpfox::getPhrase('music.provide_a_artist_band_name'), 'agree' => Phpfox::getPhrase('music.tick_the_box_to_agree_to_our_terms_and_privacy_policy'));
foreach ($aSettings as $sKey => $aSetting) {
if ($aSetting['is_required']) {
$aParams['custom_field_' . $aSetting['field_id']] = array('title' => Phpfox::getPhrase('music.provide_a_value_for') . ': ' . Phpfox::getPhrase($aSetting['phrase_var_name']), 'def' => 'required', 'php_id' => 'custom[' . $aSetting['field_id'] . ']');
}
}
$oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aParams));
if ($aVals = $this->request()->getArray('val')) {
if ($oValid->isValid($aVals)) {
if (Music_Service_Process::instance()->convertMember($aVals, $this->request()->getArray('custom'))) {
$this->url()->send('music', null, Phpfox::getPhrase('music.you_have_successfully_converted_your_account'));
}
}
}
$this->template()->setTitle(Phpfox::getPhrase('music.musician_registration'))->setBreadcrumb(Phpfox::getPhrase('music.music'), $this->url()->makeUrl('music'))->setBreadcrumb(Phpfox::getPhrase('music.registration'), null, true)->setFullSite()->assign(array('aForms' => $aUser, 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(), 'aSettings' => $aSettings));
}
示例6: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
if (Phpfox::getUserBy('profile_page_id')) {
Phpfox::getService('pages')->setIsInPage();
}
if (!($aAlbum = Phpfox::getService('photo.album')->getForEdit($this->request()->getInt('id')))) {
return Phpfox_Error::display(Phpfox::getPhrase('photo.photo_album_not_found'));
}
if ($aVals = $this->request()->getArray('val')) {
if ($this->request()->get('req3') == 'photo') {
if (Phpfox::getService('photo.process')->massProcess($aAlbum, $aVals)) {
$this->url()->send('photo.edit-album.photo', array('id' => $aAlbum['album_id']), Phpfox::getPhrase('photo.photo_s_successfully_updated'));
}
} else {
if (Phpfox::getService('photo.album.process')->update($aAlbum['album_id'], $aVals)) {
$this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name'], true, Phpfox::getPhrase('photo.album_successfully_updated'));
}
}
}
$aMenus = array('detail' => Phpfox::getPhrase('photo.album_info'), 'photo' => Phpfox::getPhrase('photo.photos'));
$this->template()->buildPageMenu('js_photo_block', $aMenus, array('link' => $this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name']), 'phrase' => Phpfox::getPhrase('photo.view_this_album_uppercase')));
list($iCnt, $aPhotos) = Phpfox::getService('photo')->get('p.album_id = ' . (int) $aAlbum['album_id']);
list($iAlbumCnt, $aAlbums) = Phpfox::getService('photo.album')->get('pa.user_id = ' . Phpfox::getUserId());
$this->template()->setTitle(Phpfox::getPhrase('photo.editing_album') . ': ' . $aAlbum['name'])->setFullSite()->setBreadcrumb(Phpfox::getPhrase('photo.photo'), $this->url()->makeUrl('photo'))->setBreadcrumb(Phpfox::getPhrase('photo.editing_album') . ': ' . $aAlbum['name'], $this->url()->makeUrl('photo.edit-album', array('id' => $aAlbum['album_id'])), true)->setHeader(array('edit.css' => 'module_photo', 'photo.js' => 'module_photo'))->assign(array('aForms' => $aAlbum, 'aPhotos' => $aPhotos, 'aAlbums' => $aAlbums));
}
示例7: query
public function query()
{
if (Phpfox::isUser() && Phpfox::isModule('like'))
{
$this->database()->select('lik.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \'quiz\' AND lik.item_id = q.quiz_id AND lik.user_id = ' . Phpfox::getUserId());
}
}
示例8: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
// http://www.phpfox.com/tracker/view/15093/
$bIsThickBox = $this->getParam('bIsThickBox');
$this->template()->assign(array('bIsThickBox' => $bIsThickBox));
if ($this->request()->getInt('purchase_id')) {
if (!($aPackage = Phpfox::getService('subscribe.purchase')->getInvoice($this->request()->getInt('purchase_id'), true))) {
return Phpfox_Error::set(Phpfox::getPhrase('subscribe.unable_to_find_the_purchase_you_are_looking_for'));
}
$iPurchaseId = $aPackage['purchase_id'];
} else {
if (!($aPackage = Phpfox::getService('subscribe')->getPackage($this->request()->getInt('id')))) {
return Phpfox_Error::set(Phpfox::getPhrase('subscribe.unable_to_find_the_package_you_are_looking_for'));
}
if (Phpfox::getUserBy('user_group_id') == $aPackage['user_group_id']) {
return Phpfox_Error::set(Phpfox::getPhrase('subscribe.attempting_to_upgrade_to_the_same_user_group_you_are_already_in'));
}
$aPackage['default_currency_id'] = isset($aPackage['default_currency_id']) ? $aPackage['default_currency_id'] : $aPackage['price'][0]['alternative_currency_id'];
$aPackage['default_cost'] = isset($aPackage['default_cost']) ? $aPackage['default_cost'] : $aPackage['price'][0]['alternative_cost'];
$iPurchaseId = Phpfox::getService('subscribe.purchase.process')->add(array('package_id' => $aPackage['package_id'], 'currency_id' => $aPackage['default_currency_id'], 'price' => $aPackage['default_cost']));
/* Make sure we mark it as free only if the default cost is free and its not a recurring charge */
if ($aPackage['default_cost'] == '0.00' && $aPackage['recurring_period'] == 0) {
$this->template()->assign('bIsFree', true);
$this->template()->assign('iPurchaseId', $iPurchaseId);
Phpfox::getService('subscribe.purchase.process')->update($iPurchaseId, $aPackage['package_id'], 'completed', Phpfox::getUserId(), $aPackage['user_group_id'], $aPackage['fail_user_group']);
return;
}
}
/* Load the gateway only if its not free */
if (($aPackage['default_cost'] != '0.00' || $aPackage['recurring_period'] != 0) && $iPurchaseId) {
$this->setParam('gateway_data', array('item_number' => 'subscribe|' . $iPurchaseId, 'currency_code' => $aPackage['default_currency_id'], 'amount' => $aPackage['default_cost'], 'item_name' => $aPackage['title'], 'return' => $this->url()->makeUrl('subscribe.complete'), 'recurring' => $aPackage['recurring_period'], 'recurring_cost' => isset($aPackage['default_recurring_cost']) ? $aPackage['default_recurring_cost'] : '', 'alternative_cost' => isset($aPackage['price'][0]) ? serialize($aPackage['price']) : '', 'alternative_recurring_cost' => isset($aPackage['recurring_price'][0]) ? serialize($aPackage['recurring_price']) : ''));
}
}
示例9: query
public function query()
{
$this->database()->select('blog_text.text_parsed AS text, ')->join(Phpfox::getT('blog_text'), 'blog_text', 'blog_text.blog_id = blog.blog_id');
if (Phpfox::isUser() && Phpfox::isModule('like')) {
$this->database()->select('lik.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \'blog\' AND lik.item_id = blog.blog_id AND lik.user_id = ' . Phpfox::getUserId());
}
}
示例10: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
if ($iInvite = $this->request()->getInt('del')) {
$bDel = Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
if ($bDel) {
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
}
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
} elseif ($aInvite = $this->request()->get('val')) {
$bDel = true;
foreach ($aInvite as $iInvite) {
$bDel = $bDel && Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
}
if ($bDel) {
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
}
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
}
$iPage = $this->request()->getInt('page');
$iPageSize = (int) Phpfox::getParam('invite.pendings_to_show_per_page');
list($iCnt, $aInvites) = Phpfox::getService('invite')->get(Phpfox::getUserId(), $iPage, $iPageSize);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
$this->setParam('global_moderation', array('name' => 'invitations', 'ajax' => 'invite.moderation', 'menu' => array(array('phrase' => 'Delete', 'action' => 'delete'))));
$this->template()->setTitle(Phpfox::getPhrase('invite.pending_invitations'))->setBreadcrumb(Phpfox::getPhrase('invite.pending_invitations'))->assign(array('aInvites' => $aInvites, 'iPage' => $iPage))->setHeader('cache', array('pager.css' => 'style_css', 'pending.js' => 'module_invite'));
}
示例11: process
/**
* Controller
*/
public function process()
{
if (!defined('PHPFOX_IS_USER_PROFILE') && !Phpfox::isUser()) {
return false;
}
$aUser = $this->getParam('aUser');
$iTotal = (int) Phpfox::getComponentSetting(defined('PHPFOX_IS_USER_PROFILE') ? $aUser['user_id'] : Phpfox::getUserId(), 'friend.friend_display_limit_profile', Phpfox::getParam('friend.friend_display_limit'));
$aTopFriends = Friend_Service_Friend::instance()->getTop(defined('PHPFOX_IS_USER_PROFILE') ? $aUser['user_id'] : Phpfox::getUserId(), $iTotal);
$iCount = count($aTopFriends);
if (defined('PHPFOX_IS_USER_PROFILE') && !$iCount) {
return false;
}
$this->template()->assign(array('aTopFriends' => $aTopFriends));
if (defined('PHPFOX_IS_USER_PROFILE')) {
$this->template()->assign(array('bMoveCursor' => false));
} else {
$this->template()->assign(array('bMoveCursor' => true));
}
if (!$this->getParam('bIsAjax')) {
$this->template()->assign(array('sHeader' => Phpfox::getPhrase('friend.top_friends'), 'sBlockJsId' => 'top_friends'));
$bCanEditSettings = false;
if (defined('PHPFOX_IS_USER_PROFILE')) {
if ($aUser['user_id'] == Phpfox::getUserId()) {
// $bCanEditSettings = true;
}
$bCanEditSettings = false;
} else {
$bCanEditSettings = true;
}
if ($bCanEditSettings) {
$this->template()->assign(array('aEditBar' => array('ajax_call' => 'friend.getEditBar', 'params' => '&type_id=profile&no_delete_link=true&is_edit_top=true')));
}
return 'block';
}
}
示例12: process
/**
* Controller
*/
public function process()
{
$this->template()->assign(array('iStatus' => Phpfox::getUserBy('status_id')));
if (Phpfox::isUser()) {
$this->url()->send($this->url()->makeUrl(''));
}
}
示例13: insert
public function insert()
{
Phpfox::isUser(true);
if (Phpfox::getService('report.data.process')->add($this->get('report'), $this->get('type'), $this->get('id'), $this->get('feedback'))) {
// $this->call('tb_remove();');
}
}
示例14: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (!Phpfox::isUser())
{
exit;
}
$aImage = Phpfox::getLib('file')->load('image', array('jpg', 'gif', 'png'));
if ($aImage === false)
{
echo '<script type="text/javascript">window.parent().$(\'#js_image_error\').show();</script>';
exit;
}
$aParts = explode('x', $this->request()->get('ad_size'));
if ($sFileName = Phpfox::getLib('file')->upload('image', Phpfox::getParam('ad.dir_image'), Phpfox::getUserId() . uniqid()))
{
Phpfox::getLib('image')->createThumbnail(Phpfox::getParam('ad.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('ad.dir_image') . sprintf($sFileName, '_thumb'), ($aParts[0] / 3), ($aParts[1] - 20));
unlink(Phpfox::getParam('ad.dir_image') . sprintf($sFileName, ''));
rename(Phpfox::getParam('ad.dir_image') . sprintf($sFileName, '_thumb'), Phpfox::getParam('ad.dir_image') . sprintf($sFileName, ''));
echo '<script type="text/javascript">window.parent.$(\'.js_ad_image\').html(\'<a href="#ad-link"><img src="' . Phpfox::getParam('ad.url_image') . sprintf($sFileName, '') . '" alt="" /></a>\').show(); window.parent.$(\'#js_image_holder_message\').hide(); window.parent.$(\'#js_image_holder_link\').show(); window.parent.$(\'#js_image_id\').val(\'' . sprintf($sFileName, '') . '\');</script>';
}
exit;
}
示例15: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
exit('Use AJAX method');
Phpfox::isUser(true);
if (!($iId = $this->request()->get('id'))) {
return Phpfox_Error::display(Phpfox::getPhrase('video.id_must_be_defined'));
}
echo '<script type="text/javascript">';
if (Phpfox::getService('video.convert')->process($iId)) {
if ($this->request()->get('video-inline') == '1') {
$iFeedId = Phpfox::getService('feed.process')->getLastId();
echo 'window.parent.$.ajaxCall(\'video.displayFeed\', \'id=' . $iFeedId . '&video_id=' . $iId . '\', \'GET\');';
} elseif ($this->request()->get('isajax')) {
echo 'window.parent.Editor.insert({type: \'video\', id: \'' . (int) $iId . '\', editor_id: \'' . base64_decode($this->request()->get('editor-id')) . '\'});';
} else {
$aVideo = Phpfox::getService('video')->getForEdit($iId);
echo 'window.parent.location.href = \'' . Phpfox::permalink('video', $aVideo['video_id'], $aVideo['title']) . '\';';
}
} else {
Phpfox::getService('video.process')->delete($iId);
echo 'window.parent.document.getElementById(\'js_video_upload_error\').style.display = \'block\';';
echo 'window.parent.document.getElementById(\'js_video_upload_message\').innerHTML = \'' . implode('<br />', Phpfox_Error::get()) . '\';';
echo 'window.parent.document.getElementById(\'js_upload_inner_form\').style.display = \'block\';';
echo 'window.parent.document.getElementById(\'js_video_detail\').style.display = \'none\';';
echo 'window.parent.document.getElementById(\'js_video_process\').style.display = \'none\';';
}
echo '</script>';
exit;
}