Zeile 11 | Zeile 11 |
---|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'forumdisplay.php');
|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'forumdisplay.php');
|
$templatelist = "forumdisplay,forumdisplay_thread,forumbit_depth1_cat,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby,forumdisplay_searchforum,forumdisplay_thread_rating,forumdisplay_threadlist_rating";
| $templatelist = "forumdisplay,forumdisplay_thread,forumbit_depth1_cat,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby,forumdisplay_searchforum,forumdisplay_forumsort,forumdisplay_thread_rating,forumdisplay_threadlist_rating";
|
$templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more,forumdisplay_thread_gotounread,forumbit_depth2_forum_lastpost,forumdisplay_rules_link,forumdisplay_orderarrow,forumdisplay_newthread"; $templatelist .= ",multipage,multipage_breadcrumb,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,forumdisplay_thread_unapproved_posts,forumdisplay_nothreads"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,forumdisplay_password_wrongpass,forumdisplay_password,forumdisplay_inlinemoderation_custom_tool,forumbit_subforums,forumbit_moderators,forumbit_depth2_forum_lastpost_never,forumbit_depth2_forum_lastpost_hidden";
| $templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more,forumdisplay_thread_gotounread,forumbit_depth2_forum_lastpost,forumdisplay_rules_link,forumdisplay_orderarrow,forumdisplay_newthread"; $templatelist .= ",multipage,multipage_breadcrumb,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,forumdisplay_thread_unapproved_posts,forumdisplay_nothreads"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,forumdisplay_password_wrongpass,forumdisplay_password,forumdisplay_inlinemoderation_custom_tool,forumbit_subforums,forumbit_moderators,forumbit_depth2_forum_lastpost_never,forumbit_depth2_forum_lastpost_hidden";
|
Zeile 95 | Zeile 95 |
---|
$forumsread = array(); if(isset($mybb->cookies['mybb']['forumread'])) {
|
$forumsread = array(); if(isset($mybb->cookies['mybb']['forumread'])) {
|
$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread'], false);
|
}
if(is_array($forumsread) && empty($forumsread))
| }
if(is_array($forumsread) && empty($forumsread))
|
Zeile 152 | Zeile 152 |
---|
$subforums = ''; $child_forums = build_forumbits($fid, 2);
|
$subforums = ''; $child_forums = build_forumbits($fid, 2);
|
$forums = $child_forums['forum_list'];
| |
|
|
if($forums)
| if(!empty($child_forums) && !empty($child_forums['forum_list']))
|
{
|
{
|
| $forums = $child_forums['forum_list'];
|
$lang->sub_forums_in = $lang->sprintf($lang->sub_forums_in, $foruminfo['name']); eval("\$subforums = \"".$templates->get("forumdisplay_subforums")."\";"); }
| $lang->sub_forums_in = $lang->sprintf($lang->sub_forums_in, $foruminfo['name']); eval("\$subforums = \"".$templates->get("forumdisplay_subforums")."\";"); }
|
Zeile 172 | Zeile 172 |
---|
}
// Make forum jump...
|
}
// Make forum jump...
|
| $forumjump = '';
|
if($mybb->settings['enableforumjump'] != 0) { $forumjump = build_forum_jump("", $fid, 1); }
|
if($mybb->settings['enableforumjump'] != 0) { $forumjump = build_forum_jump("", $fid, 1); }
|
| $newthread = '';
|
if($foruminfo['type'] == "f" && $foruminfo['open'] != 0 && $fpermissions['canpostthreads'] != 0 && $mybb->user['suspendposting'] == 0) { eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";"); }
|
if($foruminfo['type'] == "f" && $foruminfo['open'] != 0 && $fpermissions['canpostthreads'] != 0 && $mybb->user['suspendposting'] == 0) { eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";"); }
|
| $searchforum = '';
|
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")."\";");
|
Zeile 213 | Zeile 216 |
---|
$moderators = ''; $parentlistexploded = explode(",", $parentlist);
|
$moderators = ''; $parentlistexploded = explode(",", $parentlist);
|
| $comma = '';
|
foreach($parentlistexploded as $mfid) { // This forum has moderators
|
foreach($parentlistexploded as $mfid) { // This forum has moderators
|
if(is_array($moderatorcache[$mfid]))
| if(isset($moderatorcache[$mfid]) && is_array($moderatorcache[$mfid]))
|
{ // Fetch each moderator from the cache and format it, appending it to the list foreach($moderatorcache[$mfid] as $modtype)
| { // Fetch each moderator from the cache and format it, appending it to the list foreach($moderatorcache[$mfid] as $modtype)
|
Zeile 272 | Zeile 276 |
---|
}
// Get the users browsing this forum.
|
}
// Get the users browsing this forum.
|
| $usersbrowsing = '';
|
if($mybb->settings['browsingthisforum'] != 0) { $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
| if($mybb->settings['browsingthisforum'] != 0) { $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
|
Zeile 302 | Zeile 307 |
---|
{ $doneusers[$user['uid']] = $user['time']; ++$membercount;
|
{ $doneusers[$user['uid']] = $user['time']; ++$membercount;
|
if($user['invisible'] == 1)
| if($user['invisible'] == 1 && $mybb->usergroup['canbeinvisible'] == 1)
|
{ $invisiblemark = "*"; ++$inviscount;
| { $invisiblemark = "*"; ++$inviscount;
|
Zeile 528 | Zeile 533 |
---|
// Sort by which field? if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
|
// Sort by which field? if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
|
{
| {
|
$mybb->input['sortby'] = $foruminfo['defaultsortby']; } else
| $mybb->input['sortby'] = $foruminfo['defaultsortby']; } else
|
Zeile 538 | Zeile 543 |
---|
$t = 't.'; $sortfield2 = '';
|
$t = 't.'; $sortfield2 = '';
|
|
|
$sortby = htmlspecialchars_uni($mybb->input['sortby']);
switch($mybb->input['sortby'])
| $sortby = htmlspecialchars_uni($mybb->input['sortby']);
switch($mybb->input['sortby'])
|
Zeile 548 | Zeile 553 |
---|
break; case "replies": $sortfield = "replies";
|
break; case "replies": $sortfield = "replies";
|
break;
| break;
|
case "views": $sortfield = "views";
|
case "views": $sortfield = "views";
|
break;
| break;
|
case "starter": $sortfield = "username"; break;
| case "starter": $sortfield = "username"; break;
|
Zeile 568 | Zeile 573 |
---|
$sortfield = "lastpost"; $mybb->input['sortby'] = "lastpost"; break;
|
$sortfield = "lastpost"; $mybb->input['sortby'] = "lastpost"; break;
|
}
| }
|
$sortsel['rating'] = ''; // Needs to be initialized in order to speed-up things. Fixes #2031 $sortsel[$mybb->input['sortby']] = ' selected="selected"';
| $sortsel['rating'] = ''; // Needs to be initialized in order to speed-up things. Fixes #2031 $sortsel[$mybb->input['sortby']] = ' selected="selected"';
|
Zeile 607 | Zeile 612 |
---|
if($fpermissions['canviewthreads'] != 0) { // How many threads are there?
|
if($fpermissions['canviewthreads'] != 0) { // How many threads are there?
|
$query = $db->simple_select("threads t", "COUNT(tid) AS threads", "fid = '$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixsql2"); $threadcount = $db->fetch_field($query, "threads"); }
| if ($useronly === "" && $datecutsql === "" && $prefixsql === "") { $threadcount = 0;
$query = $db->simple_select("forums", "threads, unapprovedthreads, deletedthreads", "fid=".(int)$fid); $forum_threads = $db->fetch_array($query);
if(in_array(1, $visible_states)) { $threadcount += $forum_threads['threads']; }
if(in_array(-1, $visible_states)) { $threadcount += $forum_threads['deletedthreads']; }
if(in_array(0, $visible_states)) { $threadcount += $forum_threads['unapprovedthreads']; } elseif($mybb->user['uid'] && $mybb->settings['showownunapproved']) { $query = $db->simple_select("threads t", "COUNT(tid) AS threads", "fid = '$fid' AND t.visible=0 AND t.uid=".(int)$mybb->user['uid']); $threadcount += $db->fetch_field($query, "threads"); } } else { $query = $db->simple_select("threads t", "COUNT(tid) AS threads", "fid = '$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixsql2");
$threadcount = $db->fetch_field($query, "threads"); } }
|
// How many pages are there? if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
| // How many pages are there? if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
|
Zeile 629 | Zeile 665 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
} else {
| } else {
|
Zeile 665 | Zeile 701 |
---|
if((!empty($foruminfo['defaultsortby']) && $sortby != $foruminfo['defaultsortby']) || (empty($foruminfo['defaultsortby']) && $sortby != "lastpost")) { $page_url .= "{$q}{$and}sortby={$sortby}";
|
if((!empty($foruminfo['defaultsortby']) && $sortby != $foruminfo['defaultsortby']) || (empty($foruminfo['defaultsortby']) && $sortby != "lastpost")) { $page_url .= "{$q}{$and}sortby={$sortby}";
|
$q = ''; $and = "&"; }
| $q = ''; $and = "&"; }
|
if($sortordernow != "desc") { $page_url .= "{$q}{$and}order={$sortordernow}";
|
if($sortordernow != "desc") { $page_url .= "{$q}{$and}order={$sortordernow}";
|
$q = ''; $and = "&";
| $q = ''; $and = "&";
|
}
if($datecut > 0 && $datecut != 9999)
| }
if($datecut > 0 && $datecut != 9999)
|
Zeile 686 | Zeile 722 |
---|
if($tprefix != 0) { $page_url .= "{$q}{$and}prefix={$tprefix}";
|
if($tprefix != 0) { $page_url .= "{$q}{$and}prefix={$tprefix}";
|
} }
| } }
|
else { $page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED); } $multipage = multipage($threadcount, $perpage, $page, $page_url);
|
else { $page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED); } $multipage = multipage($threadcount, $perpage, $page, $page_url);
|
| $ratingcol = $ratingsort = '';
|
if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0) { $lang->load("ratethread");
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0) { $lang->load("ratethread");
|
Zeile 754 | Zeile 791 |
---|
$cookie = array(); if(isset($mybb->cookies['mybb']['announcements'])) {
|
$cookie = array(); if(isset($mybb->cookies['mybb']['announcements'])) {
|
$cookie = my_unserialize(stripslashes($mybb->cookies['mybb']['announcements']));
| $cookie = my_unserialize(stripslashes($mybb->cookies['mybb']['announcements']), false);
|
}
$announcementlist = '';
| }
$announcementlist = '';
|
Zeile 881 | Zeile 918 |
---|
} } }
|
} } }
|
| $args = array( 'threadcache' => &$threadcache, 'tids' => &$tids );
$plugins->run_hooks("forumdisplay_before_thread", $args);
|
if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && !empty($threadcache) && $ratings == true) {
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && !empty($threadcache) && $ratings == true) {
|
Zeile 924 | Zeile 968 |
---|
if($threadcache[$post['tid']]) { $threadcache[$post['tid']]['doticon'] = 1;
|
if($threadcache[$post['tid']]) { $threadcache[$post['tid']]['doticon'] = 1;
|
} } }
| } } }
|
// Read threads if($mybb->user['uid'] && $mybb->settings['threadreadcut'] > 0 && !empty($threadcache)) {
| // Read threads if($mybb->user['uid'] && $mybb->settings['threadreadcut'] > 0 && !empty($threadcache)) {
|
Zeile 935 | Zeile 979 |
---|
while($readthread = $db->fetch_array($query)) { if(!empty($moved_threads[$readthread['tid']]))
|
while($readthread = $db->fetch_array($query)) { if(!empty($moved_threads[$readthread['tid']]))
|
{
| {
|
$readthread['tid'] = $moved_threads[$readthread['tid']]; } if($threadcache[$readthread['tid']]) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
$readthread['tid'] = $moved_threads[$readthread['tid']]; } if($threadcache[$readthread['tid']]) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
} }
| } }
|
}
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) {
|
}
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) {
|
| $forum_read = 0;
|
$query = $db->simple_select("forumsread", "dateline", "fid='{$fid}' AND uid='{$mybb->user['uid']}'");
|
$query = $db->simple_select("forumsread", "dateline", "fid='{$fid}' AND uid='{$mybb->user['uid']}'");
|
$forum_read = $db->fetch_field($query, "dateline");
| if($db->num_rows($query) > 0) { $forum_read = $db->fetch_field($query, "dateline"); }
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff)
| $read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff)
|
Zeile 973 | Zeile 1021 |
---|
if(!$mybb->settings['maxmultipagelinks']) { $mybb->settings['maxmultipagelinks'] = 5;
|
if(!$mybb->settings['maxmultipagelinks']) { $mybb->settings['maxmultipagelinks'] = 5;
|
}
| }
|
if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) {
| if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) {
|
Zeile 1002 | Zeile 1050 |
---|
if($thread['sticky'] == 1) { $thread_type_class = " forumdisplay_sticky";
|
if($thread['sticky'] == 1) { $thread_type_class = " forumdisplay_sticky";
|
} else
| } else
|
{ $thread_type_class = " forumdisplay_regular"; }
|
{ $thread_type_class = " forumdisplay_regular"; }
|
|
|
$folder = ''; $prefix = '';
$thread['author'] = $thread['uid']; if(!$thread['username'])
|
$folder = ''; $prefix = '';
$thread['author'] = $thread['uid']; if(!$thread['username'])
|
{
| {
|
if(!$thread['threadusername'])
|
if(!$thread['threadusername'])
|
{
| {
|
$thread['username'] = $thread['profilelink'] = htmlspecialchars_uni($lang->guest);
|
$thread['username'] = $thread['profilelink'] = htmlspecialchars_uni($lang->guest);
|
}
| }
|
else { $thread['username'] = $thread['profilelink'] = htmlspecialchars_uni($thread['threadusername']);
|
else { $thread['username'] = $thread['profilelink'] = htmlspecialchars_uni($thread['threadusername']);
|
} } else
| } } else
|
{ $thread['username'] = htmlspecialchars_uni($thread['username']); $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);
| { $thread['username'] = htmlspecialchars_uni($thread['username']); $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);
|
Zeile 1042 | Zeile 1090 |
---|
$thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']);
|
$thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']);
|
if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) {
| if($thread['icon'] > 0 && isset($icon_cache[$thread['icon']])) {
|
$icon = $icon_cache[$thread['icon']]; $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']); $icon['path'] = htmlspecialchars_uni($icon['path']);
| $icon = $icon_cache[$thread['icon']]; $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']); $icon['path'] = htmlspecialchars_uni($icon['path']);
|
Zeile 1054 | Zeile 1102 |
---|
else { $icon = " ";
|
else { $icon = " ";
|
}
| }
|
$prefix = ''; if($thread['poll'])
| $prefix = ''; if($thread['poll'])
|
Zeile 1083 | Zeile 1131 |
---|
} else {
|
} else {
|
$thread['averagerating'] = (float)round($thread['averagerating'], 2); $thread['width'] = (int)round($thread['averagerating'])*20;
| |
$thread['numratings'] = (int)$thread['numratings'];
|
$thread['numratings'] = (int)$thread['numratings'];
|
| if($thread['numratings'] == 0) { $thread['averagerating'] = 0; $thread['width'] = 0; } else { $thread['averagerating'] = (float)round($thread['averagerating'], 2); $thread['width'] = (int)round($thread['averagerating']) * 20; }
|
$not_rated = ''; if(!isset($thread['rated']) || empty($thread['rated']))
| $not_rated = ''; if(!isset($thread['rated']) || empty($thread['rated']))
|
Zeile 1319 | Zeile 1376 |
---|
eval("\$attachment_count = \"".$templates->get("forumdisplay_thread_attachment_count")."\";"); }
|
eval("\$attachment_count = \"".$templates->get("forumdisplay_thread_attachment_count")."\";"); }
|
else { $attachment_count = ''; }
| else { $attachment_count = ''; }
|
$plugins->run_hooks("forumdisplay_thread_end");
if($fpermissions['canviewdeletionnotice'] != 0 && $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted"))
| $plugins->run_hooks("forumdisplay_thread_end");
if($fpermissions['canviewdeletionnotice'] != 0 && $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted"))
|
Zeile 1332 | Zeile 1389 |
---|
} else {
|
} else {
|
| $thread['start_datetime'] = my_date('relative', $thread['dateline']);
|
eval("\$threads .= \"".$templates->get("forumdisplay_thread")."\";"); } }
| eval("\$threads .= \"".$templates->get("forumdisplay_thread")."\";"); } }
|
Zeile 1340 | Zeile 1398 |
---|
if($ismod) { if(is_moderator($fid, "canusecustomtools") && $has_modtools == true)
|
if($ismod) { if(is_moderator($fid, "canusecustomtools") && $has_modtools == true)
|
{
| {
|
$gids = explode(',', $mybb->user['additionalgroups']); $gids[] = $mybb->user['usergroup']; $gids = array_filter(array_unique($gids));
| $gids = explode(',', $mybb->user['additionalgroups']); $gids[] = $mybb->user['usergroup']; $gids = array_filter(array_unique($gids));
|
Zeile 1377 | Zeile 1435 |
---|
{ eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";"); }
|
{ eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";"); }
|
}
$inlinemodopenclose = $inlinemodstickunstick = $inlinemodsoftdelete = $inlinemodrestore = $inlinemoddelete = $inlinemodmanage = $inlinemodapproveunapprove = '';
| }
$inlinemodopenclose = $inlinemodstickunstick = $inlinemodsoftdelete = $inlinemodrestore = $inlinemoddelete = $inlinemodmanage = $inlinemodapproveunapprove = '';
|
if(is_moderator($fid, "canopenclosethreads")) {
| if(is_moderator($fid, "canopenclosethreads")) {
|
Zeile 1436 | Zeile 1494 |
---|
if($unread_threads !== false && $unread_threads == 0 && empty($unread_forums)) { mark_forum_read($fid);
|
if($unread_threads !== false && $unread_threads == 0 && empty($unread_forums)) { mark_forum_read($fid);
|
}
| }
|
// Subscription status $add_remove_subscription = 'add'; $add_remove_subscription_text = $lang->subscribe_forum;
| // Subscription status $add_remove_subscription = 'add'; $add_remove_subscription_text = $lang->subscribe_forum;
|
Zeile 1447 | Zeile 1505 |
---|
{ $query = $db->simple_select("forumsubscriptions", "fid", "fid='".$fid."' AND uid='{$mybb->user['uid']}'", array('limit' => 1));
|
{ $query = $db->simple_select("forumsubscriptions", "fid", "fid='".$fid."' AND uid='{$mybb->user['uid']}'", array('limit' => 1));
|
if($db->fetch_field($query, 'fid'))
| if($db->num_rows($query) > 0)
|
{ $add_remove_subscription = 'remove'; $add_remove_subscription_text = $lang->unsubscribe_forum;
| { $add_remove_subscription = 'remove'; $add_remove_subscription_text = $lang->unsubscribe_forum;
|
Zeile 1478 | Zeile 1536 |
---|
}
$prefixselect = build_forum_prefix_select($fid, $tprefix);
|
}
$prefixselect = build_forum_prefix_select($fid, $tprefix);
|
| // Populate Forumsort $forumsort = ''; eval("\$forumsort = \"".$templates->get("forumdisplay_forumsort")."\";");
|
$plugins->run_hooks("forumdisplay_threadlist");
| $plugins->run_hooks("forumdisplay_threadlist");
|