Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: forumdisplay.php 5480 2011-07-04 21:29:44Z huji $
| * $Id$
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 84 | Zeile 84 |
---|
if($mybb->user['uid'] == 0) { // Cookie'd forum read time
|
if($mybb->user['uid'] == 0) { // Cookie'd forum read time
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']); if(!is_array($forumsread))
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
if(is_array($forumsread) && empty($forumsread))
|
{ if($mybb->cookies['mybb']['readallforums']) {
| { if($mybb->cookies['mybb']['readallforums']) {
|
Zeile 120 | Zeile 120 |
---|
}
$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
|
}
$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
|
}
| }
|
// Get the forum moderators if the setting is enabled. if($mybb->settings['modlist'] != 0)
| // Get the forum moderators if the setting is enabled. if($mybb->settings['modlist'] != 0)
|
Zeile 154 | Zeile 154 |
---|
{ header("Location: {$foruminfo['linkto']}"); exit;
|
{ header("Location: {$foruminfo['linkto']}"); exit;
|
}
| }
|
// Make forum jump... if($mybb->settings['enableforumjump'] != 0) { $forumjump = build_forum_jump("", $fid, 1);
|
// Make forum jump... if($mybb->settings['enableforumjump'] != 0) { $forumjump = build_forum_jump("", $fid, 1);
|
}
| }
|
if($foruminfo['type'] == "f" && $foruminfo['open'] != 0)
|
if($foruminfo['type'] == "f" && $foruminfo['open'] != 0)
|
{
| {
|
eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");
|
eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");
|
}
| }
|
if($fpermissions['cansearch'] != 0 && $foruminfo['type'] == "f") { eval("\$searchforum = \"".$templates->get("forumdisplay_searchforum")."\";");
|
if($fpermissions['cansearch'] != 0 && $foruminfo['type'] == "f") { eval("\$searchforum = \"".$templates->get("forumdisplay_searchforum")."\";");
|
}
| }
// Gather forum stats $has_announcements = $has_modtools = false; $forum_stats = $cache->read("forumsdisplay");
if(is_array($forum_stats)) { if($forum_stats[-1]['modtools'] || $forum_stats[$fid]['modtools']) { // Mod tools are specific to forums, not parents $has_modtools = true; }
if($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements']) { // Global or forum-specific announcements $has_announcements = true; } }
|
$done_moderators = array( "users" => array(), "groups" => array() );
|
$done_moderators = array( "users" => array(), "groups" => array() );
|
|
|
$moderators = ''; $parentlistexploded = explode(",", $parentlist);
|
$moderators = ''; $parentlistexploded = explode(",", $parentlist);
|
|
|
foreach($parentlistexploded as $mfid) { // This forum has moderators
| foreach($parentlistexploded as $mfid) { // This forum has moderators
|
Zeile 209 | Zeile 230 |
---|
$comma = $lang->comma; } }
|
$comma = $lang->comma; } }
|
| }
if($forum_stats[$mfid]['announcements']) { $has_announcements = true;
|
} } $comma = '';
| } } $comma = '';
|
Zeile 221 | Zeile 247 |
---|
else { $moderatedby = '';
|
else { $moderatedby = '';
|
}
| }
|
// Get the users browsing this forum. if($mybb->settings['browsingthisforum'] != 0) {
| // Get the users browsing this forum. if($mybb->settings['browsingthisforum'] != 0) {
|
Zeile 313 | Zeile 339 |
---|
);
$foruminfo['rules'] = $parser->parse_message($foruminfo['rules'], $rules_parser);
|
);
$foruminfo['rules'] = $parser->parse_message($foruminfo['rules'], $rules_parser);
|
if($foruminfo['rulestype'] == 1)
| if($foruminfo['rulestype'] == 1 || $foruminfo['rulestype'] == 3)
|
{ eval("\$rules = \"".$templates->get("forumdisplay_rules")."\";"); }
| { eval("\$rules = \"".$templates->get("forumdisplay_rules")."\";"); }
|
Zeile 592 | Zeile 618 |
---|
} $multipage = multipage($threadcount, $perpage, $page, $page_url);
|
} $multipage = multipage($threadcount, $perpage, $page, $page_url);
|
if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
|
{ $lang->load("ratethread");
| { $lang->load("ratethread");
|
Zeile 628 | Zeile 654 |
---|
}
// Get Announcements
|
}
// Get Announcements
|
$forum_stats = $cache->read("forumsdisplay"); if($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements'])
| if($has_announcements == true)
|
{ $limit = ''; $announcements = '';
| { $limit = ''; $announcements = '';
|
Zeile 647 | Zeile 672 |
---|
WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1') ORDER BY a.startdate DESC $limit ");
|
WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1') ORDER BY a.startdate DESC $limit ");
|
| // See if this announcement has been read in our announcement array $cookie = array(); if(isset($mybb->cookies['mybb']['announcements'])) { $cookie = my_unserialize(stripslashes($mybb->cookies['mybb']['announcements'])); }
|
$bgcolor = alt_trow(true); // Reset the trow colors while($announcement = $db->fetch_array($query)) {
|
$bgcolor = alt_trow(true); // Reset the trow colors while($announcement = $db->fetch_array($query)) {
|
if($announcement['startdate'] > $mybb->user['lastvisit'])
| if($announcement['startdate'] > $mybb->user['lastvisit'] && !$cookie[$announcement['aid']])
|
{ $new_class = ' class="subject_new"'; $folder = "newfolder";
| { $new_class = ' class="subject_new"'; $folder = "newfolder";
|
Zeile 660 | Zeile 692 |
---|
{ $new_class = ' class="subject_old"'; $folder = "folder";
|
{ $new_class = ' class="subject_old"'; $folder = "folder";
|
}
| }
// Mmm, eat those announcement cookies if they're older than our last visit if($cookie[$announcement['aid']] < $mybb->user['lastvisit']) { unset($cookie[$announcement['aid']]); }
|
$announcement['announcementlink'] = get_announcement_link($announcement['aid']); $announcement['subject'] = $parser->parse_badwords($announcement['subject']);
| $announcement['announcementlink'] = get_announcement_link($announcement['aid']); $announcement['subject'] = $parser->parse_badwords($announcement['subject']);
|
Zeile 668 | Zeile 706 |
---|
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']); $posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']); $announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);
|
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']); $posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']); $announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);
|
if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
|
{ eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";"); $lpbackground = "trow2";
|
{ eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";"); $lpbackground = "trow2";
|
}
| }
|
else { $rating = ''; $lpbackground = "trow1";
|
else { $rating = ''; $lpbackground = "trow1";
|
}
| }
|
if($ismod) { eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
| if($ismod) { eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
Zeile 688 | Zeile 726 |
---|
{ $modann = ''; }
|
{ $modann = ''; }
|
|
|
$plugins->run_hooks("forumdisplay_announcement"); eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow();
| $plugins->run_hooks("forumdisplay_announcement"); eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow();
|
Zeile 698 | Zeile 736 |
---|
{ eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true;
|
{ eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true;
|
| }
if(empty($cookie)) { // Clean up cookie crumbs my_setcookie('mybb[announcements]', 0, (TIME_NOW - (60*60*24*365))); } else if(!empty($cookie)) { my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);
|
} }
| } }
|
Zeile 746 | Zeile 794 |
---|
} }
|
} }
|
if($foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && $tids && $ratings == true)
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && $tids && $ratings == true)
|
{ // Check if we've rated threads on this page // Guests get the pleasure of not being ID'd, but will be checked when they try and rate
| { // Check if we've rated threads on this page // Guests get the pleasure of not being ID'd, but will be checked when they try and rate
|
Zeile 839 | Zeile 887 |
---|
$load_inline_edit_js = 0; if(is_array($threadcache)) {
|
$load_inline_edit_js = 0; if(is_array($threadcache)) {
|
| if(!$mybb->settings['maxmultipagelinks']) { $mybb->settings['maxmultipagelinks'] = 5; }
if(!$mybb->settings['postsperpage']) { $mybb->settings['postperpage'] = 20; }
|
foreach($threadcache as $thread) { $plugins->run_hooks("forumdisplay_thread");
| foreach($threadcache as $thread) { $plugins->run_hooks("forumdisplay_thread");
|
Zeile 855 | Zeile 913 |
---|
} if($thread['sticky'] == 1)
|
} if($thread['sticky'] == 1)
|
{
| {
|
$thread_type_class = " forumdisplay_sticky";
|
$thread_type_class = " forumdisplay_sticky";
|
}
| }
|
else { $thread_type_class = " forumdisplay_regular"; }
$folder = '';
|
else { $thread_type_class = " forumdisplay_regular"; }
$folder = '';
|
$prefix = '';
| $prefix = '';
|
$thread['author'] = $thread['uid']; if(!$thread['username']) { $thread['username'] = $thread['threadusername']; $thread['profilelink'] = $thread['threadusername'];
|
$thread['author'] = $thread['uid']; if(!$thread['username']) { $thread['username'] = $thread['threadusername']; $thread['profilelink'] = $thread['threadusername'];
|
} else
| } else
|
{ $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); }
| { $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); }
|
Zeile 880 | Zeile 938 |
---|
// If this thread has a prefix, insert a space between prefix and subject $threadprefix = ''; if($thread['prefix'] != 0)
|
// If this thread has a prefix, insert a space between prefix and subject $threadprefix = ''; if($thread['prefix'] != 0)
|
{
| {
|
$threadprefix = build_prefixes($thread['prefix']); $thread['threadprefix'] = $threadprefix['displaystyle'].' '; }
|
$threadprefix = build_prefixes($thread['prefix']); $thread['threadprefix'] = $threadprefix['displaystyle'].' '; }
|
|
|
$thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']);
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
|
$thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']);
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
|
{
| {
|
$icon = $icon_cache[$thread['icon']]; $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
$icon = $icon_cache[$thread['icon']]; $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
}
| }
|
else { $icon = " ";
|
else { $icon = " ";
|
}
| }
|
$prefix = ''; if($thread['poll']) {
| $prefix = ''; if($thread['poll']) {
|
Zeile 905 | Zeile 963 |
---|
}
if($thread['sticky'] == "1" && !$donestickysep)
|
}
if($thread['sticky'] == "1" && !$donestickysep)
|
{
| {
|
eval("\$threads .= \"".$templates->get("forumdisplay_sticky_sep")."\";"); $shownormalsep = true; $donestickysep = true;
| eval("\$threads .= \"".$templates->get("forumdisplay_sticky_sep")."\";"); $shownormalsep = true; $donestickysep = true;
|
Zeile 917 | Zeile 975 |
---|
}
$rating = '';
|
}
$rating = '';
|
if($foruminfo['allowtratings'] != 0)
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0)
|
{ if($moved[0] == "moved") {
| { if($moved[0] == "moved") {
|
Zeile 937 | Zeile 995 |
---|
$ratingvotesav = $lang->sprintf($lang->rating_votes_average, $thread['numratings'], $thread['averagerating']); eval("\$rating = \"".$templates->get("forumdisplay_thread_rating")."\";");
|
$ratingvotesav = $lang->sprintf($lang->rating_votes_average, $thread['numratings'], $thread['averagerating']); eval("\$rating = \"".$templates->get("forumdisplay_thread_rating")."\";");
|
} }
| } }
|
$thread['pages'] = 0; $thread['multipage'] = ''; $threadpages = ''; $morelink = ''; $thread['posts'] = $thread['replies'] + 1;
|
$thread['pages'] = 0; $thread['multipage'] = ''; $threadpages = ''; $morelink = ''; $thread['posts'] = $thread['replies'] + 1;
|
if(!$mybb->settings['postsperpage']) { $mybb->settings['postperpage'] = 20; }
| |
if($thread['unapprovedposts'] > 0 && $ismod) {
| if($thread['unapprovedposts'] > 0 && $ismod) {
|
Zeile 961 | Zeile 1014 |
---|
$thread['pages'] = $thread['posts'] / $mybb->settings['postsperpage']; $thread['pages'] = ceil($thread['pages']);
|
$thread['pages'] = $thread['posts'] / $mybb->settings['postsperpage']; $thread['pages'] = ceil($thread['pages']);
|
if($thread['pages'] > 5)
| if($thread['pages'] > $mybb->settings['maxmultipagelinks'])
|
{
|
{
|
$pagesstop = 4;
| $pagesstop = $mybb->settings['maxmultipagelinks'] - 1;
|
$page_link = get_thread_link($thread['tid'], $thread['pages']); eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";"); }
| $page_link = get_thread_link($thread['tid'], $thread['pages']); eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";"); }
|
Zeile 976 | Zeile 1029 |
---|
{ $page_link = get_thread_link($thread['tid'], $i); eval("\$threadpages .= \"".$templates->get("forumdisplay_thread_multipage_page")."\";");
|
{ $page_link = get_thread_link($thread['tid'], $i); eval("\$threadpages .= \"".$templates->get("forumdisplay_thread_multipage_page")."\";");
|
}
| }
|
eval("\$thread['multipage'] = \"".$templates->get("forumdisplay_thread_multipage")."\";"); }
| eval("\$thread['multipage'] = \"".$templates->get("forumdisplay_thread_multipage")."\";"); }
|
Zeile 1008 | Zeile 1061 |
---|
}
if($moved[0] == "moved")
|
}
if($moved[0] == "moved")
|
{
| {
|
$prefix = $lang->moved_prefix; $thread['tid'] = $moved[1]; $thread['replies'] = "-";
| $prefix = $lang->moved_prefix; $thread['tid'] = $moved[1]; $thread['replies'] = "-";
|
Zeile 1041 | Zeile 1094 |
---|
else { $last_read = $read_cutoff;
|
else { $last_read = $read_cutoff;
|
} } else { $last_read = my_get_array_cookie("threadread", $thread['tid']); }
| } } else { $last_read = my_get_array_cookie("threadread", $thread['tid']); }
|
if($forum_read > $last_read)
|
if($forum_read > $last_read)
|
{
| {
|
$last_read = $forum_read; }
| $last_read = $forum_read; }
|
Zeile 1061 | Zeile 1114 |
---|
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
} else {
| } else {
|
$folder_label .= $lang->icon_no_new; $new_class = "subject_old"; }
| $folder_label .= $lang->icon_no_new; $new_class = "subject_old"; }
|
Zeile 1114 | Zeile 1167 |
---|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
}
| }
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
| $thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
|
Zeile 1148 | Zeile 1201 |
---|
else { $attachment_count = $lang->attachment_count;
|
else { $attachment_count = $lang->attachment_count;
|
}
| }
|
eval("\$attachment_count = \"".$templates->get("forumdisplay_thread_attachment_count")."\";");
|
eval("\$attachment_count = \"".$templates->get("forumdisplay_thread_attachment_count")."\";");
|
}
| }
|
else
|
else
|
{
| {
|
$attachment_count = ''; }
| $attachment_count = ''; }
|
Zeile 1163 | Zeile 1216 |
---|
$customthreadtools = ''; if($ismod) {
|
$customthreadtools = ''; if($ismod) {
|
if($forum_stats[-1]['modtools'] || $forum_stats[$fid]['modtools'])
| if(is_moderator($fid, "canusecustomtools") && $has_modtools == true)
|
{ switch($db->type)
|
{ switch($db->type)
|
{
| {
|
case "pgsql": case "sqlite": $query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'"); break; default: $query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
|
case "pgsql": case "sqlite": $query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'"); break; default: $query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
|
}
| }
|
while($tool = $db->fetch_array($query))
|
while($tool = $db->fetch_array($query))
|
{
| {
|
eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";");
|
eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";");
|
| } if($customthreadtools) { eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";");
|
} }
|
} }
|
else { eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";"); }
|
|
eval("\$inlinemod = \"".$templates->get("forumdisplay_inlinemoderation")."\";"); } }
| eval("\$inlinemod = \"".$templates->get("forumdisplay_inlinemoderation")."\";"); } }
|