Vergleich forumdisplay.php - 1.2.9 - 1.2.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * $Id: forumdisplay.php 3171 2007-06-29 04:57:39Z chris $

 * $Id: forumdisplay.php 3595 2008-01-09 00:10:57Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 16Zeile 16
$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit";
$templatelist .= ",forumdisplay_usersbrowsing_guests,forumdisplay_usersbrowsing_user,forumdisplay_usersbrowsing,forumdisplay_inlinemoderation,forumdisplay_thread_modbit,forumdisplay_inlinemoderation_col";

$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit";
$templatelist .= ",forumdisplay_usersbrowsing_guests,forumdisplay_usersbrowsing_user,forumdisplay_usersbrowsing,forumdisplay_inlinemoderation,forumdisplay_thread_modbit,forumdisplay_inlinemoderation_col";

$templatelist .= ",forumdisplay_announcements_announcement,forumdisplay_announcements,forumdisplay_threads_sep,forumbit_depth3_statusicon,forumbit_depth3,forumdisplay_sticky_sep,forumdisplay_thread_attachment_count,forumdisplay_threadlist_inlineedit_js,forumdisplay_rssdiscovery,forumdisplay_announcements_announcement_modbit";

$templatelist .= ",forumdisplay_announcements_announcement,forumdisplay_announcements,forumdisplay_threads_sep,forumbit_depth3_statusicon,forumbit_depth3,forumdisplay_sticky_sep,forumdisplay_thread_attachment_count,forumdisplay_threadlist_inlineedit_js,forumdisplay_rssdiscovery,forumdisplay_announcements_announcement_modbit,forumdisplay_rules_link,forumdisplay_thread_gotounread";

require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_forumlist.php";

require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_forumlist.php";

Zeile 78Zeile 78
while($forum = $db->fetch_array($query))
{
$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

while($forum = $db->fetch_array($query))
{
$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;



 
}

// Get the forum moderators if the setting is enabled.

}

// Get the forum moderators if the setting is enabled.

Zeile 90Zeile 89
		LEFT JOIN ".TABLE_PREFIX."users u ON (m.uid=u.uid)
ORDER BY u.username
");

		LEFT JOIN ".TABLE_PREFIX."users u ON (m.uid=u.uid)
ORDER BY u.username
");

 
	

	// Build a moderator cache.
while($moderator = $db->fetch_array($query))
{

	// Build a moderator cache.
while($moderator = $db->fetch_array($query))
{

Zeile 111Zeile 111
if($forums)
{
$lang->sub_forums_in = sprintf($lang->sub_forums_in, $foruminfo['name']);

if($forums)
{
$lang->sub_forums_in = sprintf($lang->sub_forums_in, $foruminfo['name']);

	eval("\$subforums =\"".$templates->get("forumdisplay_subforums")."\";");

	eval("\$subforums = \"".$templates->get("forumdisplay_subforums")."\";");

}

$excols = "forumdisplay";

}

$excols = "forumdisplay";

Zeile 121Zeile 121
	error_no_permission();
}


	error_no_permission();
}


// Password protected forums
check_forum_password($fid, $foruminfo['password']);

// Check if this forum is password protected and we have a valid password
check_forum_password($foruminfo['fid']);


if($foruminfo['linkto'])
{


if($foruminfo['linkto'])
{

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

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

				}

				}

				else
{
$invisiblemark = '';

				else
{
$invisiblemark = '';

Zeile 220Zeile 220
	if($guestcount && $onlinemembers)
{
$onlinesep = ", ";

	if($guestcount && $onlinemembers)
{
$onlinesep = ", ";

	}

	}

	$invisonline = '';
if($inviscount && $mybb->usergroup['canviewwolinvis'] != "yes" && ($inviscount != 1 && $mybb->user['invisible'] != "yes"))

	$invisonline = '';
if($inviscount && $mybb->usergroup['canviewwolinvis'] != "yes" && ($inviscount != 1 && $mybb->user['invisible'] != "yes"))

	{

	{

		$invisonline = sprintf($lang->users_browsing_forum_invis, $inviscount);
}
if($invisonline != '' && $guestcount)

		$invisonline = sprintf($lang->users_browsing_forum_invis, $inviscount);
}
if($invisonline != '' && $guestcount)

	{

	{

		$onlinesep2 = ", ";
}
eval("\$usersbrowsing = \"".$templates->get("forumdisplay_usersbrowsing")."\";");

		$onlinesep2 = ", ";
}
eval("\$usersbrowsing = \"".$templates->get("forumdisplay_usersbrowsing")."\";");

Zeile 256Zeile 256
	elseif($foruminfo['rulestype'] == 2)
{
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");

	elseif($foruminfo['rulestype'] == 2)
{
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");

	}
}


	}
}


$bgcolor = "trow1";

// Set here to fetch only approved topics (and then below for a moderator we change this).

$bgcolor = "trow1";

// Set here to fetch only approved topics (and then below for a moderator we change this).

$visibleonly = "AND t.visible='1'";


$visibleonly = "AND visible='1'";
$tvisibleonly = "AND t.visible='1'";


// Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid) == "yes")


// Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid) == "yes")

Zeile 271Zeile 272
	$ismod = true;
$inlinecount = "0";
$inlinecookie = "inlinemod_forum".$fid;

	$ismod = true;
$inlinecount = "0";
$inlinecookie = "inlinemod_forum".$fid;

	$visibleonly = " AND (t.visible='1' OR t.visible='0')";


	$visibleonly = " AND (visible='1' OR visible='0')";
