"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/forumdisplay.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

forumdisplay.php  (mybb_1821):forumdisplay.php  (mybb_1822)
skipping to change at line 286 skipping to change at line 286
{ {
$timecut = TIME_NOW - $mybb->settings['wolcutoff']; $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
$comma = ''; $comma = '';
$guestcount = 0; $guestcount = 0;
$membercount = 0; $membercount = 0;
$inviscount = 0; $inviscount = 0;
$onlinemembers = ''; $onlinemembers = '';
$doneusers = array(); $doneusers = array();
$query = $db->simple_select("sessions", "COUNT(DISTINCT ip) AS guestcount
", "uid = 0 AND time > $timecut AND location1 = $fid AND nopermission != 1");
$guestcount = $db->fetch_field($query, 'guestcount');
$query = $db->query(" $query = $db->query("
SELECT s.ip, s.uid, u.username, s.time, u.invisible, u.usergroup, SELECT
u.usergroup, u.displaygroup s.ip, s.uid, u.username, s.time, u.invisible, u.usergroup
FROM ".TABLE_PREFIX."sessions s , u.usergroup, u.displaygroup
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid) FROM
WHERE s.time > '$timecut' AND location1='$fid' AND nopermission ! ".TABLE_PREFIX."sessions s
= 1 LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.uid != 0 AND s.time > $timecut AND location1 = $fid AND n
opermission != 1
ORDER BY u.username ASC, s.time DESC ORDER BY u.username ASC, s.time DESC
"); ");
while($user = $db->fetch_array($query)) while($user = $db->fetch_array($query))
{ {
if($user['uid'] == 0) if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time'])
{ {
++$guestcount; $doneusers[$user['uid']] = $user['time'];
} ++$membercount;
else if($user['invisible'] == 1)
{
if(empty($doneusers[$user['uid']]) || $doneusers[$user['u
id']] < $user['time'])
{ {
$doneusers[$user['uid']] = $user['time']; $invisiblemark = "*";
++$membercount; ++$inviscount;
if($user['invisible'] == 1) }
{ else
$invisiblemark = "*"; {
++$inviscount; $invisiblemark = '';
} }
else
{
$invisiblemark = '';
}
if($user['invisible'] != 1 || $mybb->usergroup['c if($user['invisible'] != 1 || $mybb->usergroup['canviewwo
anviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid']) linvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{ {
$user['username'] = format_name(htmlspeci $user['username'] = format_name(htmlspecialchars_
alchars_uni($user['username']), $user['usergroup'], $user['displaygroup']); uni($user['username']), $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = build_profile_link $user['profilelink'] = build_profile_link($user['
($user['username'], $user['uid']); username'], $user['uid']);
eval("\$onlinemembers .= \"".$templates-> eval("\$onlinemembers .= \"".$templates->get("for
get("forumdisplay_usersbrowsing_user", 1, 0)."\";"); umdisplay_usersbrowsing_user", 1, 0)."\";");
$comma = $lang->comma; $comma = $lang->comma;
}
} }
} }
} }
$guestsonline = ''; $guestsonline = '';
if($guestcount) if($guestcount)
{ {
$guestsonline = $lang->sprintf($lang->users_browsing_forum_guests , $guestcount); $guestsonline = $lang->sprintf($lang->users_browsing_forum_guests , $guestcount);
} }
skipping to change at line 389 skipping to change at line 387
} }
else if($foruminfo['rulestype'] == 2) else if($foruminfo['rulestype'] == 2)
{ {
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\ ";"); eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\ ";");
} }
} }
$bgcolor = "trow1"; $bgcolor = "trow1";
// Set here to fetch only approved/deleted topics (and then below for a moderato r we change this). // Set here to fetch only approved/deleted topics (and then below for a moderato r we change this).
$visible_states = array("1");
if($fpermissions['canviewdeletionnotice'] != 0) if($fpermissions['canviewdeletionnotice'] != 0)
{ {
$visibleonly = "AND visible IN (-1,1)"; $visible_states[] = "-1";
$tvisibleonly = "AND t.visible IN (-1,1)";
}
else
{
$visibleonly = "AND visible='1'";
$tvisibleonly = "AND t.visible='1'";
} }
// Check if the active user is a moderator and get the inline moderation tools. // Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid)) if(is_moderator($fid))
{ {
eval("\$inlinemodcol = \"".$templates->get("forumdisplay_inlinemoderation _col")."\";"); eval("\$inlinemodcol = \"".$templates->get("forumdisplay_inlinemoderation _col")."\";");
$ismod = true; $ismod = true;
$inlinecount = "0"; $inlinecount = "0";
$inlinemod = ''; $inlinemod = '';
$inlinecookie = "inlinemod_forum".$fid; $inlinecookie = "inlinemod_forum".$fid;
if(is_moderator($fid, "canviewdeleted") == true || is_moderator($fid, "ca nviewunapprove") == true) if(is_moderator($fid, "canviewdeleted") == true)
{ {
if(is_moderator($fid, "canviewunapprove") == true && is_moderator $visible_states[] = "-1";
($fid, "canviewdeleted") == false) }
{ if(is_moderator($fid, "canviewunapprove") == true)
$visibleonly = "AND visible IN (0,1)"; {
$tvisibleonly = "AND t.visible IN (0,1)"; $visible_states[] = "0";
}
elseif(is_moderator($fid, "canviewdeleted") == true && is_moderat
or($fid, "canviewunapprove") == false)
{
$visibleonly = "AND visible IN (-1,1)";
$tvisibleonly = "AND t.visible IN (-1,1)";
}
else
{
$visibleonly = " AND visible IN (-1,0,1)";
$tvisibleonly = " AND t.visible IN (-1,0,1)";
}
} }
} }
else else
{ {
$inlinemod = $inlinemodcol = ''; $inlinemod = $inlinemodcol = '';
$ismod = false; $ismod = false;
} }
$visible_condition = "visible IN (".implode(',', array_unique($visible_states)).
")";
$visibleonly = "AND ".$visible_condition;
// Allow viewing own unapproved threads for logged in users
if($mybb->user['uid'] && $mybb->settings['showownunapproved'])
{
$visible_condition .= " OR (t.visible=0 AND t.uid=".(int)$mybb->user['uid
'].")";
}
$tvisibleonly = "AND (t.".$visible_condition.")";
if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1) if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1)
{ {
$can_edit_titles = 1; $can_edit_titles = 1;
} }
else else
{ {
$can_edit_titles = 0; $can_edit_titles = 0;
} }
unset($rating); unset($rating);
skipping to change at line 614 skipping to change at line 609
$useronly = $tuseronly = ""; $useronly = $tuseronly = "";
if(isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewow nthreads'] == 1) if(isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewow nthreads'] == 1)
{ {
$useronly = "AND uid={$mybb->user['uid']}"; $useronly = "AND uid={$mybb->user['uid']}";
$tuseronly = "AND t.uid={$mybb->user['uid']}"; $tuseronly = "AND t.uid={$mybb->user['uid']}";
} }
if($fpermissions['canviewthreads'] != 0) if($fpermissions['canviewthreads'] != 0)
{ {
// How many threads are there? // How many threads are there?
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$ fid' $useronly $visibleonly $datecutsql $prefixsql"); $query = $db->simple_select("threads t", "COUNT(tid) AS threads", "fid = '$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixsql2");
$threadcount = $db->fetch_field($query, "threads"); $threadcount = $db->fetch_field($query, "threads");
} }
// How many pages are there? // How many pages are there?
if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{ {
$mybb->settings['threadsperpage'] = 20; $mybb->settings['threadsperpage'] = 20;
} }
$perpage = $mybb->settings['threadsperpage']; $perpage = $mybb->settings['threadsperpage'];
skipping to change at line 847 skipping to change at line 842
$announcementlist = ''; $announcementlist = '';
} }
$tids = $threadcache = array(); $tids = $threadcache = array();
$icon_cache = $cache->read("posticons"); $icon_cache = $cache->read("posticons");
if($fpermissions['canviewthreads'] != 0) if($fpermissions['canviewthreads'] != 0)
{ {
$plugins->run_hooks("forumdisplay_get_threads"); $plugins->run_hooks("forumdisplay_get_threads");
// Allow viewing unapproved threads for logged in users
if($mybb->user['uid'] && $mybb->settings['showownunapproved'])
{
$tvisibleonly .= " OR (t.fid='$fid' AND t.uid=".$mybb->user['uid'
].")";
}
// Start Getting Threads // Start Getting Threads
$query = $db->query(" $query = $db->query("
SELECT t.*, {$ratingadd}t.username AS threadusername, u.username SELECT t.*, {$ratingadd}t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixs ql2 WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixs ql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield 2 ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield 2
LIMIT $start, $perpage LIMIT $start, $perpage
"); ");
skipping to change at line 1491 skipping to change at line 1480
} }
$clearstoredpass = ''; $clearstoredpass = '';
if($foruminfo['password'] != '') if($foruminfo['password'] != '')
{ {
eval("\$clearstoredpass = \"".$templates->get("forumdisplay_threa dlist_clearpass")."\";"); eval("\$clearstoredpass = \"".$templates->get("forumdisplay_threa dlist_clearpass")."\";");
} }
$prefixselect = build_forum_prefix_select($fid, $tprefix); $prefixselect = build_forum_prefix_select($fid, $tprefix);
$plugins->run_hooks("forumdisplay_threadlist");
$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, h tmlspecialchars_uni(strip_tags($foruminfo['name']))); $lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, h tmlspecialchars_uni(strip_tags($foruminfo['name'])));
eval("\$rssdiscovery = \"".$templates->get("forumdisplay_rssdiscovery")." \";"); eval("\$rssdiscovery = \"".$templates->get("forumdisplay_rssdiscovery")." \";");
eval("\$threadslist = \"".$templates->get("forumdisplay_threadlist")."\"; "); eval("\$threadslist = \"".$templates->get("forumdisplay_threadlist")."\"; ");
} }
else else
{ {
$rssdiscovery = ''; $rssdiscovery = '';
$threadslist = ''; $threadslist = '';
if(empty($forums)) if(empty($forums))
 End of changes. 14 change blocks. 
68 lines changed or deleted 58 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)