mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Forum: Moderators list fix. Online count fix. IMAGE_track BC Fix.
This commit is contained in:
@@ -262,7 +262,7 @@ if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_thread
|
||||
$trackPref = $forum->prefs->get('track');
|
||||
if (USER && vartrue($trackPref) && e_QUERY != 'track')
|
||||
{
|
||||
$fVars->INFO .= "<br /><a href='".e_SELF."?track'>".LAN_FORUM_0030.'</a>';
|
||||
$fVars->INFO .= "<br /><a href='".e107::url('forum','track')."'>".LAN_FORUM_0030.'</a>';
|
||||
}
|
||||
|
||||
$fVars->FORUMINFO =
|
||||
|
@@ -204,12 +204,27 @@ if(e_AJAX_REQUEST && MODERATOR) // see javascript above.
|
||||
|
||||
if(varset($pref['track_online']))
|
||||
{
|
||||
$member_users = $sql->db_Count('online', '(*)', "WHERE online_location REGEXP('viewforum.php.id=$forumId\$') AND online_user_id != 0");
|
||||
$guest_users = $sql->db_Count('online', '(*)', "WHERE online_location REGEXP('viewforum.php.id=$forumId\$') AND online_user_id = 0");
|
||||
// $member_users = $sql->count('online', '(*)', "WHERE online_location REGEXP('viewforum.php.id=$forumId\$') AND online_user_id != 0");
|
||||
// $guest_users = $sql->count('online', '(*)', "WHERE online_location REGEXP('viewforum.php.id=$forumId\$') AND online_user_id = 0");
|
||||
$member_users = $sql->count('online', '(*)', "WHERE online_location LIKE('".$tp->filter(e_REQUEST_URI)."%') AND online_user_id != 0");
|
||||
$guest_users = $sql->count('online', '(*)', "WHERE online_location LIKE('".$tp->filter(e_REQUEST_URI)."%') AND online_user_id = 0");
|
||||
|
||||
|
||||
$users = $member_users+$guest_users;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$users = 0;
|
||||
$member_users= 0;
|
||||
$guest_users = 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once(HEADERF);
|
||||
|
||||
|
||||
$text='';
|
||||
// TODO - message batch shortcode
|
||||
if ($message)
|
||||
@@ -273,10 +288,17 @@ if(substr($forum_info['sub_parent'], 0, 1) == '*')
|
||||
}
|
||||
|
||||
$forum->set_crumb(true, '', $fVars); // set $BREADCRUMB (and $BACKLINK)
|
||||
|
||||
$modUser = array();
|
||||
foreach ( $modArray as $user)
|
||||
{
|
||||
$modUser[] = "<a href='".e107::getUrl()->create('user/profile/view', $user)."'>".$user['user_name']."</a>";
|
||||
}
|
||||
$fVars->FORUMTITLE = $forumInfo['forum_name'];
|
||||
$fVars->MODERATORS = LAN_FORUM_1009.': '.implode(', ', $modArray);
|
||||
$fVars->MODERATORS = LAN_FORUM_1009.': '.implode(', ', $modUser);
|
||||
$fVars->BROWSERS = '';
|
||||
|
||||
|
||||
|
||||
if(varset($pref['track_online']))
|
||||
{
|
||||
$fVars->BROWSERS = $users.' '.($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060).' ('.$member_users.' '.($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).')';
|
||||
@@ -328,14 +350,29 @@ $fVars->SEARCH = "
|
||||
</p>
|
||||
</form>";
|
||||
|
||||
if($forum->checkPerm($forumId, 'post'))
|
||||
{
|
||||
$fVars->PERMS = LAN_FORUM_0043.' - '.LAN_FORUM_0045.' - '.LAN_FORUM_0047;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fVars->PERMS = LAN_FORUM_0044.' - '.LAN_FORUM_0046.' - '.LAN_FORUM_0048;
|
||||
}
|
||||
|
||||
// ----- Perm Display ---
|
||||
|
||||
$permDisplay = array();
|
||||
|
||||
$permDisplay['topics'] = ($forum->checkPerm($forumId, 'thread')) ? LAN_FORUM_0043 : LAN_FORUM_0044;
|
||||
if($forum->checkPerm($forumId, 'post'))
|
||||
{
|
||||
$permDisplay['post'] =LAN_FORUM_0045;
|
||||
$permDisplay['edit'] = LAN_FORUM_0047;
|
||||
}
|
||||
else
|
||||
{
|
||||
$permDisplay['post'] =LAN_FORUM_0046;
|
||||
$permDisplay['edit'] = LAN_FORUM_0048;
|
||||
}
|
||||
|
||||
|
||||
$fVars->PERMS = implode(' - '.$permDisplay);
|
||||
|
||||
|
||||
// -------------------------------
|
||||
|
||||
|
||||
$sticky_threads = 0;
|
||||
$stuck = false;
|
||||
@@ -695,11 +732,11 @@ function parse_thread($thread_info)
|
||||
$_TEMPLATE = "<tr id='thread-{$threadId}'>".substr($_TEMPLATE,4);
|
||||
}
|
||||
|
||||
if(!BOOTSTRAP)
|
||||
if(!deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$tVars->REPLIESX = $tVars->REPLIES;
|
||||
$tVars->VIEWSX = $tVars->VIEWS;
|
||||
$tVars->ADMINOPTIONS = $tVars->ADMIN_ICONS;
|
||||
$tVars->REPLIESX = $tVars->REPLIES;
|
||||
$tVars->VIEWSX = $tVars->VIEWS;
|
||||
$tVars->ADMINOPTIONS = $tVars->ADMIN_ICONS;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -264,8 +264,21 @@ $tVars->NEXTPREV .= "<a class='btn btn-default btn-sm btn-small' href='" . $e107
|
||||
|
||||
if ($forum->prefs->get('track') && USER)
|
||||
{
|
||||
// BC Fix for old template.
|
||||
if(!defined('IMAGE_track'))
|
||||
{
|
||||
define('IMAGE_track', '<img src="'.img_path('track.png').'" alt="'.LAN_FORUM_4009.'" title="'.LAN_FORUM_4009.'" class="icon S16 action" />');
|
||||
}
|
||||
|
||||
if(!defined('IMAGE_untrack'))
|
||||
{
|
||||
define('IMAGE_untrack', '<img src="'.img_path('untrack.png').'" alt="'.LAN_FORUM_4010.'" title="'.LAN_FORUM_4010.'" class="icon S16 action" />');
|
||||
}
|
||||
|
||||
|
||||
$img = ($thread->threadInfo['track_userid'] ? IMAGE_track : IMAGE_untrack);
|
||||
|
||||
|
||||
/*
|
||||
$url = $e107->url->create('forum/thread/view', array('id' => $thread->threadId), 'encode=0'); // encoding could break AJAX call
|
||||
|
||||
@@ -291,7 +304,7 @@ if ($forum->prefs->get('track') && USER)
|
||||
</script>
|
||||
";*/
|
||||
|
||||
$tVars->TRACK = "<a id='forum-track-button' href='#' title=\"".LAN_FORUM_3040."\" data-token='".e_TOKEN."' data-forum-insert='forum-track-button' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$thread->threadInfo['thread_id']."' data-forum-action='track' name='track' class='e-tip btn btn-default' >".$img."</a>
|
||||
$tVars->TRACK = "<a id='forum-track-button' href='#' title=\"".LAN_FORUM_3040."\" data-token='".deftrue('e_TOKEN','')."' data-forum-insert='forum-track-button' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$thread->threadInfo['thread_id']."' data-forum-action='track' name='track' class='e-tip btn btn-default' >".$img."</a>
|
||||
";
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user