本文整理汇总了PHP中CKunenaTools::isModerator方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaTools::isModerator方法的具体用法?PHP CKunenaTools::isModerator怎么用?PHP CKunenaTools::isModerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKunenaTools
的用法示例。
在下文中一共展示了CKunenaTools::isModerator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$this->_db =& JFactory::getDBO();
$this->_my =& JFactory::getUser();
$this->_session =& KunenaFactory::getSession();
$this->_config = KunenaFactory::getConfig();
$this->_isimage = false;
$this->_isfile = false;
if (CKunenaTools::isModerator($this->_my->id) || $this->_my->id && $this->_config->allowimageregupload || !$this->_my->id && $this->_config->allowimageupload) {
$this->validImageExts = explode(',', $this->_config->imagetypes);
}
if (CKunenaTools::isModerator($this->_my->id) || $this->_my->id && $this->_config->allowfileregupload || !$this->_my->id && $this->_config->allowfileupload) {
$this->validFileExts = explode(',', $this->_config->filetypes);
}
$this->setImageResize(intval($this->_config->imagesize) * 1024, intval($this->_config->imagewidth), intval($this->_config->imageheight), intval($this->_config->imagequality));
}
示例2: displayFlat
function displayFlat()
{
if (!$this->allow) {
echo JText::_('COM_KUNENA_NO_ACCESS');
return;
}
if (CKunenaTools::isModerator($this->my->id, $this->catid)) {
$this->actionMove = true;
$this->actionDropdown[] = JHTML::_('select.option', 'bulkDel', JText::_('COM_KUNENA_DELETE_SELECTED'));
$this->actionDropdown[] = JHTML::_('select.option', 'bulkMove', JText::_('COM_KUNENA_MOVE_SELECTED'));
if ($this->config->mod_see_deleted == '1' && CKunenaTools::isModerator() || $this->config->mod_see_deleted == '0' && CKunenaTools::isAdmin()) {
$this->actionDropdown[] = JHTML::_('select.option', 'bulkDelPerm', JText::_('COM_KUNENA_BUTTON_PERMDELETE_LONG'));
$this->actionDropdown[] = JHTML::_('select.option', 'bulkRestore', JText::_('COM_KUNENA_BUTTON_UNDELETE_LONG'));
}
}
if ($this->myprofile->ordering != '0') {
$this->topic_ordering = $this->myprofile->ordering == '1' ? 'DESC' : 'ASC';
} else {
$this->topic_ordering = $this->config->default_sort == 'asc' ? 'ASC' : 'DESC';
// Just to make sure only valid options make it
}
CKunenaTools::loadTemplate('/threads/flat.php');
}
示例3: floodProtection
public function floodProtection()
{
// Flood protection
$ip = $_SERVER["REMOTE_ADDR"];
if ($this->config->floodprotection && !CKunenaTools::isModerator($this->my->id, $this->catid)) {
$this->_db->setQuery("SELECT MAX(time) FROM #__kunena_messages WHERE ip={$this->_db->Quote($ip)}");
$lastPostTime = $this->_db->loadResult();
if (KunenaError::checkDatabaseError()) {
return false;
}
if ($lastPostTime + $this->config->floodprotection > CKunenaTimeformat::internalTime()) {
echo JText::_('COM_KUNENA_POST_TOPIC_FLOOD1') . ' ' . $this->config->floodprotection . ' ' . JText::_('COM_KUNENA_POST_TOPIC_FLOOD2') . '<br />';
echo JText::_('COM_KUNENA_POST_TOPIC_FLOOD3');
return true;
}
}
return false;
}
示例4:
<?php
}
?>
</td>
</tr>
<?php
}
?>
<?php
// Show bbcode editor
CKunenaTools::loadTemplate('/editor/bbcode.php');
?>
<?php
if ($this->config->allowfileupload || $this->config->allowfileregupload && $this->my->id != 0 || ($this->config->allowimageupload || $this->config->allowimageregupload && $this->my->id != 0 || CKunenaTools::isModerator($this->my->id, $this->catid))) {
//$this->document->addScript ( KUNENA_DIRECTURL . 'js/plupload/gears_init.js' );
//$this->document->addScript ( KUNENA_DIRECTURL . 'js/plupload/plupload.full.min.js' );
?>
<tr id="kpost-attachments" class="krow<?php
echo 1 + ($this->k ^= 1);
?>
">
<td class="kcol-first">
<strong><?php
echo JText::_('COM_KUNENA_EDITOR_ATTACHMENTS');
?>
</strong>
</td>
<td class="kcol-mid">
<div id="kattachment-id" class="kattachment">
示例5: _moderatorProtection
protected function _moderatorProtection()
{
// FIXME: only allow action in categories where user has moderator rights
if (!CKunenaTools::isModerator($this->my->id, $this->catid)) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_POST_NOT_MODERATOR'), 'notice');
return true;
}
return false;
}
示例6: getView
//.........这里部分代码省略.........
}
if ($this->layout != 'indented') {
$this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('indented', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-indented', JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
}
}
//Perform subscriptions check only once
$this->cansubscribe = 0;
if ($this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->my->id) {
$this->db->setQuery("SELECT thread, future1 FROM #__kunena_subscriptions WHERE userid={$this->db->Quote($this->my->id)} AND thread={$this->db->Quote($this->thread)}");
$fb_subscribed = $this->db->loadObject();
KunenaError::checkDatabaseError();
if (!$fb_subscribed) {
$this->cansubscribe = 1;
} elseif ($fb_subscribed->future1 == 1) {
$query_thread = "UPDATE #__kunena_subscriptions\n\t\t\t\t\tSET future1=0 WHERE thread={$this->db->Quote($this->thread)} AND userid={$this->db->Quote($this->my->id)}";
$this->db->setQuery($query_thread);
$this->db->query();
}
}
//Perform favorites check only once
$fb_canfavorite = 0;
$this->db->setQuery("SELECT MAX(userid={$this->db->Quote($this->my->id)}) AS favorited, COUNT(*) AS totalfavorited FROM #__kunena_favorites WHERE thread={$this->db->Quote($this->thread)}");
list($this->favorited, $this->totalfavorited) = $this->db->loadRow();
KunenaError::checkDatabaseError();
if ($this->config->allowfavorites && $this->my->id) {
if (!$this->favorited) {
$fb_canfavorite = 1;
}
}
//get the Moderator list for display
$this->db->setQuery("SELECT m.*, u.* FROM #__kunena_moderation AS m INNER JOIN #__users AS u ON u.id=m.userid WHERE m.catid={$this->db->Quote($this->catid)} AND u.block=0");
$this->modslist = $this->db->loadObjectList();
KunenaError::checkDatabaseError();
$this->catModerators = array();
foreach ($this->modslist as $mod) {
$this->catModerators[] = $mod->userid;
$userlist[intval($mod->userid)] = intval($mod->userid);
}
// Prefetch all users/avatars to avoid user by user queries during template iterations
KunenaUser::loadUsers($userlist);
//data ready display now
if (CKunenaTools::isModerator($this->my->id, $this->catid) || $this->topicLocked == 0) {
//this user is allowed to reply to this topic
$this->thread_reply = CKunenaLink::GetTopicPostReplyLink('reply', $this->catid, $this->thread, CKunenaTools::showButton('reply', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC_LONG'));
}
// Thread Subscription
if ($this->cansubscribe == 1) {
// this user is allowed to subscribe - check performed further up to eliminate duplicate checks
// for top and bottom navigation
$this->thread_subscribe = CKunenaLink::GetTopicPostLink('subscribe', $this->catid, $this->id, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_SUBSCRIBE_TOPIC_LONG'));
}
if ($this->my->id != 0 && $this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->cansubscribe == 0) {
// this user is allowed to unsubscribe
$this->thread_subscribe = CKunenaLink::GetTopicPostLink('unsubscribe', $this->catid, $this->id, CKunenaTools::showButton('subscribe', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNSUBSCRIBE_TOPIC_LONG'));
}
//START: FAVORITES
if ($fb_canfavorite == 1) {
// this user is allowed to add a favorite - check performed further up to eliminate duplicate checks
// for top and bottom navigation
$this->thread_favorite = CKunenaLink::GetTopicPostLink('favorite', $this->catid, $this->id, CKunenaTools::showButton('favorite', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_FAVORITE_TOPIC_LONG'));
}
if ($this->my->id != 0 && $this->config->allowfavorites && $fb_canfavorite == 0) {
// this user is allowed to unfavorite
$this->thread_favorite = CKunenaLink::GetTopicPostLink('unfavorite', $this->catid, $this->id, CKunenaTools::showButton('favorite', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC')), 'nofollow', 'kicon-button kbuttonuser btn-left', JText::_('COM_KUNENA_BUTTON_UNFAVORITE_TOPIC_LONG'));
}
// FINISH: FAVORITES
if (CKunenaTools::isModerator($this->my->id, $this->catid) || !$this->kunena_forum_locked) {
//this user is allowed to post a new topic
$this->thread_new = CKunenaLink::GetPostNewTopicLink($this->catid, CKunenaTools::showButton('newtopic', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_NEW_TOPIC_LONG'));
}
if (CKunenaTools::isModerator($this->my->id, $this->catid)) {
// offer the moderator always the move link to relocate a topic to another forum
// and the (un)sticky bit links
// and the (un)lock links
if ($this->topicSticky == 0) {
$this->thread_sticky = CKunenaLink::GetTopicPostLink('sticky', $this->catid, $this->id, CKunenaTools::showButton('sticky', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_STICKY_TOPIC_LONG'));
} else {
$this->thread_sticky = CKunenaLink::GetTopicPostLink('unsticky', $this->catid, $this->id, CKunenaTools::showButton('sticky', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNSTICKY_TOPIC_LONG'));
}
if ($this->topicLocked == 0) {
$this->thread_lock = CKunenaLink::GetTopicPostLink('lock', $this->catid, $this->id, CKunenaTools::showButton('lock', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_LOCK_TOPIC_LONG'));
} else {
$this->thread_lock = CKunenaLink::GetTopicPostLink('unlock', $this->catid, $this->id, CKunenaTools::showButton('lock', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_UNLOCK_TOPIC_LONG'));
}
$this->thread_delete = CKunenaLink::GetTopicPostLink('deletethread', $this->catid, $this->id, CKunenaTools::showButton('delete', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_DELETE_TOPIC_LONG'));
$this->thread_moderate = CKunenaLink::GetTopicPostReplyLink('moderatethread', $this->catid, $this->id, CKunenaTools::showButton('moderate', JText::_('COM_KUNENA_BUTTON_MODERATE_TOPIC')), 'nofollow', 'kicon-button kbuttonmod btn-left', JText::_('COM_KUNENA_BUTTON_MODERATE'));
}
$this->headerdesc = nl2br(smile::smileReplace($this->catinfo->headerdesc, 0, $this->config->disemoticons, $this->emoticons));
$tabclass = array("row1", "row2");
$this->mmm = 0;
$this->replydir = $this->ordering == 'DESC' ? -1 : 1;
if ($this->replydir < 0) {
$this->replynum = $this->total_messages - $this->limitstart + 1;
} else {
$this->replynum = $this->limitstart;
}
$this->myname = $this->config->username ? $this->my->username : $this->my->name;
$this->allow_anonymous = !empty($this->catinfo->allow_anonymous) && $this->my->id;
$this->anonymous = $this->allow_anonymous && !empty($this->catinfo->post_anonymous);
}
示例7:
echo JText::_('COM_KUNENA_BAN_BANMANAGER');
?>
"><?php
echo JText::_('COM_KUNENA_BAN_BANMANAGER');
?>
</dt>
<dd style="display: none;">
<?php
$this->displayBanManager();
?>
</dd>
<?php
}
?>
<?php
if (CKunenaTools::isModerator($this->my->id) && $this->my->id != $this->user->id) {
?>
<dt class="closed" title="<?php
echo JText::_('COM_KUNENA_BAN_BANHISTORY');
?>
"><?php
echo JText::_('COM_KUNENA_BAN_BANHISTORY');
?>
</dt>
<dd style="display: none;">
<?php
$this->displayBanHistory();
?>
</dd>
<?php
}
示例8: while
}
$kunena_app->redirect(CKunenaLink::GetLatestPageAutoRedirectURL($pid, $kunena_config->messages_per_page, $catid));
} else {
while (@ob_end_clean()) {
}
$kunena_app->redirect(CKunenaLink::GetMyProfileURL($userid));
}
return;
}
// This checkes to see if it's not too soon for a new karma change
if (!CKunenaTools::isModerator($kunena_my->id, $catid)) {
$userprofile = KunenaFactory::getUser($kunena_my->id);
$karma_time_old = $userprofile->karma_time;
$karma_time_diff = $time - $karma_time_old;
}
if (CKunenaTools::isModerator($kunena_my->id, $catid) || $karma_time_diff >= $karma_min_seconds) {
if ($do == "increase") {
$kunena_db->setQuery("UPDATE #__kunena_users SET karma_time={$kunena_db->Quote($time)} WHERE userid={$kunena_db->Quote($kunena_my->id)} ");
$kunena_db->query();
if (KunenaError::checkDatabaseError()) {
return;
}
$kunena_db->setQuery("UPDATE #__kunena_users SET karma=karma+1 WHERE userid={$kunena_db->Quote($userid)}");
$kunena_db->query();
if (KunenaError::checkDatabaseError()) {
return;
}
// Activity integration
$activity = KunenaFactory::getActivityIntegration();
$activity->onAfterKarma($userid, $kunena_my->id, 1);
if ($pid) {
示例9: array
echo $who_name;
?>
</div>
<div>
<?php
$onlineList = array();
$hiddenList = array();
foreach ($users as $user) {
if ($user->showOnline > 0) {
$onlineList[] = CKunenaLink::GetProfileLink(intval($user->id));
} else {
$hiddenList[] = CKunenaLink::GetProfileLink(intval($user->id));
}
}
echo implode(', ', $onlineList);
if (!empty($hiddenList) && CKunenaTools::isModerator($this->my->id)) {
?>
<br />
<span class="khidden-ktitle ks"><?php
echo JText::_('COM_KUNENA_HIDDEN_USERS');
?>
: </span>
<br />
<?php
echo implode(', ', $hiddenList);
?>
<?php
}
?>
</div>
<div class="kwholegend ks">
示例10: GetProfileLink
function GetProfileLink($userid, $name = null, $title = '', $rel = 'nofollow', $class = '')
{
if (!$name) {
$profile = KunenaFactory::getUser($userid);
$name = htmlspecialchars($profile->getName(), ENT_COMPAT, 'UTF-8');
}
if ($userid == 0) {
$uclass = 'kwho-guest';
} else {
if (CKunenaTools::isAdmin($userid)) {
$uclass = 'kwho-admin';
} else {
if (CKunenaTools::isModerator($userid, false)) {
$uclass = 'kwho-globalmoderator';
} else {
if (CKunenaTools::isModerator($userid)) {
$uclass = 'kwho-moderator';
} else {
$uclass = 'kwho-user';
}
}
}
}
if ($userid > 0) {
$link = CKunenaLink::GetProfileURL($userid);
if (!empty($link)) {
return CKunenaLink::GetHrefLink($link, $name, $title, $rel, $uclass);
}
}
return "<span class=\"{$uclass}\">{$name}</span>";
}
示例11: CKunenaSearch
//.........这里部分代码省略.........
$time = 0;
switch ($this->params['searchdate']) {
case 'lastvisit':
$this->db->setQuery("SELECT lasttime FROM #__kunena_sessions WHERE userid={$this->db->Quote($this->my->id)}");
$time = $this->db->loadResult();
break;
case 'all':
break;
case '1':
case '7':
case '14':
case '30':
case '90':
case '180':
case '365':
$time = time() - 86400 * intval($this->params['searchdate']);
//24*3600
break;
default:
$time = time() - 86400 * 365;
$searchdate = '365';
}
if ($time) {
if ($this->params['beforeafter'] == 'after') {
$querystrings[] = "m.time > '{$time}'";
} else {
$querystrings[] = "m.time <= '{$time}'";
}
}
/* build query */
$querystrings[] = "m.moved='0'";
//Search also unapproved, trash
$this->show = array();
if (CKunenaTools::isModerator($this->my->id) && $this->params['show'] > 0) {
$search_forums_array = explode(',', $search_forums);
$search_forums = array();
foreach ($search_forums_array as $currforum) {
if (CKunenaTools::isModerator($this->my->id, $currforum)) {
$search_forums[] = $currforum;
}
}
if (empty($search_forums)) {
return;
}
$search_forums = implode(',', $search_forums);
$querystrings[] = "m.hold='" . (int) $this->params['show'] . "'";
} else {
$querystrings[] = "m.hold='0'";
}
$querystrings[] = "m.catid IN ({$search_forums})";
$where = implode(' AND ', $querystrings);
$groupby = array();
if ($this->params['order'] == 'dec') {
$order1 = 'DESC';
} else {
$order1 = 'ASC';
}
switch ($this->params['sortby']) {
case 'title':
$orderby = "m.subject {$order1}, m.time {$order1}";
break;
case 'views':
$orderby = "m.hits {$order1}, m.time {$order1}";
break;
/*
case 'threadstart':
示例12: elseif
">
<td class = "td-1">
<div style = "float: right; width: 14ex;"></div>
<span>
<?php
if ($user->userid == 0) {
echo JText::_('COM_KUNENA_GUEST');
} else {
echo CKunenaLink::GetProfileLink(intval($user->userid));
}
?>
</span>
<?php
if (CKunenaTools::isAdmin($this->my->id) && $this->config->hide_ip) {
echo '(' . $this->escape($user->userip) . ')';
} elseif (CKunenaTools::isModerator($this->my->id) && !$this->config->hide_ip) {
echo '(' . $this->escape($user->userip) . ')';
}
?>
</td>
<td class = "td-2" nowrap = "nowrap">
<span title="<?php
echo CKunenaTimeformat::showDate($user->time, 'config_post_dateformat_hover');
?>
">
<?php
echo CKunenaTimeformat::showDate($user->time, 'config_post_dateformat');
?>
</span>
</td>
示例13: TagExtended
//.........这里部分代码省略.........
if ($between) {
$task->autolink_disable--;
// continue autolink conversion
$ebay_maxwidth = (int) ($kunena_config->rtewidth * 9 / 10);
// Max 90% of text width
$ebay_maxheight = (int) $kunena_config->rteheight;
// max. display size
$tag_new = "";
if (is_numeric($between)) {
// Numeric: we have to assume this is an item id
$tag_new .= '<object width="' . $ebay_maxwidth . '" height="' . $ebay_maxheight . '"><param name="movie" value="http://togo.ebay.com/togo/togo.swf" /><param name="flashvars" value="base=http://togo.ebay.com/togo/&lang=' . $kunena_config->ebaylanguagecode . '&mode=normal&itemid=' . $between . '&campid=5336042350" /><embed src="http://togo.ebay.com/togo/togo.swf" type="application/x-shockwave-flash" width="355" height="300" flashvars="base=http://togo.ebay.com/togo/&lang=' . $kunena_config->ebaylanguagecode . '&mode=normal&itemid=' . $between . '&campid=5336042350"></embed></object>';
} else {
// Non numeric: we have to assume this is a search
$tag_new .= '<object width="' . $ebay_maxwidth . '" height="' . $ebay_maxheight . '"><param name="movie" value="http://togo.ebay.com/togo/togo.swf?2008013100" /><param name="flashvars" value="base=http://togo.ebay.com/togo/&lang=' . $kunena_config->ebaylanguagecode . '&mode=search&query=' . $between . '&campid=5336042350" /><embed src="http://togo.ebay.com/togo/togo.swf?2008013100" type="application/x-shockwave-flash" width="355" height="300" flashvars="base=http://togo.ebay.com/togo/&lang=' . $kunena_config->ebaylanguagecode . '&mode=search&query=' . $between . '&campid=5336042350"></embed></object>';
}
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
case 'map':
if ($between) {
$task->autolink_disable--;
// continue autolink conversion
$map_maxwidth = (int) ($kunena_config->rtewidth * 9 / 10);
// Max 90% of text width
$map_maxheight = (int) $kunena_config->rteheight;
// max. display size
$kmap =& KunenaGoogleMaps::getInstance();
$tag_new = $kmap->addMap($between);
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
case 'tableau':
if ($between) {
$task->autolink_disable--;
// continue autolink conversion
$viz_maxwidth = (int) ($kunena_config->rtewidth * 9 / 10);
// Max 90% of text width
$viz_maxheight = isset($tag->options["height"]) && is_numeric($tag->options["height"]) ? (int) $tag->options["height"] : (int) $kunena_config->rteheight;
//$url_data = parse_url ( $between );
if (preg_match('/(https?:\\/\\/.*?)\\/(?:.*\\/)*(.*\\/.*)\\?.*:toolbar=(yes|no)/', $between, $matches)) {
$tableauserver = $matches[1];
$vizualization = $matches[2];
$toolbar = $matches[3];
$tag_new = '<script type="text/javascript" src="' . $tableauserver . '/javascripts/api/viz_v1.js"></script><object class="tableauViz" width="' . $viz_maxwidth . '" height="' . $viz_maxheight . '" style="display:none;"><param name="name" value="' . $vizualization . '" /><param name="toolbar" value="' . $toolbar . '" /></object>';
}
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
case 'hide':
if ($between) {
if ($kunena_my->id == 0) {
// Hide between content from non registered users
$tag_new = JText::_('COM_KUNENA_BBCODE_HIDDENTEXT');
} else {
// Display but highlight the fact that it is hidden from guests
$tag_new = '<b>' . JText::_('COM_KUNENA_BBCODE_HIDE_IN_MESSAGE') . '</b>' . '<div class="kmsgtext-hide">' . $between . '</div>';
}
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
case 'confidential':
if ($between) {
if (!empty($this->parent->msg->userid) && $this->parent->msg->userid == $kunena_my->id || !empty($this->parent->catid) && CKunenaTools::isModerator($kunena_my->id, $this->parent->catid)) {
// Display but highlight the fact that it is hidden from everyone except admins and mods
$tag_new = '<b>' . JText::_('COM_KUNENA_BBCODE_CONFIDENTIAL_TEXT') . '</b><div class="kmsgtext-confidential">' . $between . '</div>';
}
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
case 'spoiler':
if ($between) {
if ($this->spoilerid == 0) {
// Only need the script for the first spoiler we find
$kunena_document = JFactory::getDocument();
$kunena_document->addCustomTag('<script language = "JavaScript" type = "text/javascript">' . 'function kShowDetail(srcElement) {' . 'var targetID, srcElement, targetElement, imgElementID, imgElement;' . 'targetID = srcElement.id + "_details";' . 'imgElementID = srcElement.id + "_img";' . 'targetElement = document.getElementById(targetID);' . 'imgElement = document.getElementById(imgElementID);' . 'if (targetElement.style.display == "none") {' . 'targetElement.style.display = "";' . 'imgElement.src = "' . KUNENA_JLIVEURL . '/components/com_kunena/template/default/images/emoticons/w00t.png";' . '} else {' . 'targetElement.style.display = "none";' . 'imgElement.src = "' . KUNENA_JLIVEURL . '/components/com_kunena/template/default/images/emoticons/pinch.png";' . '}} </script>');
}
$this->spoilerid++;
$randomid = 'spoiler_' . rand();
$tag_new = '<div id="' . $randomid . '" onclick="javascript:kShowDetail(this);" class = "kspoiler" ><img id="' . $randomid . '_img"' . ' src="' . KUNENA_JLIVEURL . '/components/com_kunena/template/default/images/emoticons/pinch.png" border="0" alt=":pinch:" /> <strong>' . (isset($tag->options["title"]) ? $tag->options["title"] : JText::_('COM_KUNENA_BBCODE_SPOILER')) . '</strong></div><div id="' . $randomid . '_details" style="display:none;"><span class="fb_quote">' . $between . '</span></div>';
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
case 'spoilerlight':
if ($between) {
$tag_new = '<span title="' . $between . '"><strong>' . JText::_('COM_KUNENA_EDITOR_SPOILER') . '</strong></span>';
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
default:
break;
}
return TAGPARSER_RET_NOTHING;
}
示例14: checkAuthorName
protected function checkAuthorName($field, $value)
{
if (!$this->_my->id || $this->getOption('anonymous')) {
// Unregistered or anonymous users: Do not allow existing username
jimport('joomla.user.helper');
$nicktaken = JUserHelper::getUserId($value);
if (empty($value) || $nicktaken || $value == $this->_my->name) {
$this->set('name', $name = JText::_('COM_KUNENA_USERNAME_ANONYMOUS'));
$this->_app->enqueueMessage(JText::sprintf('COM_KUNENA_POST_FIELD_NAME_CONFLICT_ANON', $value, $name), 'notice');
}
} else {
// Registered users
if (empty($value)) {
return $this->setError($field, JText::_('COM_KUNENA_POST_FIELD_NAME_EMPTY'));
}
if (CKunenaTools::isModerator($this->_my->id, $this->parent->catid)) {
// Moderators can to do whatever they want to
} else {
if ($this->_config->changename) {
// Others are not allowed to use username from other users
jimport('joomla.user.helper');
$nicktaken = JUserHelper::getUserId($value);
if ($nicktaken && $nicktaken != $this->_my->id) {
return $this->setError($field, JText::_('COM_KUNENA_POST_FIELD_NAME_CONFLICT_REG'));
}
} else {
$this->set('name', $this->_myuser->getName());
}
}
}
return true;
}
示例15:
?>
<label id="childforums-lbl">
<input type="checkbox" name="childforums" value="1" <?php
if ($this->params['childforums']) {
echo 'checked="checked"';
}
?>
/>
<span onclick="document.adminForm.childforums.checked=(! document.adminForm.childforums.checked);"><?php
echo JText::_('COM_KUNENA_SEARCH_SEARCHIN_CHILDREN');
?>
</span>
</label>
</fieldset>
<?php
if (CKunenaTools::isModerator($this->my->id)) {
?>
<fieldset class="fieldset">
<legend><?php
echo JText::_('COM_KUNENA_SEARCH_SHOW');
?>
</legend>
<input id="show0" type="radio" name="show" value="0" <?php
if ($this->params['show'] == 0) {
echo 'checked="checked"';
}
?>
/>
<label for="show0"><?php
echo JText::_('COM_KUNENA_SEARCH_SHOW_NORMAL');
?>