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 5016 2010-06-12 00:24:02Z RyanGordon $
| * $Id: forumdisplay.php 5765 2012-03-27 09:52:45Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 16 | Zeile 16 |
---|
$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";
|
$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";
|
$templatelist .= ",forumdisplay_usersbrowsing_guests,forumdisplay_usersbrowsing_user,forumdisplay_usersbrowsing,forumdisplay_inlinemoderation,forumdisplay_thread_modbit,forumdisplay_inlinemoderation_col";
| $templatelist .= ",forumdisplay_usersbrowsing_guests,forumdisplay_usersbrowsing_user,forumdisplay_usersbrowsing,forumdisplay_inlinemoderation,forumdisplay_thread_modbit,forumdisplay_inlinemoderation_col,forumdisplay_inlinemoderation_selectall";
|
$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_announcement_rating,forumdisplay_announcements_announcement_modbit,forumdisplay_rules,forumdisplay_rules_link,forumdisplay_thread_gotounread,forumdisplay_nothreads,forumdisplay_inlinemoderation_custom_tool,forumdisplay_inlinemoderation_custom"; require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
| $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_announcement_rating,forumdisplay_announcements_announcement_modbit,forumdisplay_rules,forumdisplay_rules_link,forumdisplay_thread_gotounread,forumdisplay_nothreads,forumdisplay_inlinemoderation_custom_tool,forumdisplay_inlinemoderation_custom"; require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 83 | Zeile 83 |
---|
if($mybb->user['uid'] == 0) {
|
if($mybb->user['uid'] == 0) {
|
// Build a forum cache. $query = $db->query(" SELECT * FROM ".TABLE_PREFIX."forums WHERE active != 0 ORDER BY pid, disporder "); $forumsread = unserialize($mybb->cookies['mybb']['forumread']); }
| // Cookie'd forum read time $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
if(is_array($forumsread) && empty($forumsread)) { if($mybb->cookies['mybb']['readallforums']) { $forumsread[$fid] = $mybb->cookies['mybb']['lastvisit']; } else { $forumsread = array(); } }
$query = $db->simple_select("forums", "*", "active != 0", array("order_by" => "pid, disporder")); }
|
else {
|
else {
|
// Build a forum cache.
| // Build a forum cache from the database
|
$query = $db->query(" SELECT f.*, fr.dateline AS lastread FROM ".TABLE_PREFIX."forums f
| $query = $db->query(" SELECT f.*, fr.dateline AS lastread FROM ".TABLE_PREFIX."forums f
|
Zeile 104 | Zeile 111 |
---|
ORDER BY pid, disporder "); }
|
ORDER BY pid, disporder "); }
|
|
|
while($forum = $db->fetch_array($query))
|
while($forum = $db->fetch_array($query))
|
{ if($mybb->user['uid'] == 0)
| { if($mybb->user['uid'] == 0 && $forumsread[$forum['fid']])
|
{
|
{
|
if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']]; }
| $forum['lastread'] = $forumsread[$forum['fid']];
|
}
|
}
|
|
|
$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)
|
{
| {
|
$moderatorcache = $cache->read("moderators"); }
$bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0)
|
$moderatorcache = $cache->read("moderators"); }
$bgcolor = "trow1"; if($mybb->settings['subforumsindex'] != 0)
|
{
| {
|
$showdepth = 3; } else
|
$showdepth = 3; } else
|
{
| {
|
$showdepth = 2;
|
$showdepth = 2;
|
}
| }
|
$child_forums = build_forumbits($fid, 2); $forums = $child_forums['forum_list']; if($forums) { $lang->sub_forums_in = $lang->sprintf($lang->sub_forums_in, $foruminfo['name']); eval("\$subforums = \"".$templates->get("forumdisplay_subforums")."\";");
|
$child_forums = build_forumbits($fid, 2); $forums = $child_forums['forum_list']; if($forums) { $lang->sub_forums_in = $lang->sprintf($lang->sub_forums_in, $foruminfo['name']); eval("\$subforums = \"".$templates->get("forumdisplay_subforums")."\";");
|
}
$excols = "forumdisplay";
| }
$excols = "forumdisplay";
|
// Password protected forums check_forum_password($foruminfo['fid']);
| // Password protected forums check_forum_password($foruminfo['fid']);
|
Zeile 164 | Zeile 170 |
---|
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 197 | Zeile 224 |
---|
{ continue; }
|
{ continue; }
|
$moderators .= "{$comma}<a href=\"".get_profile_link($moderator['id'])."\">".htmlspecialchars_uni($moderator['username'])."</a>";
| $moderators .= "{$comma}<a href=\"".get_profile_link($moderator['id'])."\">".format_name(htmlspecialchars_uni($moderator['username']), $moderator['usergroup'], $moderator['displaygroup'])."</a>";
|
$done_moderators['users'][] = $moderator['id']; } $comma = $lang->comma; } }
|
$done_moderators['users'][] = $moderator['id']; } $comma = $lang->comma; } }
|
| }
if($forum_stats[$mfid]['announcements']) { $has_announcements = true;
|
} } $comma = '';
| } } $comma = '';
|
Zeile 221 | Zeile 253 |
---|
if($mybb->settings['browsingthisforum'] != 0) { $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
|
if($mybb->settings['browsingthisforum'] != 0) { $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
|
|
|
$comma = ''; $guestcount = 0; $membercount = 0;
| $comma = ''; $guestcount = 0; $membercount = 0;
|
Zeile 307 | 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 575 | Zeile 607 |
---|
$and = "&"; }
|
$and = "&"; }
|
if($datecut > 0 && $datecut != 9999)
| if($datecut > 0)
|
{ $page_url .= "{$q}{$and}datecut={$datecut}"; }
| { $page_url .= "{$q}{$and}datecut={$datecut}"; }
|
Zeile 586 | 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");
|
|
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 597 | Zeile 630 |
---|
default: $ratingadd = "(t.totalratings/t.numratings) AS averagerating, "; }
|
default: $ratingadd = "(t.totalratings/t.numratings) AS averagerating, "; }
|
|
|
$lpbackground = "trow2"; eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";"); eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";"); $colspan = "7";
|
$lpbackground = "trow2"; eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";"); eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";"); $colspan = "7";
|
$select_voting = "\nLEFT JOIN ".TABLE_PREFIX."threadratings r ON(r.tid=t.tid AND r.uid='{$mybb->user['uid']}')"; $select_rating_user = "r.uid AS rated, ";
| |
} else {
| } else {
|
Zeile 610 | Zeile 642 |
---|
{ $t = "t."; $sortfield = "lastpost";
|
{ $t = "t."; $sortfield = "lastpost";
|
}
| }
|
$ratingadd = ''; $lpbackground = "trow1"; $colspan = "6";
|
$ratingadd = ''; $lpbackground = "trow1"; $colspan = "6";
|
}
| }
|
if($ismod)
|
if($ismod)
|
{
| {
|
++$colspan; }
|
++$colspan; }
|
// Get Announcements $limit = ''; $announcements = ''; if($mybb->settings['announcementlimit']) { $limit = "LIMIT 0, ".$mybb->settings['announcementlimit']; }
$sql = build_parent_list($fid, "fid", "OR", $parentlist); $time = TIME_NOW; $query = $db->query(" SELECT a.*, u.username FROM ".TABLE_PREFIX."announcements a LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid) WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1') ORDER BY a.startdate DESC $limit "); $bgcolor = alt_trow(true); // Reset the trow colors while($announcement = $db->fetch_array($query)) { if($announcement['startdate'] > $mybb->user['lastvisit']) { $new_class = ' class="subject_new"'; $folder = "newfolder"; } else { $new_class = ' class="subject_old"'; $folder = "folder"; }
$announcement['announcementlink'] = get_announcement_link($announcement['aid']); $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']); $announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']); if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0) { eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";"); $lpbackground = "trow2"; } else { $rating = ''; $lpbackground = "trow1"; } if($ismod) { eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";"); } else
| // Get Announcements if($has_announcements == true) { $limit = ''; $announcements = ''; if($mybb->settings['announcementlimit']) { $limit = "LIMIT 0, ".$mybb->settings['announcementlimit']; }
$sql = build_parent_list($fid, "fid", "OR", $parentlist); $time = TIME_NOW; $query = $db->query(" SELECT a.*, u.username FROM ".TABLE_PREFIX."announcements a LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid) 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)) { if($announcement['startdate'] > $mybb->user['lastvisit'] && !$cookie[$announcement['aid']]) { $new_class = ' class="subject_new"'; $folder = "newfolder"; } else { $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['subject'] = htmlspecialchars_uni($announcement['subject']); $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($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0) { eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";"); $lpbackground = "trow2"; } else { $rating = ''; $lpbackground = "trow1"; }
if($ismod) { eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";"); } else { $modann = ''; }
$plugins->run_hooks("forumdisplay_announcement"); eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow(); }
if($announcements) { 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))
|
{
|
{
|
$modann = '';
| my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);
|
}
|
}
|
$plugins->run_hooks("forumdisplay_announcement"); eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow(); }
if($announcements) { eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true;
| |
}
$icon_cache = $cache->read("posticons");
| }
$icon_cache = $cache->read("posticons");
|
Zeile 696 | Zeile 755 |
---|
{ // Start Getting Threads $query = $db->query("
|
{ // Start Getting Threads $query = $db->query("
|
SELECT t.*, p.displaystyle AS threadprefix, {$ratingadd}{$select_rating_user}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){$select_voting} LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid = t.prefix)
| LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2 ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2 LIMIT $start, $perpage ");
|
WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2 ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2 LIMIT $start, $perpage ");
|
| $ratings = false;
|
while($thread = $db->fetch_array($query)) { $threadcache[$thread['tid']] = $thread;
|
while($thread = $db->fetch_array($query)) { $threadcache[$thread['tid']] = $thread;
|
| if($thread['numratings'] > 0 && $ratings == false) { $ratings = true; // Looks for ratings in the forum }
|
// If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread if(substr($thread['closed'], 0, 5) == "moved")
| // If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread if(substr($thread['closed'], 0, 5) == "moved")
|
Zeile 716 | Zeile 781 |
---|
{ $moved_threads[$tid] = $thread['tid']; $tids[$thread['tid']] = $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']; if($moved_threads[$tid]) { unset($moved_threads[$tid]); }
|
$tids[$thread['tid']] = $thread['tid']; if($moved_threads[$tid]) { unset($moved_threads[$tid]); }
|
| } }
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 $imp = implode(",", $tids); $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;
|
} } } else
|
} } } else
|
{ $threadcache = $tids = null; }
| { $threadcache = $tids = null; }
|
// If user has moderation tools available, prepare the Select All feature $num_results = $db->num_rows($query);
| // If user has moderation tools available, prepare the Select All feature $num_results = $db->num_rows($query);
|
Zeile 747 | Zeile 825 |
---|
if($tids) { $tids = implode(",", $tids);
|
if($tids) { $tids = implode(",", $tids);
|
}
| }
|
// Check participation by the current user in any of these threads - for 'dot' folder icons if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && $threadcache) {
|
// Check participation by the current user in any of these threads - for 'dot' folder icons if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && $threadcache) {
|
$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
| $query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids}) {$visibleonly}");
|
while($post = $db->fetch_array($query)) { if($moved_threads[$post['tid']])
| while($post = $db->fetch_array($query)) { if($moved_threads[$post['tid']])
|
Zeile 779 | Zeile 857 |
---|
if($threadcache[$readthread['tid']]) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
if($threadcache[$readthread['tid']]) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
} } }
| } } }
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) { $query = $db->simple_select("forumsread", "dateline", "fid='{$fid}' AND uid='{$mybb->user['uid']}'"); $forum_read = $db->fetch_field($query, "dateline");
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) { $query = $db->simple_select("forumsread", "dateline", "fid='{$fid}' AND uid='{$mybb->user['uid']}'"); $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 797 | Zeile 875 |
---|
else { $forum_read = my_get_array_cookie("forumread", $fid);
|
else { $forum_read = my_get_array_cookie("forumread", $fid);
|
| if($mybb->cookies['mybb']['readallforums'] && !$forum_read) { $forum_read = $mybb->cookies['mybb']['lastvisit']; }
|
}
$unreadpost = 0;
| }
$unreadpost = 0;
|
Zeile 843 | Zeile 926 |
---|
} // If this thread has a prefix, insert a space between prefix and subject
|
} // If this thread has a prefix, insert a space between prefix and subject
|
| $threadprefix = '';
|
if($thread['prefix'] != 0) {
|
if($thread['prefix'] != 0) {
|
$thread['threadprefix'] .= ' ';
| $threadprefix = build_prefixes($thread['prefix']); $thread['threadprefix'] = $threadprefix['displaystyle'].' ';
|
}
$thread['subject'] = $parser->parse_badwords($thread['subject']);
| }
$thread['subject'] = $parser->parse_badwords($thread['subject']);
|
Zeile 880 | Zeile 965 |
---|
}
$rating = '';
|
}
$rating = '';
|
if($foruminfo['allowtratings'] != 0)
| if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0)
|
{ if($moved[0] == "moved") {
| { if($moved[0] == "moved") {
|
Zeile 1126 | Zeile 1211 |
---|
$customthreadtools = ''; if($ismod) {
|
$customthreadtools = ''; if($ismod) {
|
switch($db->type)
| if(is_moderator($fid, "canusecustomtools") && $has_modtools == true)
|
{
|
{
|
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)) { eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";"); } if(!empty($customthreadtools)) { eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";");
| 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'"); }
while($tool = $db->fetch_array($query)) { eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";"); } if($customthreadtools) { eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";"); }
|
}
|
}
|
|
|
eval("\$inlinemod = \"".$templates->get("forumdisplay_inlinemoderation")."\";"); } }
// If there are no unread threads in this forum and no unread child forums - mark it as read require_once MYBB_ROOT."inc/functions_indicators.php";
|
eval("\$inlinemod = \"".$templates->get("forumdisplay_inlinemoderation")."\";"); } }
// If there are no unread threads in this forum and no unread child forums - mark it as read require_once MYBB_ROOT."inc/functions_indicators.php";
|
if(fetch_unread_count($fid) == 0 && $unread_forums == 0)
| $unread_threads = fetch_unread_count($fid); if($unread_threads !== false && $unread_threads == 0 && $unread_forums == 0)
|
{ mark_forum_read($fid);
|
{ mark_forum_read($fid);
|
}
| }
|
// Subscription status
|
// Subscription status
|
$query = $db->simple_select("forumsubscriptions", "fid", "fid='".$fid."' AND uid='{$mybb->user['uid']}'", array('limit' => 1)); if($db->fetch_field($query, 'fid'))
| $add_remove_subscription = 'add'; $add_remove_subscription_text = $lang->subscribe_forum;
if($mybb->user['uid'])
|
{
|
{
|
$add_remove_subscription = 'remove'; $add_remove_subscription_text = $lang->unsubscribe_forum;
| $query = $db->simple_select("forumsubscriptions", "fid", "fid='".$fid."' AND uid='{$mybb->user['uid']}'", array('limit' => 1));
if($db->fetch_field($query, 'fid')) { $add_remove_subscription = 'remove'; $add_remove_subscription_text = $lang->unsubscribe_forum; }
|
}
|
}
|
else { $add_remove_subscription = 'add'; $add_remove_subscription_text = $lang->subscribe_forum; }
| |
// Is this a real forum with threads? if($foruminfo['type'] != "c")
| // Is this a real forum with threads? if($foruminfo['type'] != "c")
|
Zeile 1186 | Zeile 1278 |
---|
if($load_inline_edit_js == 1) { eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");
|
if($load_inline_edit_js == 1) { eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");
|
| }
$post_code_string = ''; if($mybb->user['uid']) { $post_code_string = "&my_post_key=".$mybb->post_code;
|
}
$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, htmlspecialchars_uni(strip_tags($foruminfo['name'])));
| }
$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, htmlspecialchars_uni(strip_tags($foruminfo['name'])));
|