Zeile 12 | Zeile 12 |
---|
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_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby,forumdisplay_newthread,forumdisplay_searchforum,forumdisplay_orderarrow,forumdisplay_thread_rating,forumdisplay_threadlist_rating,forumdisplay_threadlist_sortrating,forumbit_moderators,forumbit_subforums,forumbit_depth2_forum_lastpost";
| $templatelist = "forumdisplay,forumdisplay_thread,forumbit_depth1_cat,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby,forumdisplay_newthread,forumdisplay_searchforum,forumdisplay_orderarrow,forumdisplay_thread_rating,forumdisplay_threadlist_rating,forumdisplay_threadlist_sortrating,forumbit_moderators,forumbit_subforums,forumbit_depth2_forum_lastpost";
|
$templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more"; $templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,forumdisplay_password_wrongpass,forumdisplay_password";
| $templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more"; $templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,forumdisplay_password_wrongpass,forumdisplay_password";
|
Zeile 298 | Zeile 298 |
---|
{ $invisiblemark = ''; }
|
{ $invisiblemark = ''; }
|
|
|
if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid']) { $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
| if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid']) { $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
|
Zeile 321 | Zeile 321 |
---|
{ $onlinesep = $lang->comma; }
|
{ $onlinesep = $lang->comma; }
|
|
|
$invisonline = ''; if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1)) {
| $invisonline = ''; if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1)) {
|
Zeile 344 | Zeile 344 |
---|
{ $foruminfo['rulestitle'] = $lang->sprintf($lang->forum_rules, $foruminfo['name']); }
|
{ $foruminfo['rulestitle'] = $lang->sprintf($lang->forum_rules, $foruminfo['name']); }
|
|
|
$rules_parser = array( "allow_html" => 1, "allow_mycode" => 1,
| $rules_parser = array( "allow_html" => 1, "allow_mycode" => 1,
|
Zeile 360 | Zeile 360 |
---|
else if($foruminfo['rulestype'] == 2) { eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");
|
else if($foruminfo['rulestype'] == 2) { eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");
|
}
| }
|
}
$bgcolor = "trow1";
| }
$bgcolor = "trow1";
|
Zeile 388 | Zeile 388 |
---|
if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1) { $can_edit_titles = 1;
|
if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1) { $can_edit_titles = 1;
|
} else {
| } else {
|
$can_edit_titles = 0; }
| $can_edit_titles = 0; }
|
Zeile 405 | Zeile 405 |
---|
if($mybb->user['daysprune']) { $datecut = $mybb->user['daysprune'];
|
if($mybb->user['daysprune']) { $datecut = $mybb->user['daysprune'];
|
}
| }
|
else { // If the forum has a non-default date cut, use it.
| else { // If the forum has a non-default date cut, use it.
|
Zeile 419 | Zeile 419 |
---|
else { $datecut = intval($mybb->input['datecut']);
|
else { $datecut = intval($mybb->input['datecut']);
|
}
| }
|
$datecut = intval($datecut); $datecutsel[$datecut] = "selected=\"selected\""; if($datecut > 0 && $datecut != 9999)
|
$datecut = intval($datecut); $datecutsel[$datecut] = "selected=\"selected\""; if($datecut > 0 && $datecut != 9999)
|
{
| {
|
$checkdate = TIME_NOW - ($datecut * 86400); $datecutsql = "AND (lastpost >= '$checkdate' OR sticky = '1')"; $datecutsql2 = "AND (t.lastpost >= '$checkdate' OR t.sticky = '1')";
| $checkdate = TIME_NOW - ($datecut * 86400); $datecutsql = "AND (lastpost >= '$checkdate' OR sticky = '1')"; $datecutsql2 = "AND (t.lastpost >= '$checkdate' OR t.sticky = '1')";
|
Zeile 433 | Zeile 433 |
---|
{ $datecutsql = ''; $datecutsql2 = '';
|
{ $datecutsql = ''; $datecutsql2 = '';
|
}
| }
|
// Pick the sort order. if(!isset($mybb->input['order']) && !empty($foruminfo['defaultsortorder'])) {
| // Pick the sort order. if(!isset($mybb->input['order']) && !empty($foruminfo['defaultsortorder'])) {
|
Zeile 442 | Zeile 442 |
---|
}
if(!empty($mybb->input['order']))
|
}
if(!empty($mybb->input['order']))
|
{
| {
|
$mybb->input['order'] = htmlspecialchars_uni($mybb->input['order']); } else { $mybb->input['order'] = '';
|
$mybb->input['order'] = htmlspecialchars_uni($mybb->input['order']); } else { $mybb->input['order'] = '';
|
}
| }
|
switch(my_strtolower($mybb->input['order'])) { case "asc":
| switch(my_strtolower($mybb->input['order'])) { case "asc":
|
Zeile 463 | Zeile 463 |
---|
$ordersel['desc'] = "selected=\"selected\""; $oppsort = $lang->asc; $oppsortnext = "asc";
|
$ordersel['desc'] = "selected=\"selected\""; $oppsort = $lang->asc; $oppsortnext = "asc";
|
break; }
| break; }
|
// 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']; }
| $mybb->input['sortby'] = $foruminfo['defaultsortby']; }
|
Zeile 478 | Zeile 478 |
---|
if(!empty($mybb->input['sortby'])) { $sortby = htmlspecialchars_uni($mybb->input['sortby']);
|
if(!empty($mybb->input['sortby'])) { $sortby = htmlspecialchars_uni($mybb->input['sortby']);
|
} else
| } else
|
{ $mybb->input['sortby'] = ''; }
| { $mybb->input['sortby'] = ''; }
|
Zeile 494 | Zeile 494 |
---|
break; case "views": $sortfield = "views";
|
break; case "views": $sortfield = "views";
|
break;
| break;
|
case "starter": $sortfield = "username"; break;
| case "starter": $sortfield = "username"; break;
|
Zeile 524 | Zeile 524 |
---|
else { $string = "&";
|
else { $string = "&";
|
}
| }
|
// 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']))
|
{
| {
|
$sorturl = get_forum_link($fid, $mybb->input['page']).$string."datecut=$datecut";
|
$sorturl = get_forum_link($fid, $mybb->input['page']).$string."datecut=$datecut";
|
}
| }
|
else { $sorturl = get_forum_link($fid).$string."datecut=$datecut"; }
// Needs to be initialized in order to speed-up things. Fixes #2031
|
else { $sorturl = get_forum_link($fid).$string."datecut=$datecut"; }
// Needs to be initialized in order to speed-up things. Fixes #2031
|
$orderarrow = array('rating'=>'', 'subject'=>'', 'starter'=>'', 'replies'=>'', 'views'=>'');
| $orderarrow = array('rating'=>'', 'subject'=>'', 'starter'=>'', 'replies'=>'', 'views'=>'');
|
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");
|
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");
|
|
|
$threadcount = 0; $useronly = $tuseronly = ""; if(isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)
|
$threadcount = 0; $useronly = $tuseronly = ""; if(isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)
|
{
| {
|
$useronly = "AND uid={$mybb->user['uid']}"; $tuseronly = "AND t.uid={$mybb->user['uid']}"; }
|
$useronly = "AND uid={$mybb->user['uid']}"; $tuseronly = "AND t.uid={$mybb->user['uid']}"; }
|
|
|
if($fpermissions['canviewthreads'] != 0) {
|
if($fpermissions['canviewthreads'] != 0) {
|
|
|
// How many posts are there? if($datecut > 0 || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1) {
| // How many posts are there? if($datecut > 0 || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1) {
|
Zeile 566 | Zeile 566 |
---|
{ $threadcount += $forum_threads['unapprovedthreads']; }
|
{ $threadcount += $forum_threads['unapprovedthreads']; }
|
|
|
// If we have 0 threads double check there aren't any "moved" threads if($threadcount == 0) {
| // If we have 0 threads double check there aren't any "moved" threads if($threadcount == 0) {
|
Zeile 600 | Zeile 600 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
$end = $start + $perpage; $lower = $start + 1;
| $end = $start + $perpage; $lower = $start + 1;
|
Zeile 610 | Zeile 610 |
---|
{ $upper = $threadcount; }
|
{ $upper = $threadcount; }
|
|
|
// Assemble page URL if($mybb->input['sortby'] || $mybb->input['order'] || $mybb->input['datecut']) // Ugly URL
|
// Assemble page URL if($mybb->input['sortby'] || $mybb->input['order'] || $mybb->input['datecut']) // Ugly URL
|
{
| {
|
$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);
|
$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);
|
|
|
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && isset($_SERVER['SEO_SUPPORT']) && $_SERVER['SEO_SUPPORT'] == 1))
|
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && isset($_SERVER['SEO_SUPPORT']) && $_SERVER['SEO_SUPPORT'] == 1))
|
{
| {
|
$q = "?"; $and = ''; } else
|
$q = "?"; $and = ''; } else
|
{ $q = ''; $and = "&";
| { $q = ''; $and = "&";
|
}
|
}
|
|
|
if((!empty($foruminfo['defaultsortby']) && $sortby != $foruminfo['defaultsortby']) || (empty($foruminfo['defaultsortby']) && $sortby != "lastpost")) { $page_url .= "{$q}{$and}sortby={$sortby}"; $q = ''; $and = "&"; }
|
if((!empty($foruminfo['defaultsortby']) && $sortby != $foruminfo['defaultsortby']) || (empty($foruminfo['defaultsortby']) && $sortby != "lastpost")) { $page_url .= "{$q}{$and}sortby={$sortby}"; $q = ''; $and = "&"; }
|
|
|
if($sortordernow != "desc") { $page_url .= "{$q}{$and}order={$sortordernow}"; $q = ''; $and = "&"; }
|
if($sortordernow != "desc") { $page_url .= "{$q}{$and}order={$sortordernow}"; $q = ''; $and = "&"; }
|
|
|
if($datecut > 0) { $page_url .= "{$q}{$and}datecut={$datecut}";
| if($datecut > 0) { $page_url .= "{$q}{$and}datecut={$datecut}";
|
Zeile 663 | Zeile 663 |
---|
break; default: $ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";
|
break; default: $ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";
|
}
| }
|
$lpbackground = "trow2"; eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";"); eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";");
| $lpbackground = "trow2"; eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";"); eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";");
|
Zeile 751 | Zeile 751 |
---|
{ $rating = ''; $lpbackground = "trow1";
|
{ $rating = ''; $lpbackground = "trow1";
|
}
| }
|
if($ismod)
|
if($ismod)
|
{
| {
|
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
}
| }
|
else { $modann = ''; }
|
else { $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();
|
}
| }
|
if($announcements)
|
if($announcements)
|
{
| {
|
eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true; }
| eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true; }
|
Zeile 777 | Zeile 777 |
---|
{ // Clean up cookie crumbs my_setcookie('mybb[announcements]', 0, (TIME_NOW - (60*60*24*365)));
|
{ // 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);
|
else if(!empty($cookie)) { my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);
|
} } else
| } } else
|
{ $announcementlist = ''; }
| { $announcementlist = ''; }
|
Zeile 806 | Zeile 806 |
---|
$ratings = false; $moved_threads = array(); while($thread = $db->fetch_array($query))
|
$ratings = false; $moved_threads = array(); while($thread = $db->fetch_array($query))
|
{
| {
|
$threadcache[$thread['tid']] = $thread;
if($thread['numratings'] > 0 && $ratings == false)
| $threadcache[$thread['tid']] = $thread;
if($thread['numratings'] > 0 && $ratings == false)
|
Zeile 835 | Zeile 835 |
---|
} }
|
} }
|
if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && !empty($tids) && $ratings == true)
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && !empty($threadcache) && $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
|
$imp = implode(",", $tids);
| $imp = implode(",", array_keys($threadcache));
|
$query = $db->simple_select("threadratings", "tid, uid", "tid IN ({$imp}) AND uid = '{$mybb->user['uid']}'");
while($rating = $db->fetch_array($query)) { $threadcache[$rating['tid']]['rated'] = 1;
|
$query = $db->simple_select("threadratings", "tid, uid", "tid IN ({$imp}) AND uid = '{$mybb->user['uid']}'");
while($rating = $db->fetch_array($query)) { $threadcache[$rating['tid']]['rated'] = 1;
|
} }
| } }
|
}
// If user has moderation tools available, prepare the Select All feature
| }
// If user has moderation tools available, prepare the Select All feature
|
Zeile 884 | Zeile 884 |
---|
// Read threads if($mybb->user['uid'] && $mybb->settings['threadreadcut'] > 0 && !empty($threadcache)) {
|
// Read threads if($mybb->user['uid'] && $mybb->settings['threadreadcut'] > 0 && !empty($threadcache)) {
|
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
| $query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
|
while($readthread = $db->fetch_array($query)) {
|
while($readthread = $db->fetch_array($query)) {
|
if(!empty($moved_threads[$readthread['tid']])) { $readthread['tid'] = $moved_threads[$readthread['tid']];
| if(!empty($moved_threads[$readthread['tid']])) { $readthread['tid'] = $moved_threads[$readthread['tid']];
|
} if($threadcache[$readthread['tid']]) {
|
} if($threadcache[$readthread['tid']]) {
|
$threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
| $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
}
|
}
|
} }
| } }
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) {
| if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) {
|
Zeile 910 | Zeile 910 |
---|
} } else
|
} } else
|
{
| {
|
$forum_read = my_get_array_cookie("forumread", $fid);
if($mybb->cookies['mybb']['readallforums'] && !$forum_read)
| $forum_read = my_get_array_cookie("forumread", $fid);
if($mybb->cookies['mybb']['readallforums'] && !$forum_read)
|
Zeile 918 | Zeile 918 |
---|
$forum_read = $mybb->cookies['mybb']['lastvisit']; } }
|
$forum_read = $mybb->cookies['mybb']['lastvisit']; } }
|
|
|
$unreadpost = 0; $threads = ''; $load_inline_edit_js = 0; if(!empty($threadcache)) { if(!$mybb->settings['maxmultipagelinks'])
|
$unreadpost = 0; $threads = ''; $load_inline_edit_js = 0; if(!empty($threadcache)) { if(!$mybb->settings['maxmultipagelinks'])
|
{ $mybb->settings['maxmultipagelinks'] = 5; }
| { $mybb->settings['maxmultipagelinks'] = 5; }
|
if(!$mybb->settings['postsperpage']) { $mybb->settings['postperpage'] = 20; }
|
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 948 | Zeile 948 |
---|
{ $bgcolor = alt_trow(); }
|
{ $bgcolor = alt_trow(); }
|
|
|
if($thread['sticky'] == 1) { $thread_type_class = " forumdisplay_sticky";
| if($thread['sticky'] == 1) { $thread_type_class = " forumdisplay_sticky";
|
Zeile 956 | Zeile 956 |
---|
else { $thread_type_class = " forumdisplay_regular";
|
else { $thread_type_class = " forumdisplay_regular";
|
}
| }
|
$folder = ''; $prefix = '';
$thread['author'] = $thread['uid']; if(!$thread['username'])
|
$folder = ''; $prefix = '';
$thread['author'] = $thread['uid']; if(!$thread['username'])
|
{
| {
|
$thread['username'] = $thread['threadusername']; $thread['profilelink'] = $thread['threadusername'];
|
$thread['username'] = $thread['threadusername']; $thread['profilelink'] = $thread['threadusername'];
|
}
| }
|
else { $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); }
|
else { $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); }
|
|
|
// If this thread has a prefix, insert a space between prefix and subject $thread['threadprefix'] = $threadprefix = ''; if($thread['prefix'] != 0)
| // If this thread has a prefix, insert a space between prefix and subject $thread['threadprefix'] = $threadprefix = ''; if($thread['prefix'] != 0)
|
Zeile 1269 | Zeile 1269 |
---|
{ 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")."\";");
| if($customthreadtools) { eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";");
|