Zeile 6 | Zeile 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 3055 2007-05-13 15:01:15Z Tikitiki $
| * $Id: forumdisplay.php 3595 2008-01-09 00:10:57Z Tikitiki $
|
*/
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)) { $moderatorcache[$moderator['fid']][$moderator['uid']] = $moderator; }
|
// Build a moderator cache. while($moderator = $db->fetch_array($query)) { $moderatorcache[$moderator['fid']][$moderator['uid']] = $moderator; }
|
}
| }
|
$bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0) {
| $bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0) {
|
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 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')";
| $visibleonly = " AND (visible='1' OR visible='0')"; $tvisibleonly = " AND (t.visible='1' OR t.visible='0')";
|
} else {
| } else {
|
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 { $datecutsql = '';
|
} else { $datecutsql = '';
|
| $tdatecutsql = '';
|
}
// Pick the sort order.
| }
// Pick the sort order.
|
Zeile 356 | 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'];
|
}
| }
|
$sortby = htmlspecialchars($mybb->input['sortby']);
| $sortby = htmlspecialchars($mybb->input['sortby']);
|
Zeile 383 | Zeile 389 |
---|
break; default: $mybb->input['sortby'] = "lastpost";
|
break; default: $mybb->input['sortby'] = "lastpost";
|
| $sortby = "lastpost";
|
$sortfield = "t.lastpost"; break; }
| $sortfield = "t.lastpost"; break; }
|
Zeile 399 | Zeile 406 |
---|
$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut"; } eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");
|
$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut"; } eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");
|
// 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");
| // 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?
|
$perpage = $mybb->settings['threadsperpage'];
if(intval($mybb->input['page']) > 0)
| $perpage = $mybb->settings['threadsperpage'];
if(intval($mybb->input['page']) > 0)
|
Zeile 448 | Zeile 469 |
---|
}
if($ismod)
|
}
if($ismod)
|
{
| {
|
++$colspan; }
| ++$colspan; }
|
Zeile 458 | Zeile 479 |
---|
if($mybb->settings['announcementlimit']) { $limit = "LIMIT 0, ".$mybb->settings['announcementlimit'];
|
if($mybb->settings['announcementlimit']) { $limit = "LIMIT 0, ".$mybb->settings['announcementlimit'];
|
}
| }
|
$sql = build_parent_list($fid, "fid", "OR", $parentlist); $time = time(); $query = $db->query("
| $sql = build_parent_list($fid, "fid", "OR", $parentlist); $time = time(); $query = $db->query("
|
Zeile 472 | Zeile 493 |
---|
{ 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"; eval("\$rating = \"".$templates->get("forumdisplay_thread_rating")."\";"); $lpbackground = "trow2";
|
if($foruminfo['allowtratings'] != "no") { $thread['rating'] = "pixel.gif"; eval("\$rating = \"".$templates->get("forumdisplay_thread_rating")."\";"); $lpbackground = "trow2";
|
} else {
| } else {
|
$rating = ''; $lpbackground = "trow1"; } if($ismod) {
|
$rating = ''; $lpbackground = "trow1"; } if($ismod) {
|
$modann = "<td align=\"center\" class=\"$bgcolor\">-</td>";
| eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
} else {
| } else {
|
Zeile 508 | Zeile 530 |
---|
eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true; }
|
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 527 | Zeile 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)
| } } if($tids)
|
Zeile 551 | Zeile 580 |
---|
{ $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 562 | Zeile 594 |
---|
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 820 | Zeile 855 |
---|
$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)
|