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 2179 2006-09-01 04:44:17Z chris $
| * $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")
|
Zeile 91 | Zeile 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)) {
|
$moderatorcache[$moderator['fid']][] = $moderator;
| $moderatorcache[$moderator['fid']][$moderator['uid']] = $moderator;
|
}
|
}
|
}
| }
|
$bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0) { $showdepth = 3;
|
$bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0) { $showdepth = 3;
|
}
| }
|
else { $showdepth = 2;
| else { $showdepth = 2;
|
Zeile 112 | Zeile 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 121 | Zeile 120 |
---|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
| // Check if this forum is password protected and we have a valid password check_forum_password($foruminfo['fid']);
|
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 258 | 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 267 | 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')";
| $visibleonly = " AND (visible='1' OR visible='0')"; $tvisibleonly = " AND (t.visible='1' OR t.visible='0')";
|
} else {
| } else {
|
Zeile 275 | Zeile 281 |
---|
$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 319 | Zeile 325 |
---|
if($datecut != 9999) { $checkdate = time() - ($datecut * 86400);
|
if($datecut != 9999) { $checkdate = time() - ($datecut * 86400);
|
$datecutsql = "AND t.lastpost >= '$checkdate'";
| $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 331 | Zeile 339 |
---|
{ $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 351 | Zeile 362 |
---|
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"; break;
| case "subject": $sortfield = "t.subject"; break;
|
Zeile 368 | Zeile 382 |
---|
break; case "rating": $sortfield = "averagerating";
|
break; case "rating": $sortfield = "averagerating";
|
break;
| $sortfield2 = ", t.totalratings DESC"; break;
|
case "started": $sortfield = "t.dateline"; break;
| case "started": $sortfield = "t.dateline"; break;
|
Zeile 376 | Zeile 391 |
---|
$mybb->input['sortby'] = "lastpost"; $sortfield = "t.lastpost"; break;
|
$mybb->input['sortby'] = "lastpost"; $sortfield = "t.lastpost"; break;
|
}
$sortby = $mybb->input['sortby']; $sortsel[$mybb->input['sortby']] = "selected=\"selected\"";
| }
$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";
|
// Are we viewing a specific page? if(isset($mybb->input['page']) && is_numeric($mybb->input['page']))
| // Are we viewing a specific page? if(isset($mybb->input['page']) && is_numeric($mybb->input['page']))
|
Zeile 390 | Zeile 404 |
---|
{ $sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut"; }
|
{ $sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut"; }
|
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");
| 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']; } }
|
// 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 464 | Zeile 492 |
---|
{ 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 486 | Zeile 515 |
---|
} if($ismod) {
|
} if($ismod) {
|
$modann = "<td align=\"center\" class=\"$bgcolor\">-</td>";
| eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
} else {
| } else {
|
Zeile 506 | Zeile 535 |
---|
// Start Getting Threads $query = $db->query(" SELECT t.*, $ratingadd t.username AS threadusername, u.username
|
// Start Getting Threads $query = $db->query(" 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)
|
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE t.fid='$fid' $visibleonly $datecutsql ORDER BY t.sticky DESC, $sortfield $sortordernow
| WHERE t.fid='$fid' $tvisibleonly $tdatecutsql ORDER BY t.sticky DESC, $sortfield $sortordernow $sortfield2
|
LIMIT $start, $perpage
|
LIMIT $start, $perpage
|
");
| ");
|
while($thread = $db->fetch_array($query)) { $threadcache[$thread['tid']] = $thread;
| while($thread = $db->fetch_array($query)) { $threadcache[$thread['tid']] = $thread;
|
Zeile 519 | 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
|
} // Otherwise - set it to the plain thread ID else
|
{
| {
|
$tids[$thread['tid']] = $thread['tid'];
|
$tids[$thread['tid']] = $thread['tid'];
|
| if($moved_threads[$tid]) { unset($moved_threads[$tid]); }
|
}
|
}
|
}
| }
|
if($tids) { $tids = implode(",", $tids);
| if($tids) { $tids = implode(",", $tids);
|
Zeile 542 | Zeile 578 |
---|
if($moved_threads[$post['tid']]) { $post['tid'] = $moved_threads[$post['tid']];
|
if($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 554 | 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 623 | 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 650 | 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 658 | 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 677 | 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 693 | Zeile 739 |
---|
else { $modbit = '';
|
else { $modbit = '';
|
}
$moved = explode("|", $thread['closed']);
| }
$moved = explode("|", $thread['closed']);
|
if($moved[0] == "moved") {
| if($moved[0] == "moved") {
|
Zeile 703 | 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 722 | 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 752 | 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 764 | 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 797 | 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)
|
Zeile 887 | Zeile 929 |
---|
{ 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")."\";"); }
|