$tvisibleonly = " AND (t.visible='1' OR t.visible='0')";

}
else
{

}
else
{

Zeile 323Zeile 325
if($datecut != 9999)
{
$checkdate = time() - ($datecut * 86400);

if($datecut != 9999)
{
$checkdate = time() - ($datecut * 86400);

	$datecutsql = "AND (t.lastpost >= '$checkdate' OR t.sticky = '1')";


	$datecutsql = "AND (lastpost >= '$checkdate' OR sticky = '1')";
$tdatecutsql = "AND (t.lastpost >= '$checkdate' OR t.sticky = '1')";

}
else
{
$datecutsql = '';

}
else
{
$datecutsql = '';

 
	$tdatecutsql = '';

}

// Pick the sort order.

}

// Pick the sort order.

Zeile 379Zeile 383
	case "rating":
$sortfield = "averagerating";
$sortfield2 = ", t.totalratings DESC";

	case "rating":
$sortfield = "averagerating";
$sortfield2 = ", t.totalratings DESC";

		break;

		break;

	case "started":
$sortfield = "t.dateline";

	case "started":
$sortfield = "t.dateline";

		break;

		break;

	default:
$mybb->input['sortby'] = "lastpost";

	default:
$mybb->input['sortby'] = "lastpost";

 
		$sortby = "lastpost";

		$sortfield = "t.lastpost";
break;

		$sortfield = "t.lastpost";
break;

}


}


$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";

// Are we viewing a specific page?

$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";

// Are we viewing a specific page?

Zeile 398Zeile 403
}
else
{

}
else
{

	$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut";



















	$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut";
}
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");

// How many posts are there?
if($datecut != 9999)
{
$query = $db->simple_select(TABLE_PREFIX."threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $datecutsql");
$threadcount = $db->fetch_field($query, "threads");
}
else
{
$query = $db->simple_select(TABLE_PREFIX."forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];
if($ismod == true)
{
$threadcount += $forum_threads['unapprovedthreads'];
}

}

}

eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");

 

// How many pages are there?


// How many pages are there?

$query = $db->simple_select(TABLE_PREFIX."threads t", "COUNT(t.tid) AS threads", "t.fid = '$fid' $visibleonly $datecutsql");
$threadcount = $db->fetch_field($query, "threads");


 
$perpage = $mybb->settings['threadsperpage'];

if(intval($mybb->input['page']) > 0)

$perpage = $mybb->settings['threadsperpage'];

if(intval($mybb->input['page']) > 0)

Zeile 498Zeile 517
	if($ismod)
{
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");

	if($ismod)
{
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");

	}
else

	}
else

	{
$modann = '';
}

	{
$modann = '';
}

Zeile 507Zeile 526
	$bgcolor = alt_trow();
}
if($announcements)

	$bgcolor = alt_trow();
}
if($announcements)

{

{

	eval("\$announcementlist  = \"".$templates->get("forumdisplay_announcements")."\";");
$shownormalsep = true;
}

	eval("\$announcementlist  = \"".$templates->get("forumdisplay_announcements")."\";");
$shownormalsep = true;
}

Zeile 516Zeile 535

// Start Getting Threads
$query = $db->query("


// Start Getting Threads
$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)
WHERE t.fid='$fid' $visibleonly $datecutsql
ORDER BY t.sticky DESC, $sortfield $sortordernow $sortfield2
LIMIT $start, $perpage

	LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE t.fid='$fid' $tvisibleonly $tdatecutsql
ORDER BY t.sticky DESC, $sortfield $sortordernow $sortfield2
LIMIT $start, $perpage

"); 
while($thread = $db->fetch_array($query))
{

"); 
while($thread = $db->fetch_array($query))
{

Zeile 530Zeile 549
	if(substr($thread['closed'], 0, 5) == "moved")
{
$tid = substr($thread['closed'], 6);

	if(substr($thread['closed'], 0, 5) == "moved")
{
$tid = substr($thread['closed'], 6);

		$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;




		if(!$tids[$tid])
{
$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;
}

	}
// Otherwise - set it to the plain thread ID
else
{
$tids[$thread['tid']] = $thread['tid'];

	}
// Otherwise - set it to the plain thread ID
else
{
$tids[$thread['tid']] = $thread['tid'];

 
		if($moved_threads[$tid])
{
unset($moved_threads[$tid]);
}

	}
}
if($tids)
{
$tids = implode(",", $tids);

	}
}
if($tids)
{
$tids = implode(",", $tids);

}


}


// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != "no" && $mybb->user['uid'] && $threadcache)
{

// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != "no" && $mybb->user['uid'] && $threadcache)
{

Zeile 551Zeile 577
	while($post = $db->fetch_array($query))
{
if($moved_threads[$post['tid']])

	while($post = $db->fetch_array($query))
{
if($moved_threads[$post['tid']])

		{

		{

			$post['tid'] = $moved_threads[$post['tid']];
}

			$post['tid'] = $moved_threads[$post['tid']];
}

		$threadcache[$post['tid']]['doticon'] = 1;




		if($threadcache[$post['tid']])
{
$threadcache[$post['tid']]['doticon'] = 1;
}

	}
}


	}
}


Zeile 568Zeile 597
		{
$readthread['tid'] = $moved_threads[$readthread['tid']];
}

		{
$readthread['tid'] = $moved_threads[$readthread['tid']];
}

		$threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];




		if($threadcache[$readthread['tid']])
{
$threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
}

	}
}


	}
}