Ejemplo n.º 1
0
function build_forum_child_lists($forumid = -1)
{
    global $vbulletin;
    $forums = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "forum WHERE FIND_IN_SET('{$forumid}', childlist)");
    while ($forum = $vbulletin->db->fetch_array($forums)) {
        $childlist = construct_child_list($forum['forumid']);
        $forumdm =& datamanager_init('Forum', $vbulletin, ERRTYPE_SILENT);
        $forumdm->set_existing($forum);
        $forumdm->setr('childlist', $childlist);
        $forumdm->save();
        unset($forumdm);
    }
}
Ejemplo n.º 2
0
        global $db;
        if ($forumid == -1) {
            return '-1';
        }
        $childlist = $forumid;
        $children = $db->query_read("SELECT forumid FROM " . TABLE_PREFIX . "forum WHERE parentid = " . intval($forumid));
        while ($child = $db->fetch_array($children)) {
            $childlist .= ',' . $child['forumid'];
        }
        $childlist .= ',-1';
        return $childlist;
    }
    $forums = $db->query_read("SELECT forumid FROM " . TABLE_PREFIX . "forum WHERE childlist = ''");
    $count = 0;
    while ($forum = $db->fetch_array($forums)) {
        $childlist = construct_child_list($forum['forumid']);
        $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "forum\n\t\t\tSET childlist = '{$childlist}'\n\t\t\tWHERE forumid = {$forum['forumid']}\n\t\t");
        $count++;
    }
    build_forum_permissions();
    echo "<p align=\"center\">Updated {$count} forums</p>";
    define('SCRIPT_REDIRECT', true);
} else {
    if ($_REQUEST['do'] == 'bbactive') {
        $db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\tSET value = " . ($vbulletin->options['bbactive'] ? 0 : 1) . "\n\t\tWHERE varname = 'bbactive'\n\t");
        build_options();
        define('SCRIPT_REDIRECT', true);
    } else {
        if ($_REQUEST['do'] == 'language') {
            $vbulletin->input->clean_array_gpc('p', array('languageid' => TYPE_UINT));
            require_once DIR . '/includes/adminfunctions_language.php';
Ejemplo n.º 3
0
function build_forum_child_lists()
{
    global $vbulletin;
    $forums = $vbulletin->db->query_read("SELECT forumid FROM " . TABLE_PREFIX . "forum");
    while ($forum = $vbulletin->db->fetch_array($forums)) {
        $childlist = construct_child_list($forum['forumid']);
        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "forum SET childlist = '{$childlist}' WHERE forumid = {$forum['forumid']}");
    }
}