Vergleich forumdisplay.php - 1.2.0 - 1.2.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

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

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

 *

 *

 * $Id: forumdisplay.php 2179 2006-09-01 04:44:17Z chris $

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

 */

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";

$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";

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 80Zeile 80
	$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

}

	$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

}

$forumpermissions = forum_permissions();

 

// Get the forum moderators if the setting is enabled.
if($mybb->settings['modlist'] != "off")


// Get the forum moderators if the setting is enabled.
if($mybb->settings['modlist'] != "off")

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

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

		$moderatorcache[$moderator['fid']][] = $moderator;

		$moderatorcache[$moderator['fid']][$moderator['uid']] = $moderator;

	}
}


	}
}


Zeile 121Zeile 120
{
error_no_permission();
}

{
error_no_permission();
}

 

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


if($foruminfo['linkto'])
{
header("Location: $foruminfo[linkto]");
exit;
}

if($foruminfo['linkto'])
{
header("Location: $foruminfo[linkto]");
exit;
}

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

 

// Make forum jump...


// Make forum jump...

$forumjump = build_forum_jump("", $fid, 1);




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


if($foruminfo['type'] == "f" && $foruminfo['open'] != "no")
{


if($foruminfo['type'] == "f" && $foruminfo['open'] != "no")
{

Zeile 275Zeile 279
	$ismod = false;
}


	$ismod = false;
}


if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == "yes")

if(is_moderator($fid, "caneditposts") == "yes" || $fpermissions['caneditposts'] == "yes")

{
$can_edit_titles = 1;
}

