Zeile 3 | Zeile 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 2708 2007-02-04 16:14:25Z Tikitiki $
| * $Id: forumdisplay.php 3533 2007-12-02 01:33:38Z chris $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 16 | Zeile 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,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 78 | Zeile 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;
|
| |
}
|
}
|
$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")
|
{
| {
|
$query = $db->query(" SELECT m.uid, m.fid, u.username, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."moderators m LEFT JOIN ".TABLE_PREFIX."users u ON (m.uid=u.uid) ORDER BY u.username ");
|
$query = $db->query(" SELECT m.uid, m.fid, u.username, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."moderators m 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)) {
|
$moderatorcache[$moderator['fid']][] = $moderator;
| $moderatorcache[$moderator['fid']][$moderator['uid']] = $moderator;
|
}
|
}
|
}
| }
|
$bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0) {
| $bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0) {
|
Zeile 110 | Zeile 109 |
---|
$child_forums = build_forumbits($fid, 2); $forums = $child_forums['forum_list']; if($forums)
|
$child_forums = build_forumbits($fid, 2); $forums = $child_forums['forum_list']; if($forums)
|
{
| {
|
$lang->sub_forums_in = sprintf($lang->sub_forums_in, $foruminfo['name']);
|
$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 122 | Zeile 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 132 | Zeile 131 |
---|
}
// 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 260 | Zeile 262 |
---|
$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 269 | Zeile 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')"; } else
| $visibleonly = " AND (visible='1' OR visible='0')"; $tvisibleonly = " AND (t.visible='1' OR t.visible='0')"; } else
|
{ $inlinemod = ''; $ismod = false;
| { $inlinemod = ''; $ismod = false;
|
Zeile 280 | Zeile 284 |
---|
if(is_moderator($fid, "caneditposts") == "yes" || $fpermissions['caneditposts'] == "yes") { $can_edit_titles = 1;
|
if(is_moderator($fid, "caneditposts") == "yes" || $fpermissions['caneditposts'] == "yes") { $can_edit_titles = 1;
|
}
| }
|
else { $can_edit_titles = 0;
| else { $can_edit_titles = 0;
|
Zeile 321 | Zeile 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
|
} else
|
{
| {
|
$datecutsql = '';
|
$datecutsql = '';
|
}
| $tdatecutsql = ''; }
|
// Pick the sort order. if(!isset($mybb->input['order']) && !empty($foruminfo['defaultsortorder'])) { $mybb->input['order'] = $foruminfo['defaultsortorder']; }
|
// Pick the sort order. if(!isset($mybb->input['order']) && !empty($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 354 | Zeile 363 |
---|
{ $mybb->input['sortby'] = $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";
|
Zeile 381 | Zeile 393 |
---|
break; }
|
break; }
|
$sortby = $mybb->input['sortby'];
| |
$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";
// Are we viewing a specific page? if(isset($mybb->input['page']) && is_numeric($mybb->input['page'])) { $sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut&page=".$mybb->input['page'];
|
$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";
// Are we viewing a specific page? if(isset($mybb->input['page']) && is_numeric($mybb->input['page'])) { $sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut&page=".$mybb->input['page'];
|
}
| } else { $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 {
|
else {
|
$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut";
| $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 412 | Zeile 437 |
---|
$start = 0; $page = 1; }
|
$start = 0; $page = 1; }
|
}
| }
|
else { $start = 0;
| else { $start = 0;
|
Zeile 434 | Zeile 459 |
---|
eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";"); eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";"); $colspan = "8";
|
eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";"); eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";"); $colspan = "8";
|
}
| }
|
else
|
else
|
{
| {
|
$ratingadd = ''; $lpbackground = "trow1"; $colspan = "7";
| $ratingadd = ''; $lpbackground = "trow1"; $colspan = "7";
|
Zeile 445 | Zeile 470 |
---|
if($ismod) { ++$colspan;
|
if($ismod) { ++$colspan;
|
}
| }
|
// Get Announcements $limit = '';
| // Get Announcements $limit = '';
|
Zeile 464 | Zeile 489 |
---|
ORDER BY a.startdate DESC $limit "); while($announcement = $db->fetch_array($query))
|
ORDER BY a.startdate DESC $limit "); while($announcement = $db->fetch_array($query))
|
{
| {
|
if($announcement['startdate'] > $mybb->user['lastvisit']) {
|
if($announcement['startdate'] > $mybb->user['lastvisit']) {
|
$folder = "newfolder.gif";
| $folder = "newfolder";
|
} else {
|
} else {
|
$folder = "folder.gif";
| $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 489 | Zeile 515 |
---|
} if($ismod) {
|
} if($ismod) {
|
$modann = "<td align=\"center\" class=\"$bgcolor\">-</td>";
| eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
} else { $modann = '';
|
} else { $modann = '';
|
}
| }
|
eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow();
|
eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow();
|
}
| }
|
if($announcements) { eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true; }
|
if($announcements) { eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true; }
|
|
|
$icon_cache = $cache->read("posticons");
// Start Getting Threads $query = $db->query("
|
$icon_cache = $cache->read("posticons");
// 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 522 | Zeile 548 |
---|
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)
| } } if($tids)
|
Zeile 546 | Zeile 579 |
---|
{ $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 557 | Zeile 593 |
---|
while($readthread = $db->fetch_array($query)) { if($moved_threads[$readthread['tid']])
|
while($readthread = $db->fetch_array($query)) { if($moved_threads[$readthread['tid']])
|
{
| {
|
$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']; }
|
} }
| } }
|
Zeile 626 | Zeile 665 |
---|
} 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 653 | Zeile 692 |
---|
$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 661 | Zeile 704 |
---|
{ $pagesstop = 4; eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";");
|
{ $pagesstop = 4; eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";");
|
} else
| } else
|
{ $pagesstop = $thread['pages'];
|
{ $pagesstop = $thread['pages'];
|
}
| }
|
for($i = 1; $i <= $pagesstop; ++$i) { eval("\$threadpages .= \"".$templates->get("forumdisplay_thread_multipage_page")."\";"); } eval("\$thread[multipage] = \"".$templates->get("forumdisplay_thread_multipage")."\";");
|
for($i = 1; $i <= $pagesstop; ++$i) { eval("\$threadpages .= \"".$templates->get("forumdisplay_thread_multipage_page")."\";"); } eval("\$thread[multipage] = \"".$templates->get("forumdisplay_thread_multipage")."\";");
|
}
| }
|
else { $threadpages = '';
| else { $threadpages = '';
|
Zeile 680 | Zeile 723 |
---|
}
if($ismod)
|
}
if($ismod)
|
{
| {
|
if(strstr($_COOKIE[$inlinecookie], "|$thread[tid]|")) { $inlinecheck = "checked=\"checked\"";
| if(strstr($_COOKIE[$inlinecookie], "|$thread[tid]|")) { $inlinecheck = "checked=\"checked\"";
|
Zeile 696 | Zeile 739 |
---|
else { $modbit = '';
|
else { $modbit = '';
|
}
$moved = explode("|", $thread['closed']);
| }
$moved = explode("|", $thread['closed']);
|
if($moved[0] == "moved") {
| if($moved[0] == "moved") {
|
Zeile 706 | Zeile 749 |
---|
$thread['tid'] = $moved[1]; $thread['replies'] = "-"; $thread['views'] = "-";
|
$thread['tid'] = $moved[1]; $thread['replies'] = "-"; $thread['views'] = "-";
|
}
| }
|
// Determine the folder $folder = ''; $folder_label = '';
| // Determine the folder $folder = ''; $folder_label = '';
|
Zeile 725 | Zeile 768 |
---|
{ $cutoff = time()-$mybb->settings['threadreadcut']*60*60*24; if($thread['lastpost'] > $cutoff)
|
{ $cutoff = time()-$mybb->settings['threadreadcut']*60*60*24; if($thread['lastpost'] > $cutoff)
|
{
| {
|
if($thread['lastread'])
|
if($thread['lastread'])
|
{
| {
|
$lastread = $thread['lastread'];
|
$lastread = $thread['lastread'];
|
}
| }
|
else { $lastread = 1; }
|
else { $lastread = 1; }
|
} }
| } }
|
if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
| if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
|
Zeile 755 | Zeile 798 |
---|
$folder_label .= $lang->icon_new; eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
$folder_label .= $lang->icon_new; eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
} else { $folder_label .= $lang->icon_no_new;
| } else { $folder_label .= $lang->icon_no_new;
|
}
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
| }
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
|
Zeile 767 | Zeile 810 |
---|
$folder_label .= $lang->icon_hot; } if($thread['closed'] == "yes")
|
$folder_label .= $lang->icon_hot; } if($thread['closed'] == "yes")
|
{
| {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock; }
| $folder .= "lock"; $folder_label .= $lang->icon_lock; }
|
Zeile 800 | Zeile 843 |
---|
// Don't link to guest's profiles (they have no profile). if($lastposteruid == 0)
|
// Don't link to guest's profiles (they have no profile). if($lastposteruid == 0)
|
{
| {
|
$lastposterlink = $lastposter;
|
$lastposterlink = $lastposter;
|
}
| }
|
else
|
else
|
{
| {
|
$lastposterlink = build_profile_link($lastposter, $lastposteruid); } $thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
// Threads and posts requiring moderation
|
$lastposterlink = build_profile_link($lastposter, $lastposteruid); } $thread['replies'] = my_number_format($thread['replies']); $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)
|