本文整理汇总了PHP中KunenaUserBan::getInstanceByUserid方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaUserBan::getInstanceByUserid方法的具体用法?PHP KunenaUserBan::getInstanceByUserid怎么用?PHP KunenaUserBan::getInstanceByUserid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaUserBan
的用法示例。
在下文中一共展示了KunenaUserBan::getInstanceByUserid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayAll
public function displayAll()
{
if ($this->me->isAdmin()) {
if ($this->config->board_offline) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_FORUM_IS_OFFLINE'), 'notice');
}
if ($this->config->debug) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_WARNING_DEBUG'), 'notice');
}
}
if ($this->me->isBanned()) {
$banned = KunenaUserBan::getInstanceByUserid($this->me->userid, true);
if (!$banned->isLifetime()) {
$this->app->enqueueMessage(JText::sprintf('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS_EXPIRY', KunenaDate::getInstance($banned->expiration)->toKunena('date_today')), 'notice');
} else {
$this->app->enqueueMessage(JText::_('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS'), 'notice');
}
}
$this->state = $this->get('State');
$this->ktemplate->initialize();
if (JFactory::getApplication()->isAdmin()) {
$this->displayLayout();
} else {
$this->document->addHeadLink(KunenaRoute::_(), 'canonical', 'rel', '');
include JPATH_SITE . '/' . $this->ktemplate->getFile('html/display.php');
if ($this->config->get('credits', 1)) {
$this->poweredBy();
}
}
}
示例2: before
/**
* Prepare ban form.
*
* @return void
*
* @throws KunenaExceptionAuthorise
*/
protected function before()
{
parent::before();
$userid = $this->input->getInt('userid');
$this->profile = KunenaUserHelper::get($userid);
$this->profile->tryAuthorise('ban');
$this->banInfo = KunenaUserBan::getInstanceByUserid($userid, true);
$this->headerText = $this->banInfo->exists() ? JText::_('COM_KUNENA_BAN_EDIT') : JText::_('COM_KUNENA_BAN_NEW');
}
示例3: before
/**
* Prepare topic moderate display.
*
* @return void
*
* @throws KunenaExceptionAuthorise
*/
protected function before()
{
parent::before();
$catid = $this->input->getInt('catid');
$id = $this->input->getInt('id');
$mesid = $this->input->getInt('mesid');
if (!$mesid) {
$this->topic = KunenaForumTopicHelper::get($id);
$this->topic->tryAuthorise('move');
} else {
$this->message = KunenaForumMessageHelper::get($mesid);
$this->message->tryAuthorise('move');
$this->topic = $this->message->getTopic();
}
$this->category = $this->topic->getCategory();
$this->uri = "index.php?option=com_kunena&view=topic&layout=moderate" . "&catid={$this->category->id}&id={$this->topic->id}" . ($this->message ? "&mesid={$this->message->id}" : '');
$this->title = !$this->message ? JText::_('COM_KUNENA_TITLE_MODERATE_TOPIC') : JText::_('COM_KUNENA_TITLE_MODERATE_MESSAGE');
// Load topic icons if available.
if ($this->config->topicicons) {
$this->template = KunenaTemplate::getInstance();
$this->template->setCategoryIconset();
$this->topicIcons = $this->template->getTopicIcons(false);
}
// Have a link to moderate user as well.
if (isset($this->message)) {
$user = $this->message->getAuthor();
if ($user->exists()) {
$username = $user->getName();
$this->userLink = $this->message->userid ? JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=user&layout=moderate&userid=' . $this->message->userid, $username . ' (' . $this->message->userid . ')', $username . ' (' . $this->message->userid . ')') : null;
}
}
if ($this->message) {
$this->banHistory = KunenaUserBan::getUserHistory($this->message->userid);
$this->me = KunenaFactory::getUser();
// Get thread and reply count from current message:
$db = JFactory::getDbo();
$query = "SELECT COUNT(mm.id) AS replies FROM #__kunena_messages AS m\r\n\t\t\t\tINNER JOIN #__kunena_messages AS t ON m.thread=t.id\r\n\t\t\t\tLEFT JOIN #__kunena_messages AS mm ON mm.thread=m.thread AND mm.time > m.time\r\n\t\t\t\tWHERE m.id={$db->Quote($this->message->id)}";
$db->setQuery($query, 0, 1);
$this->replies = $db->loadResult();
if (KunenaError::checkDatabaseError()) {
return;
}
}
$this->banInfo = KunenaUserBan::getInstanceByUserid(JFactory::getUser()->id, true);
}
示例4: displayAll
public function displayAll()
{
if ($this->inLayout) {
throw new LogicException(sprintf('HMVC template should not call %s::%s()', __CLASS__, __FUNCTION__));
}
if ($this->me->isAdmin()) {
if ($this->config->board_offline) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_FORUM_IS_OFFLINE'), 'notice');
}
if ($this->config->debug) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_WARNING_DEBUG'), 'notice');
}
}
if ($this->me->isBanned()) {
$banned = KunenaUserBan::getInstanceByUserid($this->me->userid, true);
if (!$banned->isLifetime()) {
$this->app->enqueueMessage(JText::sprintf('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS_EXPIRY', KunenaDate::getInstance($banned->expiration)->toKunena('date_today')), 'notice');
} else {
$this->app->enqueueMessage(JText::_('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS'), 'notice');
}
}
$this->state = $this->get('State');
$this->ktemplate->initialize();
$menu = $this->app->getMenu();
$home = $menu->getItems('type', 'alias');
$juricurrent = JURI::current();
if (JFactory::getApplication()->isAdmin()) {
$this->displayLayout();
} elseif ($home) {
$this->document->addHeadLink($juricurrent, 'canonical', 'rel', '');
include JPATH_SITE . '/' . $this->ktemplate->getFile('html/display.php');
} else {
$this->document->addHeadLink(KunenaRoute::_(), 'canonical', 'rel', '');
include JPATH_SITE . '/' . $this->ktemplate->getFile('html/display.php');
if ($this->config->get('credits', 1)) {
$this->poweredBy();
}
}
}
示例5: unblock
function unblock() {
$app = JFactory::getApplication ();
kimport('kunena.user.ban');
if (! JRequest::checkToken ()) {
$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
$app->redirect ( KunenaRoute::_($this->baseurl, false) );
}
$cid = JRequest::getVar ( 'cid', array (), 'post', 'array' );
$userid = (int)array_shift($cid);
if ($userid < 0 ) {
$app->enqueueMessage ( JText::_('COM_KUNENA_PROFILE_NO_USER'), 'error' );
$app->redirect ( KunenaRoute::_($this->baseurl, false) );
}
$ban = KunenaUserBan::getInstanceByUserid ( $userid, true );
if (! $ban->id) {
$ban->ban ( $userid, null, 1 );
$success = $ban->save ();
} else {
jimport ('joomla.utilities.date');
$now = new JDate();
$ban->setExpiration ( $now );
$success = $ban->save ();
}
$message = JText::_ ( 'COM_KUNENA_USER_UNBLOCK_DONE' );
if (! $success) {
$app->enqueueMessage ( $ban->getError (), 'error' );
} else {
$app->enqueueMessage ( $message );
}
$app->redirect ( KunenaRoute::_($this->baseurl, false) );
}
示例6: ban
function ban()
{
$user = KunenaFactory::getUser(JRequest::getInt('userid', 0));
if (!$user->exists() || !JSession::checkToken('post')) {
$this->app->redirect($user->getUrl(false), JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
return;
}
$ban = KunenaUserBan::getInstanceByUserid($user->userid, true);
if (!$ban->canBan()) {
$this->setRedirect($user->getUrl(false), $ban->getError(), 'error');
return;
}
$ip = JRequest::getString('ip', '');
$block = JRequest::getInt('block', 0);
$expiration = JRequest::getString('expiration', '');
$reason_private = JRequest::getString('reason_private', '');
$reason_public = JRequest::getString('reason_public', '');
$comment = JRequest::getString('comment', '');
if (!$ban->id) {
$ban->ban($user->userid, $ip, $block, $expiration, $reason_private, $reason_public, $comment);
$success = $ban->save();
$this->report($user->userid);
} else {
$delban = JRequest::getString('delban', '');
if ($delban) {
$ban->unBan($comment);
$success = $ban->save();
} else {
$ban->blocked = $block;
$ban->setExpiration($expiration, $comment);
$ban->setReason($reason_public, $reason_private);
$success = $ban->save();
}
}
if ($block) {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BLOCKED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBLOCKED_DONE');
}
} else {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BANNED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBANNED_DONE');
}
}
if (!$success) {
$this->app->enqueueMessage($ban->getError(), 'error');
} else {
$this->app->enqueueMessage($message);
}
$banDelPosts = JRequest::getString('bandelposts', '');
$DelAvatar = JRequest::getString('delavatar', '');
$DelSignature = JRequest::getString('delsignature', '');
$DelProfileInfo = JRequest::getString('delprofileinfo', '');
if (!empty($DelAvatar) || !empty($DelProfileInfo)) {
jimport('joomla.filesystem.file');
$avatar_deleted = '';
// Delete avatar from file system
if (JFile::exists(JPATH_ROOT . '/media/kunena/avatars/' . $user->avatar) && !stristr($user->avatar, 'gallery/')) {
JFile::delete(JPATH_ROOT . '/media/kunena/avatars/' . $user->avatar);
$avatar_deleted = JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR_FILESYSTEM');
}
$user->avatar = '';
$user->save();
$this->app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR') . $avatar_deleted);
}
if (!empty($DelProfileInfo)) {
$user->personalText = '';
$user->birthdate = '0000-00-00';
$user->location = '';
$user->gender = 0;
$user->icq = '';
$user->aim = '';
$user->yim = '';
$user->msn = '';
$user->skype = '';
$user->gtalk = '';
$user->twitter = '';
$user->facebook = '';
$user->myspace = '';
$user->linkedin = '';
$user->delicious = '';
$user->friendfeed = '';
$user->digg = '';
$user->blogspot = '';
$user->flickr = '';
$user->bebo = '';
$user->websitename = '';
$user->websiteurl = '';
$user->signature = '';
$user->save();
$this->app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_PROFILEINFO'));
} elseif (!empty($DelSignature)) {
$user->signature = '';
$user->save();
$this->app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_SIGNATURE'));
}
if (!empty($banDelPosts)) {
//.........这里部分代码省略.........
示例7: displayBanUser
/**
*
*/
function displayBanUser()
{
$this->baninfo = KunenaUserBan::getInstanceByUserid($this->profile->userid, true);
echo $this->loadTemplateFile('ban');
}
示例8: ban
function ban()
{
$userid = JRequest::getInt('userid', 0);
$ip = JRequest::getVar('ip', '');
$block = JRequest::getInt('block', 0);
$expiration = JRequest::getString('expiration', '');
$reason_private = JRequest::getString('reason_private', '');
$reason_public = JRequest::getString('reason_public', '');
$comment = JRequest::getString('comment', '');
if (!JRequest::checkToken()) {
while (@ob_end_clean()) {
}
$this->_app->redirect(CKunenaLink::GetProfileURL($this->profile->userid, false), COM_KUNENA_ERROR_TOKEN, 'error');
return false;
}
kimport('userban');
$ban = KunenaUserBan::getInstanceByUserid($userid, true);
if (!$ban->id) {
$ban->ban($userid, $ip, $block, $expiration, $reason_private, $reason_public, $comment);
$success = $ban->save();
} else {
$delban = JRequest::getString('delban', '');
if ($delban) {
$ban->unBan($comment);
$success = $ban->save();
} else {
$ban->blocked = $block;
$ban->setExpiration($expiration, $comment);
$ban->setReason($reason_public, $reason_private);
$success = $ban->save();
}
}
if ($block) {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BLOCKED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBLOCKED_DONE');
}
} else {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BANNED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBANNED_DONE');
}
}
if (!$success) {
$this->_app->enqueueMessage($ban->getError(), 'error');
} else {
$this->_app->enqueueMessage($message);
}
$banDelPosts = JRequest::getVar('bandelposts', '');
$DelAvatar = JRequest::getVar('delavatar', '');
$DelSignature = JRequest::getVar('delsignature', '');
$DelProfileInfo = JRequest::getVar('delprofileinfo', '');
if (!empty($DelAvatar)) {
jimport('joomla.filesystem.file');
$userprofile = KunenaFactory::getUser($userid);
$this->_db->setQuery("UPDATE #__kunena_users SET avatar=null WHERE userid={$this->_db->Quote($userid)}");
$this->_db->Query();
KunenaError::checkDatabaseError();
$avatar_deleted = '';
// Delete avatar from file system
if (JFile::exists(KUNENA_PATH_AVATAR_UPLOADED . '/' . $userprofile->avatar) && !stristr($userprofile->avatar, 'gallery/')) {
JFile::delete(KUNENA_PATH_AVATAR_UPLOADED . '/' . $userprofile->avatar);
$avatar_deleted = $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR_FILESYSTEM'));
}
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR') . $avatar_deleted);
}
if (!empty($DelSignature)) {
$this->_db->setQuery("UPDATE #__kunena_users SET signature=null WHERE userid={$this->_db->Quote($userid)}");
$this->_db->Query();
KunenaError::checkDatabaseError();
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_SIGNATURE'));
}
if (!empty($DelProfileInfo)) {
$this->_db->setQuery("UPDATE #__kunena_users SET signature=null,avatar=null,karma=null,personalText=null,gender=0,birthdate=0000-00-00,location=null,ICQ=null,AIM=null,YIM=null,MSN=null,SKYPE=null,GTALK=null,websitename=null,websiteurl=null,rank=0,TWITTER=null,FACEBOOK=null,MYSPACE=null,LINKEDIN=null,DELICIOUS=null,FRIENDFEED=null,DIGG=null,BLOGSPOT=null,FLICKR=null,BEBO=null WHERE userid={$this->_db->Quote($userid)}");
$this->_db->Query();
KunenaError::checkDatabaseError();
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_PROFILEINFO'));
}
if (!empty($banDelPosts)) {
//select only the messages which aren't already in the trash
$this->_db->setQuery("UPDATE #__kunena_messages SET hold=2 WHERE hold!=2 AND userid={$this->_db->Quote($userid)}");
$idusermessages = $this->_db->loadObjectList();
KunenaError::checkDatabaseError();
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_MESSAGES'));
}
while (@ob_end_clean()) {
}
$this->_app->redirect(CKunenaLink::GetProfileURL($this->profile->userid, false));
}
示例9: tryAuthorise
/**
* Throws an exception if user isn't authorised to do the action.
*
* @param string $action
* @param KunenaUser $user
* @param bool $throw
*
* @return KunenaExceptionAuthorise|null
* @throws KunenaExceptionAuthorise
* @throws InvalidArgumentException
*
* @since K4.0
*/
public function tryAuthorise($action = 'read', KunenaUser $user = null, $throw = true)
{
// Special case to ignore authorisation.
if ($action == 'none') {
return null;
}
// Load user if not given.
if ($user === null) {
$user = KunenaUserHelper::getMyself();
}
$config = KunenaConfig::getInstance();
$exception = null;
switch ($action) {
case 'read':
if (!isset($this->registerDate) || !$user->exists() && !$config->pubprofile) {
$exception = new KunenaExceptionAuthorise(JText::_('COM_KUNENA_PROFILEPAGE_NOT_ALLOWED_FOR_GUESTS'), $user->exists() ? 403 : 401);
}
break;
case 'edit':
if (!isset($this->registerDate) || !$this->isMyself()) {
$exception = new KunenaExceptionAuthorise(JText::sprintf('COM_KUNENA_VIEW_USER_EDIT_AUTH_FAILED', $this->getName()), $user->exists() ? 403 : 401);
}
break;
case 'ban':
$banInfo = KunenaUserBan::getInstanceByUserid($this->userid, true);
if (!$banInfo->canBan()) {
$exception = new KunenaExceptionAuthorise($banInfo->getError(), $user->exists() ? 403 : 401);
}
break;
default:
throw new InvalidArgumentException(JText::sprintf('COM_KUNENA_LIB_AUTHORISE_INVALID_ACTION', $action), 500);
}
// Throw or return the exception.
if ($throw && $exception) {
throw $exception;
}
return $exception;
}
示例10: userban
function userban($option, $userid, $block = 0)
{
$kunena_app =& JFactory::getApplication();
if (!JRequest::checkToken()) {
$kunena_app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
while (@ob_end_clean()) {
}
$kunena_app->redirect(JURI::base() . "index.php?option={$option}&task=showprofiles");
}
kimport('userban');
$userid = (int) array_shift($userid);
$ban = KunenaUserBan::getInstanceByUserid($userid, true);
if (!$ban->id) {
$ban->ban($userid, null, $block);
$success = $ban->save();
} else {
jimport('joomla.utilities.date');
$now = new JDate();
$ban->setExpiration($now);
$success = $ban->save();
}
if ($block) {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BLOCKED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBLOCK_DONE');
}
} else {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BANNED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBAN_DONE');
}
}
$kunena_app = JFactory::getApplication();
if (!$success) {
$kunena_app->enqueueMessage($ban->getError(), 'error');
} else {
$kunena_app->enqueueMessage($message);
}
while (@ob_end_clean()) {
}
$kunena_app->redirect(JURI::base() . "index.php?option=com_kunena&task=profiles");
}
示例11: unblock
public function unblock()
{
if (!JSession::checkToken('post')) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
$this->setRedirect(KunenaRoute::_($this->baseurl, false));
return;
}
$cid = JRequest::getVar('cid', array(), 'post', 'array');
// Array of integers
JArrayHelper::toInteger($cid);
$userid = array_shift($cid);
if ($userid <= 0) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_PROFILE_NO_USER'), 'error');
$this->setRedirect(KunenaRoute::_($this->baseurl, false));
return;
}
$ban = KunenaUserBan::getInstanceByUserid($userid, true);
if (!$ban->id) {
$ban->ban($userid, null, 1);
$success = $ban->save();
} else {
jimport('joomla.utilities.date');
$now = new JDate();
$ban->setExpiration($now);
$success = $ban->save();
}
$message = JText::_('COM_KUNENA_USER_UNBLOCK_DONE');
if (!$success) {
$this->app->enqueueMessage($ban->getError(), 'error');
} else {
$this->app->enqueueMessage($message);
}
$this->setRedirect(KunenaRoute::_($this->baseurl, false));
}
示例12: defined
* @package Kunena.Template.Crypsis
* @subpackage Layout.User
*
* @copyright (C) 2008 - 2016 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
defined('_JEXEC') or die;
// @var KunenaUser $profile
$profile = $this->profile;
$me = KunenaUserHelper::getMyself();
$avatar = $profile->getAvatarImage('img-polaroid', 'post');
$banInfo = $this->config->showbannedreason
? KunenaUserBan::getInstanceByUserid($profile->userid)
: null;
$private = KunenaFactory::getPrivateMessaging();
$websiteURL = $profile->getWebsiteURL();
$websiteName = $profile->getWebsiteName();
$personalText = $profile->getPersonalText();
$signature = $profile->getSignature();
$email = $profile->email && !$profile->hideEmail && $this->config->showemail || $me->isModerator() || $profile->userid == $me->userid;
$activityIntegration = KunenaFactory::getActivityIntegration();
$points = $activityIntegration->getUserPoints($profile->userid);
$medals = $activityIntegration->getUserMedals($profile->userid);
if ($this->config->showuserstats)
{
$rankImage = $profile->getRank(0, 'image');
$rankTitle = $profile->getRank(0, 'title');
示例13: isUserBanned
public function isUserBanned()
{
$profile = KunenaFactory::getUser();
$banned = $profile->isBanned();
if ($banned) {
kimport('userban');
$banned = KunenaUserBan::getInstanceByUserid($profile->userid, true);
if (!$banned->isLifetime()) {
require_once KPATH_SITE . '/lib/kunena.timeformat.class.php';
$this->_app->enqueueMessage(JText::sprintf('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS_EXPIRY', CKunenaTimeformat::showDate($banned->expiration)), 'error');
$this->redirectBack();
return true;
} else {
$this->_app->enqueueMessage(JText::_('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS'), 'error');
$this->redirectBack();
return true;
}
}
return false;
}
示例14: getTabs
/**
* Method to get tabs for user profile
*
* @return array
*/
public function getTabs()
{
$banInfo = KunenaUserBan::getInstanceByUserid($this->user->id, true);
$myProfile = $this->profile->isMyself();
$moderator = $this->me->isModerator();
// Decide which tabs to display.
$showPosts = true;
$showSubscriptions = $this->config->allowsubscriptions && $myProfile;
$showFavorites = $this->config->allowfavorites && $myProfile;
$showThankYou = $this->config->showthankyou && $this->me->exists();
$showUnapproved = $myProfile && ($this->me->isAdmin() || KunenaAccess::getInstance()->getModeratorStatus());
$showAttachments = $this->config->show_imgfiles_manage_profile && ($moderator || $myProfile);
$showBanManager = $moderator && $myProfile;
$showBanHistory = $banInfo->canBan();
$showBanUser = $banInfo->canBan();
// Define all tabs.
$tabs = array();
if ($showPosts) {
$params = array('embedded' => 1, 'topics_categories' => 0, 'topics_catselection' => 1, 'userid' => $this->profile->userid, 'mode' => 'latest', 'sel' => -1, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc', 'display' => $this->state->get('display', ''));
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_USERPOSTS');
$tab->content = $this->subRequest('Message/List/Recent', new JInput($params), $params);
$tab->active = true;
$tabs['posts'] = $tab;
}
if ($showSubscriptions) {
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_SUBSCRIPTIONS');
$tab->content = '';
if ($this->config->category_subscriptions != 'disabled') {
$params = array('embedded' => 1, 'userid' => $this->profile->userid, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
$tab->content .= $this->subRequest('Category/Subscriptions', new JInput($params), $params);
}
if ($this->config->topic_subscriptions != 'disabled') {
$params = array('embedded' => 1, 'topics_categories' => 0, 'topics_catselection' => 1, 'userid' => $this->profile->userid, 'mode' => 'subscriptions', 'sel' => -1, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
$tab->content .= $this->subRequest('Topic/List/User', new JInput($params), $params);
}
$tab->active = false;
if ($tab->content) {
$tabs['subscriptions'] = $tab;
}
}
if ($showFavorites) {
$params = array('embedded' => 1, 'topics_categories' => 0, 'topics_catselection' => 1, 'userid' => $this->profile->userid, 'mode' => 'favorites', 'sel' => -1, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_FAVORITES');
$tab->content = $this->subRequest('Topic/List/User', new JInput($params), $params);
$tab->active = false;
$tabs['favorites'] = $tab;
}
if ($showThankYou) {
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_THANK_YOU');
$tab->content = '';
$params = array('embedded' => 1, 'topics_categories' => 0, 'topics_catselection' => 1, 'userid' => $this->profile->userid, 'mode' => 'mythanks', 'sel' => -1, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
$tab->content .= $this->subRequest('Message/List/Recent', new JInput($params), $params);
$params = array('embedded' => 1, 'topics_categories' => 0, 'topics_catselection' => 1, 'userid' => $this->profile->userid, 'mode' => 'thankyou', 'sel' => -1, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
$tab->content .= $this->subRequest('Message/List/Recent', new JInput($params), $params);
$tab->active = false;
$tabs['thankyou'] = $tab;
}
if ($showUnapproved) {
$params = array('embedded' => 1, 'topics_categories' => 0, 'topics_catselection' => 1, 'userid' => $this->profile->userid, 'mode' => 'unapproved', 'sel' => -1, 'limit' => 10, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_MESSAGE_ADMINISTRATION');
$tab->content = $this->subRequest('Message/List/Recent', new JInput($params), $params);
$tab->active = false;
$tabs['unapproved'] = $tab;
}
if ($showAttachments) {
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_MANAGE_ATTACHMENTS');
$tab->content = $this->subRequest('User/Attachments');
$tab->active = false;
$tabs['attachments'] = $tab;
}
if ($showBanManager) {
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_BAN_BANMANAGER');
$tab->content = $this->subRequest('User/Ban/Manager');
$tab->active = false;
$tabs['banmanager'] = $tab;
}
if ($showBanHistory) {
$tab = new stdClass();
$tab->title = JText::_('COM_KUNENA_BAN_BANHISTORY');
$tab->content = $this->subRequest('User/Ban/History');
$tab->active = false;
$tabs['banhistory'] = $tab;
}
if ($showBanUser) {
$tab = new stdClass();
$tab->title = $banInfo->exists() ? JText::_('COM_KUNENA_BAN_EDIT') : JText::_('COM_KUNENA_BAN_NEW');
$tab->content = $this->subRequest('User/Ban/Form');
$tab->active = false;
//.........这里部分代码省略.........
示例15: defined
/**
* Kunena Component
* @package Kunena.Template.Crypsis
* @subpackage Layout.User
*
* @copyright (C) 2008 - 2015 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
defined('_JEXEC') or die;
// @var KunenaUser $profile
$profile = $this->profile;
$me = KunenaUserHelper::getMyself();
$this->ktemplate = KunenaFactory::getTemplate();
$avatar = $profile->getAvatarImage($this->ktemplate->params->get('avatarType'), 'post');
$banInfo = $this->config->showbannedreason ? KunenaUserBan::getInstanceByUserid($profile->userid) : null;
$private = $profile->getPrivateMsgURL();
$privateLabel = $profile->getPrivateMsgLabel();
$websiteURL = $profile->getWebsiteURL();
$websiteName = $profile->getWebsiteName();
$personalText = $profile->getPersonalText();
$signature = $profile->getSignature();
$email = $profile->email && !$profile->hideEmail && $this->config->showemail || $me->isModerator() || $profile->userid == $me->userid;
$activityIntegration = KunenaFactory::getActivityIntegration();
$points = $activityIntegration->getUserPoints($profile->userid);
$medals = $activityIntegration->getUserMedals($profile->userid);
if ($this->config->showuserstats) {
$rankImage = $profile->getRank(0, 'image');
$rankTitle = $profile->getRank(0, 'title');
}
?>