eval("\$pollbox = \"" . $templates->get("showthread_poll_results") . "\";");
         $plugins->run_hooks("showthread_poll_results");
     } else {
         $publicnote = ' ';
         if ($poll['public'] == 1) {
             $publicnote = $lang->public_note;
         }
         eval("\$pollbox = \"" . $templates->get("showthread_poll") . "\";");
         $plugins->run_hooks("showthread_poll");
     }
 } else {
     $pollbox = "";
 }
 // Create the forum jump dropdown box.
 if ($mybb->settings['enableforumjump'] != 0) {
     $forumjump = build_forum_jump("", $fid, 1);
 }
 // Fetch some links
 $next_oldest_link = get_thread_link($tid, 0, "nextoldest");
 $next_newest_link = get_thread_link($tid, 0, "nextnewest");
 // Mark this thread as read
 mark_thread_read($tid, $fid);
 // If the forum is not open, show closed newreply button unless the user is a moderator of this forum.
 if ($forum['open'] != 0) {
     eval("\$newthread = \"" . $templates->get("showthread_newthread") . "\";");
     // Show the appropriate reply button if this thread is open or closed
     if ($thread['closed'] == 1) {
         eval("\$newreply = \"" . $templates->get("showthread_newreply_closed") . "\";");
     } else {
         eval("\$newreply = \"" . $templates->get("showthread_newreply") . "\";");
     }
Example #2
0
    $ordersel[$order] = "selected=\"selected\"";
    $user_options = '';
    $query = $db->query("\n\t\tSELECT DISTINCT l.uid, u.username\n\t\tFROM " . TABLE_PREFIX . "moderatorlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (l.uid=u.uid)\n\t\tORDER BY u.username ASC\n\t");
    while ($user = $db->fetch_array($query)) {
        // Deleted Users
        if (!$user['username']) {
            $user['username'] = $lang->na_deleted;
        }
        $selected = '';
        if ($mybb->get_input('uid', MyBB::INPUT_INT) == $user['uid']) {
            $selected = " selected=\"selected\"";
        }
        $user['username'] = htmlspecialchars_uni($user['username']);
        eval("\$user_options .= \"" . $templates->get("modcp_modlogs_user") . "\";");
    }
    $forum_select = build_forum_jump("", $mybb->get_input('fid', MyBB::INPUT_INT), 1, '', 0, true, '', "fid");
    eval("\$modlogs = \"" . $templates->get("modcp_modlogs") . "\";");
    output_page($modlogs);
}
if ($mybb->input['action'] == "do_delete_announcement") {
    verify_post_check($mybb->get_input('my_post_key'));
    if ($mybb->usergroup['canmanageannounce'] == 0) {
        error_no_permission();
    }
    $aid = $mybb->get_input('aid');
    $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
    $announcement = $db->fetch_array($query);
    if (!$announcement) {
        error($lang->error_invalid_announcement);
    }
    if ($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1 || $announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements") || $unviewableforums && in_array($announcement['fid'], $unviewableforums)) {
Example #3
0
/**
 * Builds a forum jump menu
 *
 * @param int The parent forum to start with
 * @param int The selected item ID
 * @param int If we need to add select boxes to this cal or not
 * @param int The current depth of forums we're at
 * @param int Whether or not to show extra items such as User CP, Forum home
 * @param boolean Ignore the showinjump setting and show all forums (for moderation pages)
 * @param array Array of permissions
 * @param string The name of the forum jump
 * @return string Forum jump items
 */
function build_forum_jump($pid = "0", $selitem = "", $addselect = "1", $depth = "", $showextras = "1", $showall = false, $permissions = "", $name = "fid")
{
    global $forum_cache, $jumpfcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;
    $pid = intval($pid);
    $jumpsel['default'] = '';
    if ($permissions) {
        $permissions = $mybb->usergroup;
    }
    if (!is_array($jumpfcache)) {
        if (!is_array($forum_cache)) {
            cache_forums();
        }
        foreach ($forum_cache as $fid => $forum) {
            if ($forum['active'] != 0) {
                $jumpfcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
            }
        }
    }
    if (!is_array($permissioncache)) {
        $permissioncache = forum_permissions();
    }
    if (isset($jumpfcache[$pid]) && is_array($jumpfcache[$pid])) {
        foreach ($jumpfcache[$pid] as $main) {
            foreach ($main as $forum) {
                $perms = $permissioncache[$forum['fid']];
                if ($forum['fid'] != "0" && ($perms['canview'] != 0 || $mybb->settings['hideprivateforums'] == 0) && $forum['linkto'] == '' && ($forum['showinjump'] != 0 || $showall == true)) {
                    $optionselected = "";
                    if ($selitem == $forum['fid']) {
                        $optionselected = "selected=\"selected\"";
                        $selecteddone = 1;
                    }
                    $forum['name'] = htmlspecialchars_uni(strip_tags($forum['name']));
                    eval("\$forumjumpbits .= \"" . $templates->get("forumjump_bit") . "\";");
                    if ($forum_cache[$forum['fid']]) {
                        $newdepth = $depth . "--";
                        $forumjumpbits .= build_forum_jump($forum['fid'], $selitem, 0, $newdepth, $showextras, $showall);
                    }
                }
            }
        }
    }
    if ($addselect) {
        if (!$selecteddone) {
            if (!$selitem) {
                $selitem = "default";
            }
            $jumpsel[$selitem] = 'selected="selected"';
        }
        if ($showextras == 0) {
            $template = "special";
        } else {
            $template = "advanced";
            if (strpos(FORUM_URL, '.html') !== false) {
                $forum_link = "'" . str_replace('{fid}', "'+this.options[this.selectedIndex].value+'", FORUM_URL) . "'";
            } else {
                $forum_link = "'" . str_replace('{fid}', "'+this.options[this.selectedIndex].value", FORUM_URL);
            }
        }
        eval("\$forumjump = \"" . $templates->get("forumjump_" . $template) . "\";");
    }
    return $forumjump;
}
     while ($tcheck = $db->fetch_array($query)) {
         if ($tcheck['count'] > 0) {
             $pcheck2[] = $tcheck['tid'];
         }
     }
     if (count($pcheck2) != count($pcheck)) {
         // One or more threads do not have posts after splitting
         error($lang->error_cantsplitall);
     }
     $inlineids = implode("|", $posts);
     if ($mybb->input['inlinetype'] == 'search') {
         clearinline($mybb->input['searchid'], 'search');
     } else {
         clearinline($tid, 'thread');
     }
     $forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");
     eval("\$splitposts = \"" . $templates->get("moderation_inline_splitposts") . "\";");
     output_page($splitposts);
     break;
     // Actually split the posts - Inline moderation
 // Actually split the posts - Inline moderation
 case "do_multisplitposts":
     // Verify incoming POST request
     verify_post_check($mybb->input['my_post_key']);
     $plist = array();
     $postlist = explode("|", $mybb->input['posts']);
     foreach ($postlist as $pid) {
         $pid = intval($pid);
         $plist[] = $pid;
     }
     if (!is_moderator_by_pids($plist, "canmanagethreads")) {
    // Fetch filter options
    $sortbysel[$mybb->input['sortby']] = "selected=\"selected\"";
    $ordersel[$mybb->input['order']] = "selected=\"selected\"";
    $query = $db->query("\n\t\tSELECT DISTINCT l.uid, u.username\n\t\tFROM " . TABLE_PREFIX . "moderatorlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (l.uid=u.uid)\n\t\tORDER BY u.username ASC\n\t");
    while ($user = $db->fetch_array($query)) {
        // Deleted Users
        if (!$user['username']) {
            $user['username'] = $lang->na_deleted;
        }
        $selected = '';
        if ($mybb->input['uid'] == $user['uid']) {
            $selected = " selected=\"selected\"";
        }
        $user_options .= "<option value=\"{$user['uid']}\"{$selected}>" . htmlspecialchars_uni($user['username']) . "</option>\n";
    }
    $forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, true, '', "fid");
    eval("\$modlogs = \"" . $templates->get("modcp_modlogs") . "\";");
    output_page($modlogs);
}
if ($mybb->input['action'] == "do_delete_announcement") {
    verify_post_check($mybb->input['my_post_key']);
    $aid = intval($mybb->input['aid']);
    $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
    $announcement = $db->fetch_array($query);
    if (!$announcement['aid']) {
        error($lang->error_invalid_announcement);
    }
    if ($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1 || $announcement['fid'] != -1 && !is_moderator($announcement['fid']) || $unviewableforums && in_array($announcement['fid'], $unviewableforums)) {
        error_no_permission();
    }
    $plugins->run_hooks("modcp_do_delete_announcement");