{
$can_edit_titles = 1;
}

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

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

	$datecutsql = "AND t.lastpost >= '$checkdate'";

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

}
else
{

}
else
{

Zeile 331Zeile 335
{
$mybb->input['order'] = $foruminfo['defaultsortorder'];
}

{
$mybb->input['order'] = $foruminfo['defaultsortorder'];
}

 

$mybb->input['order'] = htmlspecialchars($mybb->input['order']);


switch(strtolower($mybb->input['order']))
{
case "asc":

switch(strtolower($mybb->input['order']))
{
case "asc":

Zeile 351Zeile 358
if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
{
$mybb->input['sortby'] = $foruminfo['defaultsortby'];

if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
{
$mybb->input['sortby'] = $foruminfo['defaultsortby'];

}
switch($mybb->input['sortby'])
{




}

$sortby = htmlspecialchars($mybb->input['sortby']);

switch($sortby)
{

	case "subject":
$sortfield = "t.subject";

	case "subject":
$sortfield = "t.subject";

		break;

		break;

	case "replies":
$sortfield = "t.replies";

	case "replies":
$sortfield = "t.replies";

		break;

		break;

	case "views":
$sortfield = "t.views";
break;
case "starter":
$sortfield = "t.username";

	case "views":
$sortfield = "t.views";
break;
case "starter":
$sortfield = "t.username";

		break;

		break;

	case "rating":
$sortfield = "averagerating";

	case "rating":
$sortfield = "averagerating";

		break;


		$sortfield2 = ", t.totalratings DESC";
break;

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

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

		break;

		break;

	default:
$mybb->input['sortby'] = "lastpost";
$sortfield = "t.lastpost";
break;

	default:
$mybb->input['sortby'] = "lastpost";
$sortfield = "t.lastpost";
break;

}

}





$sortby = $mybb->input['sortby'];

 
$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 399Zeile 409
$perpage = $mybb->settings['threadsperpage'];

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

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

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

{

{

	$page = $mybb->input['page'];
$start = ($page-1) *$perpage;
$pages = $threadcount / $perpage;

	$page = $mybb->input['page'];
$start = ($page-1) *$perpage;
$pages = $threadcount / $perpage;

Zeile 409Zeile 419
		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

}
else

}
else

{
$start = 0;
$page = 1;

{
$start = 0;
$page = 1;

Zeile 421Zeile 431
if($upper > $threadcount)
{
$upper = $threadcount;

if($upper > $threadcount)
{
$upper = $threadcount;

}

}

$multipage = multipage($threadcount, $perpage, $page, "forumdisplay.php?fid=$fid&sortby=$sortby&order=$sortordernow&datecut=$datecut");

if($foruminfo['allowtratings'] != "no")

$multipage = multipage($threadcount, $perpage, $page, "forumdisplay.php?fid=$fid&sortby=$sortby&order=$sortordernow&datecut=$datecut");

if($foruminfo['allowtratings'] != "no")

Zeile 442Zeile 452
if($ismod)
{
++$colspan;

if($ismod)
{
++$colspan;

}


}


// Get Announcements
$limit = '';
$announcements = '';

// Get Announcements
$limit = '';
$announcements = '';

Zeile 463Zeile 473
while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'])

while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'])

	{
$folder = "newfolder.gif";
}
else
{
$folder = "folder.gif";

	{
$folder = "newfolder";
}
else
{
$folder = "folder";

	}
$announcement['subject'] = $parser->parse_badwords($announcement['subject']);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']);

	}
$announcement['subject'] = $parser->parse_badwords($announcement['subject']);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']);

 
	$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);

	if($foruminfo['allowtratings'] != "no")
{
$thread['rating'] = "pixel.gif";

	if($foruminfo['allowtratings'] != "no")
{
$thread['rating'] = "pixel.gif";

Zeile 486Zeile 497
	}
if($ismod)
{

	}
if($ismod)
{

		$modann = "<td align=\"center\" class=\"$bgcolor\">-</td>";

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

	}
else
{

	}
else
{

Zeile 505Zeile 516

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


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

	SELECT t.*, $ratingadd t.username AS threadusername, u.username
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
LIMIT $start, $perpage
");

    SELECT t.*, $ratingadd t.username AS threadusername, u.username
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
");

while($thread = $db->fetch_array($query))
{
$threadcache[$thread['tid']] = $thread;

while($thread = $db->fetch_array($query))
{
$threadcache[$thread['tid']] = $thread;

Zeile 623Zeile 634
		}
elseif($thread['sticky'] == 0 && $shownormalsep)
{

		}
elseif($thread['sticky'] == 0 && $shownormalsep)
{

			eval("\$threads  .= \"".$templates->get("forumdisplay_threads_sep")."\";");

			eval("\$threads .= \"".$templates->get("forumdisplay_threads_sep")."\";");

			$shownormalsep = false;
}


			$shownormalsep = false;
}


Zeile 650Zeile 661
		$threadpages = '';
$morelink = '';
$thread['posts'] = $thread['replies'] + 1;

		$threadpages = '';
$morelink = '';
$thread['posts'] = $thread['replies'] + 1;

 
		if($thread['unapprovedposts'] > 0 && $ismod)
{
$thread['posts'] += $thread['unapprovedposts'];
}

		if($thread['posts'] > $mybb->settings['postsperpage'])
{
$thread['pages'] = $thread['posts'] / $mybb->settings['postsperpage'];

		if($thread['posts'] > $mybb->settings['postsperpage'])
{
$thread['pages'] = $thread['posts'] / $mybb->settings['postsperpage'];

Zeile 808Zeile 823
		$thread['views'] = my_number_format($thread['views']);

// Threads and posts requiring moderation

		$thread['views'] = my_number_format($thread['views']);

// Threads and posts requiring moderation

		if($thread['visible'] == 0)
{
--$thread['unapprovedposts'];
}

 
		if($thread['unapprovedposts'] > 0 && $ismod)
{
if($thread['unapprovedposts'] > 1)

		if($thread['unapprovedposts'] > 0 && $ismod)
{
if($thread['unapprovedposts'] > 1)

Zeile 887Zeile 898
	{
eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");
}

	{
eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");
}

	$lang->rss_discovery_forum = sprintf($lang->rss_discovery_forum, $foruminfo['name']);

	$lang->rss_discovery_forum = sprintf($lang->rss_discovery_forum, htmlspecialchars_uni($foruminfo['name']));

	eval("\$rssdiscovery = \"".$templates->get("forumdisplay_rssdiscovery")."\";");
eval("\$threadslist = \"".$templates->get("forumdisplay_threadlist")."\";");
}

	eval("\$rssdiscovery = \"".$templates->get("forumdisplay_rssdiscovery")."\";");
eval("\$threadslist = \"".$templates->get("forumdisplay_threadlist")."\";");
}