"Fossies" - the Fresh Open Source Software Archive  

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

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

showthread.php  (mybb_1821):showthread.php  (mybb_1822)
skipping to change at line 864 skipping to change at line 864
// Are we linked to a specific pid? // Are we linked to a specific pid?
if($mybb->input['pid']) if($mybb->input['pid'])
{ {
$where = "AND p.pid='".$mybb->input['pid']."'"; $where = "AND p.pid='".$mybb->input['pid']."'";
} }
else else
{ {
$where = " ORDER BY dateline LIMIT 0, 1"; $where = " ORDER BY dateline LIMIT 0, 1";
} }
$query = $db->query(" $query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.user name AS editusername SELECT u.*, u.username AS userusername, p.*, f.*, r.repor ters, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."reportedcontent r ON (r.id=p.pi d AND r.type='post' AND r.reportstatus != 1)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid) LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid)
WHERE p.tid='$tid' $visible $where WHERE p.tid='$tid' $visible $where
"); ");
$showpost = $db->fetch_array($query); $showpost = $db->fetch_array($query);
// Choose what pid to display. // Choose what pid to display.
if(!$mybb->input['pid']) if(!$mybb->input['pid'])
{ {
skipping to change at line 1109 skipping to change at line 1110
} }
else else
{ {
// If there are no pid's the thread is probably awaiting approval. // If there are no pid's the thread is probably awaiting approval.
error($lang->error_invalidthread); error($lang->error_invalidthread);
} }
// Get the actual posts from the database here. // Get the actual posts from the database here.
$posts = ''; $posts = '';
$query = $db->query(" $query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.user name AS editusername SELECT u.*, u.username AS userusername, p.*, f.*, r.repor ters, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."reportedcontent r ON (r.id=p.pi d AND r.type='post' AND r.reportstatus != 1)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid) LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid)
WHERE $pids WHERE $pids
ORDER BY p.dateline ORDER BY p.dateline
"); ");
while($post = $db->fetch_array($query)) while($post = $db->fetch_array($query))
{ {
if($thread['firstpost'] == $post['pid'] && $thread['visib le'] == 0) if($thread['firstpost'] == $post['pid'] && $thread['visib le'] == 0)
{ {
skipping to change at line 1519 skipping to change at line 1521
{ {
$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 gu
estcount", "uid = 0 AND time > $timecut AND location2 = $tid AND nopermission !=
1");
$guestcount = $db->fetch_field($query, 'guestcount');
$query = $db->query(" $query = $db->query("
SELECT s.ip, s.uid, s.time, u.username, u.invisible, u.us SELECT
ergroup, u.displaygroup s.ip, s.uid, s.time, u.username, u.invisible, u.u
FROM ".TABLE_PREFIX."sessions s sergroup, u.displaygroup
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid) FROM
WHERE s.time > '$timecut' AND location2='$tid' AND noperm ".TABLE_PREFIX."sessions s
ission != 1 LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid
)
WHERE s.uid != 0 AND s.time > '$timecut' AND location2='$
tid' AND nopermission != 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['u
{ id']] < $user['time'])
++$guestcount;
}
else if(empty($doneusers[$user['uid']]) || $doneusers[$us
er['uid']] < $user['time'])
{ {
++$membercount; ++$membercount;
$doneusers[$user['uid']] = $user['time']; $doneusers[$user['uid']] = $user['time'];
$invisiblemark = ''; $invisiblemark = '';
if($user['invisible'] == 1) if($user['invisible'] == 1)
{ {
$invisiblemark = "*"; $invisiblemark = "*";
++$inviscount; ++$inviscount;
} }
 End of changes. 7 change blocks. 
14 lines changed or deleted 20 lines changed or added

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