Vergleich showthread.php - 1.8.27 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 204Zeile 204
if($mybb->input['action'] == "newpost")
{
// First, figure out what time the thread or forum were last read

if($mybb->input['action'] == "newpost")
{
// First, figure out what time the thread or forum were last read

 
	$lastread = $cutoff = 0;

	$query = $db->simple_select("threadsread", "dateline", "uid='{$mybb->user['uid']}' AND tid='{$thread['tid']}'");
$thread_read = $db->fetch_field($query, "dateline");


	$query = $db->simple_select("threadsread", "dateline", "uid='{$mybb->user['uid']}' AND tid='{$thread['tid']}'");
$thread_read = $db->fetch_field($query, "dateline");


Zeile 269Zeile 270
	$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options);
$newpost = $db->fetch_array($query);


	$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options);
$newpost = $db->fetch_array($query);


	if($newpost['pid'] && $lastread)

	if($newpost && $lastread)

	{
$highlight = '';
if($mybb->get_input('highlight'))

	{
$highlight = '';
if($mybb->get_input('highlight'))

Zeile 333Zeile 334
	$nextthread = $db->fetch_array($query);

// Are there actually next newest posts?

	$nextthread = $db->fetch_array($query);

// Are there actually next newest posts?

	if(!$nextthread['tid'])

	if(!$nextthread)

	{
error($lang->error_nonextnewest);
}

	{
error($lang->error_nonextnewest);
}

Zeile 363Zeile 364
	$nextthread = $db->fetch_array($query);

// Are there actually next oldest posts?

	$nextthread = $db->fetch_array($query);

// Are there actually next oldest posts?

	if(!$nextthread['tid'])

	if(!$nextthread)

	{
error($lang->error_nonextoldest);
}

	{
error($lang->error_nonextoldest);
}

Zeile 617Zeile 618
		// Decide what poll status to show depending on the status of the poll and whether or not the user voted already.
if(isset($alreadyvoted) || isset($showresults) || isset($nopermission))
{

		// Decide what poll status to show depending on the status of the poll and whether or not the user voted already.
if(isset($alreadyvoted) || isset($showresults) || isset($nopermission))
{

			if($alreadyvoted)



			$undovote = '';

if(isset($alreadyvoted))

			{
$pollstatus = $lang->already_voted;


			{
$pollstatus = $lang->already_voted;


				$undovote = '';

 
				if($mybb->usergroup['canundovotes'] == 1)
{
eval("\$undovote = \"".$templates->get("showthread_poll_undovote")."\";");
}
}

				if($mybb->usergroup['canundovotes'] == 1)
{
eval("\$undovote = \"".$templates->get("showthread_poll_undovote")."\";");
}
}

			elseif($nopermission)

			elseif(isset($nopermission))

			{
$pollstatus = $lang->no_voting_permission;
}

			{
$pollstatus = $lang->no_voting_permission;
}

Zeile 665Zeile 667
	}

// Create the forum jump dropdown box.

	}

// Create the forum jump dropdown box.

 
	$forumjump = '';

	if($mybb->settings['enableforumjump'] != 0)
{
$forumjump = build_forum_jump("", $fid, 1);

	if($mybb->settings['enableforumjump'] != 0)
{
$forumjump = build_forum_jump("", $fid, 1);

Zeile 797Zeile 800
	}

// Can this user perform searches? If so, we can show them the "Search thread" form

	}

// Can this user perform searches? If so, we can show them the "Search thread" form

 
	$search_thread='';

	if($forumpermissions['cansearch'] != 0)
{
eval("\$search_thread = \"".$templates->get("showthread_search")."\";");

	if($forumpermissions['cansearch'] != 0)
{
eval("\$search_thread = \"".$templates->get("showthread_search")."\";");

Zeile 819Zeile 823
		$defaultmode = $mybb->user['threadmode'];
}
else if($mybb->settings['threadusenetstyle'] == 1)

		$defaultmode = $mybb->user['threadmode'];
}
else if($mybb->settings['threadusenetstyle'] == 1)

	{

	{

		$defaultmode = 'threaded';

		$defaultmode = 'threaded';

	}

	}

	else

	else

	{

	{

		$defaultmode = 'linear';

		$defaultmode = 'linear';

	}


	}


	// If mode is unset, set the default mode
if(!isset($mybb->input['mode']))
{
$mybb->input['mode'] = $defaultmode;

	// If mode is unset, set the default mode
if(!isset($mybb->input['mode']))
{
$mybb->input['mode'] = $defaultmode;

	}


	}


	// Threaded or linear display?
$threadexbox = '';
if($mybb->get_input('mode') == 'threaded')

	// Threaded or linear display?
$threadexbox = '';
if($mybb->get_input('mode') == 'threaded')

Zeile 844Zeile 848
		if($mybb->input['pid'])
{
$where = "AND p.pid='".$mybb->input['pid']."'";

		if($mybb->input['pid'])
{
$where = "AND p.pid='".$mybb->input['pid']."'";

		}

		}

		else
{
$where = " ORDER BY dateline, pid LIMIT 0, 1";

		else
{
$where = " ORDER BY dateline, pid LIMIT 0, 1";

Zeile 857Zeile 861
			LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid)
WHERE p.tid='$tid' $visibleonly_p $where

			LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid)
WHERE p.tid='$tid' $visibleonly_p $where

		");

		");

		$showpost = $db->fetch_array($query);

		$showpost = $db->fetch_array($query);

 

// Is there actually a pid to display?
if(!$showpost)
{
error($lang->error_invalidpost);
}


// Choose what pid to display.
if(!$mybb->input['pid'])
{
$mybb->input['pid'] = $showpost['pid'];


// Choose what pid to display.
if(!$mybb->input['pid'])
{
$mybb->input['pid'] = $showpost['pid'];

		}

// Is there actually a pid to display?
if(!$showpost['pid'])
{
error($lang->error_invalidpost);
}


		}








		$attachcache = array();
if($mybb->settings['enableattachments'] == 1 && $thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts'))
{

		$attachcache = array();
if($mybb->settings['enableattachments'] == 1 && $thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts'))
{

Zeile 880Zeile 884
			while($attachment = $db->fetch_array($query))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

			while($attachment = $db->fetch_array($query))
{
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;

			}
}

$multipage = '';

			}
}

$multipage = '';


// Build the threaded post display tree.
$query = $db->query("


// Build the threaded post display tree.
$query = $db->query("

Zeile 895Zeile 899
		");
$postsdone = array();
while($post = $db->fetch_array($query))

		");
$postsdone = array();
while($post = $db->fetch_array($query))

		{

		{

			if(empty($postsdone[$post['pid']]))
{
if($post['pid'] == $mybb->input['pid'] || ($isfirst && !$mybb->input['pid']))

			if(empty($postsdone[$post['pid']]))
{
if($post['pid'] == $mybb->input['pid'] || ($isfirst && !$mybb->input['pid']))

Zeile 920Zeile 924
		if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

		if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

		}

		}


// Figure out if we need to display multiple pages.
$page = 1;


// Figure out if we need to display multiple pages.
$page = 1;

Zeile 993Zeile 997
		if($mybb->get_input('page') == "last")
{
$page = $pages;

		if($mybb->get_input('page') == "last")
{
$page = $pages;

		}


		}


		if($page > $pages || $page <= 0)
{
$page = 1;

		if($page > $pages || $page <= 0)
{
$page = 1;

Zeile 1019Zeile 1023
			if($mybb->get_input('highlight'))
{
$highlight = "?highlight=".urlencode($mybb->get_input('highlight'));

			if($mybb->get_input('highlight'))
{
$highlight = "?highlight=".urlencode($mybb->get_input('highlight'));

			}


			}


			if($defaultmode != "linear")
{
if($mybb->get_input('highlight'))

			if($defaultmode != "linear")
{
if($mybb->get_input('highlight'))

				{

				{

					$threadmode = "&amp;mode=linear";
}
else
{
$threadmode = "?mode=linear";

					$threadmode = "&amp;mode=linear";
}
else
{
$threadmode = "?mode=linear";

				}
}
}
else

				}
}
}
else

		{
if(!empty($mybb->input['highlight']))
{

		{
if(!empty($mybb->input['highlight']))
{

Zeile 1045Zeile 1049
					}
}
else

					}
}
else

				{

				{

					$highlight = "&amp;highlight=".urlencode($mybb->get_input('highlight'));
}
}

					$highlight = "&amp;highlight=".urlencode($mybb->get_input('highlight'));
}
}

Zeile 1070Zeile 1074
			if(empty($pid))
{
$pid = $getid['pid'];

			if(empty($pid))
{
$pid = $getid['pid'];

			}

			}

			// Gather a comma separated list of post IDs
$pids .= "$comma'{$getid['pid']}'";
$comma = ",";

			// Gather a comma separated list of post IDs
$pids .= "$comma'{$getid['pid']}'";
$comma = ",";

Zeile 1120Zeile 1124
		$plugins->run_hooks("showthread_linear");
}
$lang->thread_toggle = $lang->{$thread_toggle};

		$plugins->run_hooks("showthread_linear");
}
$lang->thread_toggle = $lang->{$thread_toggle};





	// Show the similar threads table if wanted.
$similarthreads = '';
if($mybb->settings['showsimilarthreads'] != 0)
{
$own_perm = '';

	// Show the similar threads table if wanted.
$similarthreads = '';
if($mybb->settings['showsimilarthreads'] != 0)
{
$own_perm = '';

		if($forumpermissions['canonlyviewownthreads'] == 1)

		if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1)

		{
$own_perm = " AND t.uid={$mybb->user['uid']}";

		{
$own_perm = " AND t.uid={$mybb->user['uid']}";

		}


		}


		switch($db->type)
{
case "pgsql":

		switch($db->type)
{
case "pgsql":

Zeile 1139Zeile 1143
					FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query
WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query{$own_perm}

					FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query
WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query{$own_perm}

					ORDER BY t.lastpost DESC

					ORDER BY t.lastpost DESC

					OFFSET 0 LIMIT {$mybb->settings['similarlimit']}
");
break;

					OFFSET 0 LIMIT {$mybb->settings['similarlimit']}
");
break;

Zeile 1172Zeile 1176
			else
{
$icon = "&nbsp;";

			else
{
$icon = "&nbsp;";

			}
if(!$similar_thread['username'])

			}
if(!$similar_thread['username'])

			{
$similar_thread['username'] = $similar_thread['profilelink'] = htmlspecialchars_uni($similar_thread['threadusername']);
}

			{
$similar_thread['username'] = $similar_thread['profilelink'] = htmlspecialchars_uni($similar_thread['threadusername']);
}

Zeile 1191Zeile 1195
				{
$similar_thread['threadprefix'] = $prefix['displaystyle'].'&nbsp;';
}

				{
$similar_thread['threadprefix'] = $prefix['displaystyle'].'&nbsp;';
}

 
			}
else
{
$similar_thread['threadprefix'] = '';

			}

$similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);

			}

$similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);

Zeile 1316Zeile 1324
			{
eval("\$viewnotes = \"".$templates->get("showthread_threadnotes_viewnotes")."\";");
$thread['notes'] = my_substr($thread['notes'], 0, 200)."... {$viewnotes}";

			{
eval("\$viewnotes = \"".$templates->get("showthread_threadnotes_viewnotes")."\";");
$thread['notes'] = my_substr($thread['notes'], 0, 200)."... {$viewnotes}";

 
			}

if(!isset($collapsedthead['threadnotes']))
{
$collapsedthead['threadnotes'] = '';
}
if(!isset($collapsedimg['threadnotes']))
{
$collapsedimg['threadnotes'] = '';
}
if(!isset($collapsed['threadnotes_e']))
{
$collapsed['threadnotes_e'] = '';

			}

$expaltext = (in_array("threadnotes", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
eval("\$threadnotesbox = \"".$templates->get("showthread_threadnotes")."\";");

			}

$expaltext = (in_array("threadnotes", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
eval("\$threadnotesbox = \"".$templates->get("showthread_threadnotes")."\";");

		}


		}


		if(is_moderator($forum['fid'], "canusecustomtools") && (!empty($forum_stats[-1]['modtools']) || !empty($forum_stats[$forum['fid']]['modtools'])))
{
$gids = explode(',', $mybb->user['additionalgroups']);

		if(is_moderator($forum['fid'], "canusecustomtools") && (!empty($forum_stats[-1]['modtools']) || !empty($forum_stats[$forum['fid']]['modtools'])))
{
$gids = explode(',', $mybb->user['additionalgroups']);

Zeile 1332Zeile 1353
			{
case "pgsql":
case "sqlite":

			{
case "pgsql":
case "sqlite":

					foreach($gids as $gid)
{
$gid = (int)$gid;

					foreach($gids as $gid)
{
$gid = (int)$gid;

						$gidswhere .= " OR ','||groups||',' LIKE '%,{$gid},%'";
}
$query = $db->simple_select("modtools", 'tid, name, type', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND (groups='' OR ','||groups||',' LIKE '%,-1,%'{$gidswhere})");

						$gidswhere .= " OR ','||groups||',' LIKE '%,{$gid},%'";
}
$query = $db->simple_select("modtools", 'tid, name, type', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND (groups='' OR ','||groups||',' LIKE '%,-1,%'{$gidswhere})");

Zeile 1384Zeile 1405
		if(is_moderator($forum['fid'], "candeleteposts"))
{
eval("\$inlinemoddelete = \"".$templates->get("showthread_inlinemoderation_delete")."\";");

		if(is_moderator($forum['fid'], "candeleteposts"))
{
eval("\$inlinemoddelete = \"".$templates->get("showthread_inlinemoderation_delete")."\";");

		}

		}


if(is_moderator($forum['fid'], "canmanagethreads"))
{


if(is_moderator($forum['fid'], "canmanagethreads"))
{

Zeile 1409Zeile 1430

// Build thread moderation dropdown
if(!empty($customthreadtools))


// Build thread moderation dropdown
if(!empty($customthreadtools))

		{

		{

			eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";");

			eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";");

		}


		}


		$openclosethread = $stickunstickthread = $deletethread = $threadnotes = $managethread = $adminpolloptions = $approveunapprovethread = $softdeletethread = '';

if(is_moderator($forum['fid'], "canopenclosethreads"))
{

		$openclosethread = $stickunstickthread = $deletethread = $threadnotes = $managethread = $adminpolloptions = $approveunapprovethread = $softdeletethread = '';

if(is_moderator($forum['fid'], "canopenclosethreads"))
{

 
			if($thread['closed'])
{
$lang->open_close_thread = $lang->open_thread;
}
else
{
$lang->open_close_thread = $lang->close_thread;
}

			eval("\$openclosethread = \"".$templates->get("showthread_moderationoptions_openclose")."\";");
}

if(is_moderator($forum['fid'], "canstickunstickthreads"))
{

			eval("\$openclosethread = \"".$templates->get("showthread_moderationoptions_openclose")."\";");
}

if(is_moderator($forum['fid'], "canstickunstickthreads"))
{

 
			if($thread['sticky'])
{
$lang->stick_unstick_thread = $lang->unstick_thread;
}
else
{
$lang->stick_unstick_thread = $lang->stick_thread;
}

			eval("\$stickunstickthread = \"".$templates->get("showthread_moderationoptions_stickunstick")."\";");
}


			eval("\$stickunstickthread = \"".$templates->get("showthread_moderationoptions_stickunstick")."\";");
}


Zeile 1519Zeile 1556
	}

// Get users viewing this thread

	}

// Get users viewing this thread

 
	$usersbrowsing='';

	if($mybb->settings['browsingthisthread'] != 0)
{
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

	if($mybb->settings['browsingthisthread'] != 0)
{
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

Zeile 1551Zeile 1589
				$doneusers[$user['uid']] = $user['time'];

$invisiblemark = '';

				$doneusers[$user['uid']] = $user['time'];

$invisiblemark = '';

				if($user['invisible'] == 1 && $mybb->usergroup['canbeinvisible'] == 1)

				if($user['invisible'] == 1)

				{
$invisiblemark = "*";
++$inviscount;

				{
$invisiblemark = "*";
++$inviscount;