Example #1
0
function print_move_prune_rows($permcheck = '')
{
    global $vbphrase;
    print_description_row($vbphrase['date_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['original_post_date_is_at_least_xx_days_ago'], 'thread[originaldaysolder]', 0, 1, 5);
    print_input_row($vbphrase['original_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[originaldaysnewer]', 0, 1, 5);
    print_input_row($vbphrase['last_post_date_is_at_least_xx_days_ago'], 'thread[lastdaysolder]', 0, 1, 5);
    print_input_row($vbphrase['last_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[lastdaysnewer]', 0, 1, 5);
    print_description_row($vbphrase['view_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['thread_has_at_least_xx_replies'], 'thread[repliesleast]', 0, 1, 5);
    print_input_row($vbphrase['thread_has_at_most_xx_replies'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[repliesmost]', -1, 1, 5);
    print_input_row($vbphrase['thread_has_at_least_xx_views'], 'thread[viewsleast]', 0, 1, 5);
    print_input_row($vbphrase['thread_has_at_most_xx_views'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[viewsmost]', -1, 1, 5);
    print_description_row($vbphrase['status_options'], 0, 2, 'thead', 'center');
    print_yes_no_other_row($vbphrase['thread_is_sticky'], 'thread[issticky]', $vbphrase['either'], 0);
    $state = array('visible' => $vbphrase['visible'], 'moderation' => $vbphrase['awaiting_moderation'], 'deleted' => $vbphrase['deleted'], 'any' => $vbphrase['any']);
    print_radio_row($vbphrase['thread_state'], 'thread[state]', $state, 'any');
    $status = array('open' => $vbphrase['open'], 'closed' => $vbphrase['closed'], 'redirect' => $vbphrase['redirect'], 'not_redirect' => $vbphrase['not_redirect'], 'any' => $vbphrase['any']);
    print_radio_row($vbphrase['thread_status'], 'thread[status]', $status, 'not_redirect');
    print_description_row($vbphrase['other_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['username'], 'thread[posteduser]');
    print_input_row($vbphrase['title'], 'thread[titlecontains]');
    print_moderator_forum_chooser('thread[forumid]', -1, $vbphrase['all_forums'], $vbphrase['forum'], true, false, true, $permcheck);
    print_yes_no_row($vbphrase['include_child_forums'], 'thread[subforums]');
    if ($prefix_options = construct_prefix_options(0, '', true, true)) {
        print_label_row($vbphrase['prefix'], '<select name="thread[prefixid]" class="bginput">' . $prefix_options . '</select>', '', 'top', 'prefixid');
    }
}
function print_channel_permission_rows($customword, $channelpermission = array(), $extra = '')
{
    global $vbphrase;
    print_label_row("<b>{$customword}</b>", '
		<input type="button" class="button" value="' . $vbphrase['all_yes'] . '" onclick="' . iif($extra != '', 'if (js_set_custom()) { ') . ' js_check_all_option(this.form, 1);' . iif($extra != '', ' }') . '" class="button" />
		<input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="' . iif($extra != '', 'if (js_set_custom()) { ') . ' js_check_all_option(this.form, 0);' . iif($extra != '', ' }') . '" class="button" />
		<!--<input type="submit" class="button" value="Okay" class="button" />-->
	', 'tcat', 'middle');
    // Load permissions
    require_once DIR . '/includes/class_bitfield_builder.php';
    $bitvalues = array('forumpermissions', 'forumpermissions2', 'moderatorpermissions', 'createpermissions');
    $permFields = vB_ChannelPermission::fetchPermFields();
    $permPhrases = vB_ChannelPermission::fetchPermPhrases();
    if (empty($channelpermission)) {
        // we need the defaults to be displayed
        $channelpermission = vB_ChannelPermission::instance()->fetchPermissions(1);
        $channelpermission = current($channelpermission);
    }
    foreach ($permFields as $permField => $type) {
        //Do the non-bitmap fields first.
        switch ($type) {
            case vB_ChannelPermission::TYPE_HOURS:
            case vB_ChannelPermission::TYPE_COUNT:
                $permvalue = $channelpermission[$permField];
                print_input_row($vbphrase[$permPhrases[$permField]], $permField, $permvalue, true, 35, 0, '', false, 'channelPerm_' . $permField);
                break;
            case vB_ChannelPermission::TYPE_BOOL:
                $permvalue =& $channelpermission[$permField];
                print_yes_no_row($vbphrase[$permPhrases[$permField]], $permField, $permvalue, $extra);
                break;
        }
    }
    //now do the bitmaps
    foreach ($permFields as $permField => $type) {
        if ($type == vB_ChannelPermission::TYPE_BITMAP) {
            if ($permField !== 'forumpermissions2') {
                print_table_header($vbphrase[$permPhrases[$permField]]);
            }
            foreach ($channelpermission['bitfields'][$permField] as $permBit) {
                if ($permBit['used']) {
                    if (empty($permBit['phrase']) and $permField == 'moderatorpermissions') {
                        $permBit['phrase'] = "moderator_add_edit_" . $permBit['name'] . "_title";
                    }
                    if ($permField == 'moderatorpermissions' and $permBit['name'] == 'canopenclose') {
                        $helpOptions = array('prefix' => $permField);
                    } else {
                        $helpOptions = array();
                    }
                    print_yes_no_row(isset($vbphrase[$permBit['phrase']]) ? $vbphrase[$permBit['phrase']] : $permBit['phrase'], $permField . '[' . $permBit['name'] . ']', $permBit['set'], $extra, $helpOptions);
                }
            }
        }
    }
    // Legacy Hook 'admin_nperms_form' Removed //
}
Example #3
0
                 }
                 echo "Overall Repair complete<br />";
                 define('SCRIPT_REDIRECT', true);
             }
             break;
     }
 } else {
     if ($_REQUEST['do'] == 'user') {
         $vbulletin->input->clean_array_gpc('p', array('user' => TYPE_STR));
         switch ($vbulletin->GPC['type']) {
             case 'access':
                 if (empty($vbulletin->GPC['user'])) {
                     print_form_header('tools', 'user');
                     construct_hidden_code('type', 'access');
                     print_table_header('Enter username to restore access to');
                     print_input_row('User Name', 'user', '');
                     print_submit_row('Submit', '');
                 } else {
                     $userid = $db->query_first("SELECT userid, usergroupid FROM " . TABLE_PREFIX . "user WHERE username = '******'user'])) . "'");
                     if (empty($userid['userid'])) {
                         echo '<p align="center">Invalid username</p>';
                     } else {
                         // lets check that usergroupid 6 is still admin
                         $ugroup = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = 6 AND (adminpermissions & " . $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] . ")");
                         if (empty($ugroup['usergroupid'])) {
                             // lets give them admin permissions again
                             $db->query_write("UPDATE " . TABLE_PREFIX . "usergroup SET adminpermissions = 3 WHERE usergroupid = 6");
                             build_forum_permissions();
                         }
                         /*insert query*/
                         $db->query_write("REPLACE INTO " . TABLE_PREFIX . "administrator\n\t\t\t\t\t(userid, adminpermissions)\n\t\t\t\tVALUES\n\t\t\t\t\t({$userid['userid']}, " . (array_sum($vbulletin->bf_ugp_adminpermissions) - 3) . ")\n\t\t\t\t");
Example #4
0
	}

	if (!($oldban = $db->query_first("SELECT user.userid, user.username, userban.reason FROM " . TABLE_PREFIX . "userban AS userban INNER JOIN " . TABLE_PREFIX . "user AS user ON(user.userid=userban.userid) WHERE user.userid = " . $vbulletin->GPC['userid'])))
	{
		print_stop_message('invalid_user_specified');
	}

	$vbulletin->GPC['username'] = $oldban['username'];

	print_form_header('banning', 'updatereason');
	print_table_header($vbphrase['ban_user']);

	construct_hidden_code('userid', $oldban['userid']);
	print_label_row($vbphrase['username'], $vbulletin->GPC['username']);

	print_input_row($vbphrase['user_ban_reason'], 'reason', $oldban['reason'], false, 50, 250);
	print_submit_row($vbphrase['ban_user']);
}

// #############################################################################
// display users from 'banned' usergroups

if ($_REQUEST['do'] == 'modify')
{
	$vbulletin->input->clean_array_gpc('r', array(
		'pagenumber'   => TYPE_UINT,
	));

	$perpage = 100;
	if (!$vbulletin->GPC['pagenumber'])
	{
Example #5
0
    $vbulletin->input->clean_array_gpc('p', array('title' => vB_Cleaner::TYPE_STR, 'minposts' => vB_Cleaner::TYPE_UINT));
    if (empty($vbulletin->GPC['title'])) {
        print_stop_message2('invalid_user_title_specified');
    }
    /*insert query*/
    $assertor->insert('usertitle', array('title' => $vbulletin->GPC['title'], 'minposts' => $vbulletin->GPC['minposts']));
    print_stop_message2(array('saved_user_title_x_successfully', $vbulletin->GPC['title']), 'usertitle', array('do' => 'modify'));
}
// ###################### Start edit #######################
if ($_REQUEST['do'] == 'edit') {
    $usertitle = $assertor->getRow('usertitle', array('usertitleid' => $vbulletin->GPC['usertitleid']));
    print_form_header('usertitle', 'doupdate');
    construct_hidden_code('usertitleid', $vbulletin->GPC['usertitleid']);
    print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['user_title_guser'], $usertitle['title'], $vbulletin->GPC['usertitleid']), 2, 0);
    print_input_row($vbphrase['title'], 'title', $usertitle['title']);
    print_input_row($vbphrase['minimum_posts'], 'minposts', $usertitle['minposts']);
    print_submit_row($vbphrase['save']);
}
// ###################### Start do update #######################
if ($_POST['do'] == 'doupdate') {
    $vbulletin->input->clean_array_gpc('p', array('title' => vB_Cleaner::TYPE_STR, 'minposts' => vB_Cleaner::TYPE_UINT));
    if (empty($vbulletin->GPC['title'])) {
        print_stop_message2('invalid_user_title_specified');
    }
    $assertor->update('usertitle', array('title' => $vbulletin->GPC['title'], 'minposts' => $vbulletin->GPC['minposts']), array('usertitleid' => $vbulletin->GPC['usertitleid']));
    print_stop_message2(array('saved_user_title_x_successfully', $vbulletin->GPC['title']), 'usertitle', array('do' => 'modify'));
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'remove') {
    print_form_header('usertitle', 'kill');
    construct_hidden_code('usertitleid', $vbulletin->GPC['usertitleid']);
Example #6
0
     $db->query_write("\r\n\t\t\tUPDATE " . TABLE_PREFIX . "product SET\r\n\t\t\t\ttitle = '" . $db->escape_string($vbulletin->GPC['title']) . "',\r\n\t\t\t\tdescription = '" . $db->escape_string($vbulletin->GPC['description']) . "',\r\n\t\t\t\tversion = '" . $db->escape_string($vbulletin->GPC['version']) . "',\r\n\t\t\t\turl = '" . $db->escape_string($vbulletin->GPC['url']) . "',\r\n\t\t\t\tversioncheckurl = '" . $db->escape_string($vbulletin->GPC['versioncheckurl']) . "'\r\n\t\t\tWHERE productid = '" . $db->escape_string($vbulletin->GPC['productid']) . "'\r\n\t\t");
 } else {
     // product IDs must match #^[a-z0-9_]+$# and must be max 25 chars
     if (!preg_match('#^[a-z0-9_]+$#s', $vbulletin->GPC['productid']) or strlen($vbulletin->GPC['productid']) > 25) {
         $sugg = preg_replace('#\\s+#s', '_', strtolower($vbulletin->GPC['productid']));
         $sugg = preg_replace('#[^\\w]#s', '', $sugg);
         $sugg = str_replace('__', '_', $sugg);
         $sugg = substr($sugg, 0, 25);
         print_stop_message('product_id_invalid', htmlspecialchars_uni($vbulletin->GPC['productid']), $sugg);
     }
     // reserve 'vb' prefix for official vBulletin products
     if (!$vbulletin->GPC['confirm'] and strtolower(substr($vbulletin->GPC['productid'], 0, 2)) == 'vb') {
         print_form_header('plugin', 'productsave');
         print_table_header($vbphrase['vbulletin_message']);
         print_description_row(htmlspecialchars_uni($vbulletin->GPC['title']) . ' ' . htmlspecialchars_uni($vbulletin->GPC['version']) . '<dfn>' . htmlspecialchars_uni($vbulletin->GPC['description']) . '</dfn>');
         print_input_row($vbphrase['vb_prefix_reserved'], 'productid', $vbulletin->GPC['productid'], true, 35, 25);
         construct_hidden_code('title', $vbulletin->GPC['title']);
         construct_hidden_code('description', $vbulletin->GPC['description']);
         construct_hidden_code('version', $vbulletin->GPC['version']);
         construct_hidden_code('confirm', 1);
         print_submit_row();
         print_cp_footer();
         // execution terminates here
     }
     /* insert query */
     $db->query_write("\r\n\t\t\tINSERT INTO " . TABLE_PREFIX . "product\r\n\t\t\t\t(productid, title, description, version, active, url, versioncheckurl)\r\n\t\t\tVALUES\r\n\t\t\t\t('" . $db->escape_string($vbulletin->GPC['productid']) . "',\r\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['title']) . "',\r\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['description']) . "',\r\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['version']) . "',\r\n\t\t\t\t1,\r\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['url']) . "',\r\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['versioncheckurl']) . "')\r\n\t\t");
 }
 // update the products datastore
 build_product_datastore();
 // reload block types
 $blockmanager = vB_BlockManager::create($vbulletin);
Example #7
0
         print_form_header('moderator', 'remove');
         construct_hidden_code('moderatorid', $vbulletin->GPC['moderatorid']);
         print_table_header($vbphrase['if_you_would_like_to_remove_this_moderator'] . ' &nbsp; &nbsp; <input type="submit" class="button" value="' . $vbphrase['remove'] . '" tabindex="1" />');
         print_table_footer();
         print_form_header('moderator', 'update');
         construct_hidden_code('moderatorid', $vbulletin->GPC['moderatorid']);
         print_table_header(construct_phrase($vbphrase['edit_moderator_x_for_forum_y'], $moderator['username'], $moderator['forumtitle']));
     }
 }
 if ($_REQUEST['do'] != 'editglobal') {
     print_forum_chooser($vbphrase['forum_and_children'], 'forumid', $moderator['forumid']);
     if ($_REQUEST['do'] == 'add') {
         print_input_row($vbphrase['moderator_usernames'] . "<dfn>{$vbphrase['separate_usernames_semicolon']}</dfn>", 'modusername', $moderator['username'], 0);
     } else {
         if ($_REQUEST['do'] == 'edit') {
             print_input_row($vbphrase['moderator_username'], 'modusername', $moderator['username'], 0);
         }
     }
     construct_hidden_code('redir', $vbulletin->GPC['redir']);
 }
 // usergroup membership options
 if ($_REQUEST['do'] == 'add' and can_administer('canadminusers')) {
     $usergroups = array(0 => $vbphrase['do_not_change_usergroup']);
     foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) {
         $usergroups["{$usergroupid}"] = $usergroup['title'];
     }
     print_table_header($vbphrase['usergroup_options']);
     print_select_row($vbphrase['change_moderator_primary_usergroup_to'], 'usergroupid', $usergroups, 0);
     print_membergroup_row($vbphrase['make_moderator_a_member_of'], 'membergroupids', 2);
 }
 // post permissions
Example #8
0
    construct_hidden_code('group', $vbulletin->GPC['group']);
    construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']);
    construct_hidden_code('dostyleid', $template['styleid']);
    construct_hidden_code('expandset', $vbulletin->GPC['expandset']);
    construct_hidden_code('oldtitle', $template['title']);
    construct_hidden_code('lastedit', $template['dateline']);
    $backlink = "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&amp;expandset={$template['styleid']}&amp;group=" . $vbulletin->GPC['group'] . "&amp;templateid=" . $vbulletin->GPC['templateid'] . "&amp;searchstring=" . urlencode($vbulletin->GPC['searchstring']);
    $products = fetch_product_list();
    if ($template['styleid'] == -1) {
        print_select_row($vbphrase['product'], 'product', $products, $template['product']);
    } else {
        print_label_row($vbphrase['product'], $products[$template['product'] ? $template['product'] : 'vbulletin']);
        construct_hidden_code('product', $template['product'] ? $template['product'] : 'vbulletin');
    }
    print_label_row($vbphrase['style'], "<a href=\"{$backlink}\" title=\"" . $vbphrase['edit_templates'] . "\"><b>{$template['style']}</b></a>");
    print_input_row($vbphrase['title'] . ($template['styleid'] != -1 ? '<dfn>' . construct_link_code($vbphrase['view_history'], 'template.php?do=history&amp;dostyleid=' . $template['styleid'] . '&amp;title=' . urlencode($template['title']), 1) . '</dfn>' : ''), 'title', $template['title']);
    print_textarea_row($vbphrase['template'] . '
			<br /><br />
			<span class="smallfont">' . iif($template['styleid'] != -1, construct_link_code($vbphrase['show_default'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=view&amp;title={$template['title']}", 1) . '<br /><br />', '') . '<!--' . $vbphrase['wrap_text'] . '<input type="checkbox" unselectable="on" onclick="set_wordwrap(\'ta_template\', this.checked);" accesskey="w" checked="checked" />-->
			</span>', 'template', $template['template_un'], 22, '75" style="width:100%', true, true, 'ltr', 'code');
    print_template_javascript();
    print_label_row($vbphrase['save_in_template_history'], '<label for="savehistory"><input type="checkbox" name="savehistory" id="savehistory" value="1" tabindex="1" />' . $vbphrase['yes'] . '</label><br /><span class="smallfont">' . $vbphrase['comment'] . '</span> <input type="text" name="histcomment" value="" tabindex="1" class="bginput" size="50" />');
    print_submit_row($vbphrase['save'], '_default_', 2, '', "<input type=\"submit\" class=\"button\" tabindex=\"1\" name=\"return\" value=\"{$vbphrase['save_and_reload']}\" accesskey=\"e\" />");
    ?>
	<script type="text/javascript">
	<!--
	var initial_crc32 = crc32(YAHOO.util.Dom.get(textarea_id).value);
	var confirmUnload = true;
	YAHOO.util.Event.addListener('cpform', 'submit', function(e) { confirmUnload = false; });
	YAHOO.util.Event.addListener(window, 'beforeunload', function(e) {
		if (initial_crc32 != crc32(YAHOO.util.Dom.get(textarea_id).value) && confirmUnload) {
        $tables = $db->query_write("SHOW TABLES");
        while ($table = $db->fetch_array($tables, DBARRAY_NUM)) {
            $sqltable["{$table['0']}"] = $table[0];
        }
        print_form_header('upgrade_300b3', 'sqltable');
        print_table_header($upgradecore_phrases['dump_data_to_sql']);
        construct_hidden_code('step', 'backup');
        print_label_row($upgradecore_phrases['choose_table_to_dump'], '<select name="table" class="bginput">' . construct_select_options($sqltable) . '</select>');
        print_submit_row($upgradecore_phrases['dump_tables'], 0);
        unset($sqltable['all tables']);
        print_form_header('upgrade_300b3', 'csvtable');
        print_table_header($upgradecore_phrases['dump_data_to_csv']);
        construct_hidden_code('step', 'backup');
        print_label_row($upgradecore_phrases['backup_individual_table'], '<select name="table" class="bginput">' . construct_select_options($sqltable) . '</select>');
        print_input_row($upgradecore_phrases['field_seperator'], 'separator', ',', 0, 15);
        print_input_row($upgradecore_phrases['quote_character'], 'quotes', "'", 0, 15);
        print_yes_no_row($upgradecore_phrases['show_column_names'], 'showhead', 1);
        print_submit_row($upgradecore_phrases['dump_table'], 0);
        define('NO_LOG', true);
        $vbulletin->GPC['step'] = 0;
        print_next_step();
    }
}
// ***************************************************************************************************************************
// #########################################################################
// ############# GENERIC UPGRADE / INSTALL FUNCTIONS PROTOTYPES ############
// #########################################################################
// #########################################################################
// checks the environment for vB3 conditions
function verify_vb3_enviroment()
{
Example #10
0
            $promotion['reputationtype'] = 1;
            $promotion['strategy'] -= 8;
        } else {
            $promotion['reputationtype'] = 0;
        }
        if ($vbulletin->GPC['returnug']) {
            construct_hidden_code('returnug', 1);
        }
        construct_hidden_code('userpromotionid', $vbulletin->GPC['userpromotionid']);
        construct_hidden_code('usergroupid', $promotion['usergroupid']);
        print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['promotion'], $promotion['title'], $promotion['userpromotionid']));
    }
    $promotionarray = array(17 => $vbphrase['posts'], 18 => $vbphrase['join_date'], 16 => $vbphrase['reputation'], 0 => $vbphrase['promotion_strategy1'], 1 => $vbphrase['promotion_strategy2'], 2 => $vbphrase['promotion_strategy3'], 3 => $vbphrase['promotion_strategy4'], 4 => $vbphrase['promotion_strategy5'], 5 => $vbphrase['promotion_strategy6'], 6 => $vbphrase['promotion_strategy7'], 7 => $vbphrase['promotion_strategy8']);
    print_input_row($vbphrase['reputation_level'], 'promotion[reputation]', $promotion['reputation']);
    print_input_row($vbphrase['days_registered'], 'promotion[date]', $promotion['date']);
    print_input_row($vbphrase['posts'], 'promotion[posts]', $promotion['posts']);
    print_select_row($vbphrase['promotion_strategy'] . " <dfn> {$vbphrase['promotion_strategy_description']}</dfn>", 'promotion[strategy]', $promotionarray, $promotion['strategy']);
    print_select_row($vbphrase['promotion_type'] . ' <dfn>' . $vbphrase['promotion_type_description_primary_additional'] . '</dfn>', 'promotion[type]', array(1 => $vbphrase['primary_usergroup'], 2 => $vbphrase['additional_usergroups']), $promotion['type']);
    print_select_row($vbphrase['reputation_comparison_type'] . '<dfn>' . $vbphrase['reputation_comparison_type_desc'] . '</dfn>', 'promotion[reputationtype]', array($vbphrase['greater_or_equal_to'], $vbphrase['less_than']), $promotion['reputationtype']);
    print_chooser_row($vbphrase['move_user_to_usergroup'] . " <dfn>{$vbphrase['move_user_to_usergroup_description']}</dfn>", 'promotion[joinusergroupid]', 'usergroup', $promotion['joinusergroupid'], '&nbsp;');
    print_submit_row(iif(empty($vbulletin->GPC['userpromotionid']), $vbphrase['save'], '_default_'));
}
// ###################### Start do edit/insert promotions #######################
if ($_POST['do'] == 'doupdatepromotion') {
    $vbulletin->input->clean_array_gpc('p', array('promotion' => TYPE_ARRAY, 'userpromotionid' => TYPE_INT, 'returnug' => TYPE_BOOL));
    if ($vbulletin->GPC['promotion']['joinusergroupid'] == -1) {
        print_stop_message('invalid_usergroup_specified');
    }
    if ($vbulletin->GPC['promotion']['reputationtype'] and $vbulletin->GPC['promotion']['strategy'] <= 16) {
        $vbulletin->GPC['promotion']['strategy'] += 8;
    }
            $tablename = "usertextfield";
            break;
        default:
            $tablename = "post";
    }
    print_description_row(construct_phrase($vbphrase["ame_convert_warning_x"], $tablename));
    print_table_break();
    print_table_header(construct_phrase($vbphrase['ame_rebuild_xs'], $vbphrase['ame_' . $zone]));
    print_yes_no_row($vbphrase['ame_test_mode'], 'test', $settings['test']);
    print_yes_no_row($vbphrase['ame_verbose_mode'], 'verbose', $settings['verbose']);
    print_yes_no_row($vbphrase['ame_upgrade_only'], 'ameup', $settings['ameup']);
    if ($zone != "sig") {
        print_select_row($vbphrase['ame_length'], 'length', $lengths, $settings['length']);
    }
    print_input_row($vbphrase['ame_perpage'], 'perpage', $settings['perpage']);
    print_input_row($vbphrase['ame_seconds_perpage'], 'seconds', $settings['seconds']);
    construct_hidden_code('zone', $zone);
    print_submit_row();
}
/**
 * DO REBUILD
 */
if ($do == 'dorebuild') {
    $vbulletin->input->clean_array_gpc('r', array('length' => TYPE_UINT, 'perpage' => TYPE_UINT, 'seconds' => TYPE_UINT, 'cont' => TYPE_UINT, 'test' => TYPE_BOOL, 'verbose' => TYPE_BOOL, 'start' => TYPE_UINT, 'zone' => TYPE_STR, 'ameup' => TYPE_BOOL));
    $length = $vbulletin->GPC['length'];
    $start = $vbulletin->GPC['start'];
    $perpage = $vbulletin->GPC['perpage'];
    $seconds = $vbulletin->GPC['seconds'];
    $cont = $vbulletin->GPC['cont'];
    $test = $vbulletin->GPC['test'];
    $verbose = $vbulletin->GPC['verbose'];
/**
* Prints out the save options for the style generator
*/

function import_generated_style() {
	global $vbphrase, $stylecache;

	cache_styles();
	echo "
	<script type=\"text/javascript\">
	<!--
	function js_confirm_upload(tform, filefield)
	{
		if (filefield.value == \"\")
		{
			return confirm(\"".construct_phrase($vbphrase['you_did_not_specify_a_file_to_upload'], " + tform.serverfile.value + ")."\");
		}
		return true;
	}
	function js_fetch_style_title()
	{
		styleid = document.forms.downloadform.dostyleid.options[document.forms.downloadform.dostyleid.selectedIndex].value;
		document.forms.downloadform.title.value = style[styleid];
	}
	var style = new Array();
	style['-1'] = \"" . $vbphrase['master_style'] . "\"";
	foreach($stylecache AS $styleid => $style)
	{
		echo "\n\tstyle['$styleid'] = \"" . addslashes_js($style['title'], '"') . "\";";
		$styleoptions["$styleid"] = construct_depth_mark($style['depth'], '--', iif($vbulletin->debug, '--', '')) . ' ' . $style['title'];
	}
	echo "
	// -->
	</script>";

	echo '<div id="styleform">';
	echo '<form id="form">';
	construct_hidden_code('adid', $vbulletin->GPC['adid']);
	echo '<input id="form-data" type="hidden" name="data">';
	echo '<div class="styledetails"><div id="title-generated-style" class="help title-generated-style">';
	print_input_row($vbphrase['title_generated_style'], 'name', null, null, null, null, null, null, 'form-name');
	echo '</div><div id="parent-id" class="help parent-id">';
	print_style_chooser_row('parentid', -1, $vbphrase['no_parent_style'], $vbphrase['parent_style'], 1);
	echo '</div></div><div class="styleoptions"><div id="display-order" class="help display-order">';
	print_input_row($vbphrase['display_order'], 'displayorder', 1, null, null, null, null, null, 'form-displayorder');
	echo '</div><div id="allow-user-selection" class="help allow-user-selection">';
	print_yes_no_row($vbphrase['allow_user_selection'], 'userselect', 1, null, null, null, null, null, 'form-userselect');
	echo '</div></div></form></div>';
}
Example #13
0
    for ($x = 0; $x < 6; $x++) {
        if ($x == 1) {
            $minutes = array(-2 => '-') + $minutes;
            unset($minutes[-1]);
        }
        if (!isset($cron['minute'][$x])) {
            $cron['minute'][$x] = -2;
        }
        $selects .= "<select name=\"minute[{$x}]\" tabindex=\"1\" class=\"bginput\">\n";
        $selects .= construct_select_options($minutes, $cron['minute'][$x]);
        $selects .= "</select>\n";
    }
    print_label_row($vbphrase['minute'], $selects, '', 'top', 'minute');
    print_yes_no_row($vbphrase['active_gcron'], 'active', $cron['active']);
    print_yes_no_row($vbphrase['log_entries'], 'loglevel', $cron['loglevel']);
    print_input_row($vbphrase['filename_gcpglobal'], 'filename', $cron['filename'], true, 35, 0, 'ltr');
    print_select_row($vbphrase['product'], 'product', fetch_product_list(), $cron['product']);
    if ($vb5_config['Misc']['debug']) {
        print_yes_no_row($vbphrase['vbulletin_default'], 'volatile', $cron['volatile']);
    } else {
        construct_hidden_code('volatile', $cron['volatile']);
    }
    print_submit_row($vbphrase['save']);
}
// ###################### Start do update #######################
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', array('cronid' => vB_Cleaner::TYPE_INT, 'varname' => vB_Cleaner::TYPE_STR, 'filename' => vB_Cleaner::TYPE_STR, 'title' => vB_Cleaner::TYPE_STR, 'description' => vB_Cleaner::TYPE_STR, 'logphrase' => vB_Cleaner::TYPE_STR, 'weekday' => vB_Cleaner::TYPE_STR, 'day' => vB_Cleaner::TYPE_STR, 'hour' => vB_Cleaner::TYPE_STR, 'minute' => vB_Cleaner::TYPE_ARRAY, 'active' => vB_Cleaner::TYPE_INT, 'loglevel' => vB_Cleaner::TYPE_INT, 'filename' => vB_Cleaner::TYPE_STR, 'product' => vB_Cleaner::TYPE_STR, 'volatile' => vB_Cleaner::TYPE_INT));
    try {
        vB_Api::instanceInternal('cron')->save($vbulletin->GPC, $vbulletin->GPC['cronid']);
    } catch (vB_Exception_Api $e) {
        $errors = $e->get_errors();
Example #14
0
        $_bbcode['bbcodereplacement'] = str_replace('%1$s', '{param}', $_bbcode['bbcodereplacement']);
        $_bbcode['bbcodereplacement'] = str_replace('%2$s', '{option}', $_bbcode['bbcodereplacement']);
    } else {
        $_bbcode['bbcodereplacement'] = str_replace('%1$s', '{param}', $_bbcode['bbcodereplacement']);
    }
    $_bbcode['bbcodereplacement'] = str_replace('%%', '%', $_bbcode['bbcodereplacement']);
    print_form_header('bbcode', 'doupdate');
    print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['bb_code'], $_bbcode['bbcodetag'], $_bbcode['bbcodeid']), 2, 0);
    construct_hidden_code('bbcodeid', $vbulletin->GPC['bbcodeid']);
    print_input_row($vbphrase['title'], 'title', $_bbcode['title']);
    print_input_row($vbphrase['bb_code_tag_name'], 'bbcodetag', $_bbcode['bbcodetag']);
    print_textarea_row($vbphrase['replacement'], 'bbcodereplacement', $_bbcode['bbcodereplacement'], 5, 60);
    print_input_row($vbphrase['example'], 'bbcodeexample', $_bbcode['bbcodeexample']);
    print_textarea_row($vbphrase['description'], 'bbcodeexplanation', $_bbcode['bbcodeexplanation'], 10, 60);
    print_yes_no_row($vbphrase['use_option'], 'twoparams', $_bbcode['twoparams']);
    print_input_row($vbphrase['button_image_desc'], 'buttonimage', $_bbcode['buttonimage']);
    print_yes_no_row($vbphrase['remove_tag_if_empty'], 'options[strip_empty]', intval($_bbcode['options']) & $vbulletin->bf_misc['bbcodeoptions']['strip_empty'] ? 1 : 0);
    print_yes_no_row($vbphrase['disable_bbcode_in_bbcode'], 'options[stop_parse]', intval($_bbcode['options']) & $vbulletin->bf_misc['bbcodeoptions']['stop_parse'] ? 1 : 0);
    print_yes_no_row($vbphrase['disable_smilies_in_bbcode'], 'options[disable_smilies]', intval($_bbcode['options']) & $vbulletin->bf_misc['bbcodeoptions']['disable_smilies'] ? 1 : 0);
    print_yes_no_row($vbphrase['disable_wordwrap_in_bbcode'], 'options[disable_wordwrap]', intval($_bbcode['options']) & $vbulletin->bf_misc['bbcodeoptions']['disable_wordwrap'] ? 1 : 0);
    print_yes_no_row($vbphrase['disable_urlconversion_in_bbcode'], 'options[disable_urlconversion]', intval($_bbcode['options']) & $vbulletin->bf_misc['bbcodeoptions']['disable_urlconversion'] ? 1 : 0);
    print_submit_row($vbphrase['save']);
    print_form_header('', '');
    print_description_row('<span class="smallfont">' . $vbphrase['bb_code_explanations'] . '</span>');
    print_table_footer();
}
// ##################################### UPDATE ####################################
if ($_POST['do'] == 'doupdate') {
    $vbulletin->input->clean_array_gpc('p', array('bbcodeid' => TYPE_INT, 'title' => TYPE_STR, 'bbcodetag' => TYPE_STR, 'bbcodereplacement' => TYPE_STR, 'bbcodeexample' => TYPE_STR, 'bbcodeexplanation' => TYPE_STR, 'twoparams' => TYPE_BOOL, 'buttonimage' => TYPE_STR, 'options' => TYPE_ARRAY_BOOL));
    if (!$vbulletin->GPC['bbcodetag'] or !$vbulletin->GPC['bbcodereplacement']) {
        print_stop_message('please_complete_required_fields');
Example #15
0
        if ($field_names['border_width']) {
            print_select_row($vbphrase['usercss_border_width'], $field_names['border_width'], $allowedborderwidths, $selector['border_width']);
        }
        if ($field_names['padding']) {
            print_select_row($vbphrase['usercss_padding'], $field_names['padding'], $allowedpaddings, $selector['padding']);
        }
        if ($field_names['background_color']) {
            print_color_input_row($vbphrase['usercss_background_color'], $field_names['background_color'], $selector['background_color'], true, 10);
        }
        if ($field_names['background_image']) {
            if (preg_match("/^([0-9]+),([0-9]+)\$/", $selector['background_image'], $picture)) {
                $selector['background_image'] = "attachment.php?albumid=" . $picture[1] . "&attachmentid=" . $picture[2];
            } else {
                $selector['background_image'] = '';
            }
            print_input_row($vbphrase['usercss_background_image'], $field_names['background_image'], $selector['background_image']);
        }
        if ($field_names['background_repeat']) {
            print_select_row($vbphrase['usercss_background_repeat'], $field_names['background_repeat'], $allowedbackgroundrepeats, $selector['background_repeat']);
        }
    }
    if ($have_output == false) {
        print_description_row($vbphrase['user_no_permission_customize_profile']);
        print_table_footer();
    } else {
        print_submit_row();
        echo $colorPicker;
        ?>
	<script type="text/javascript">
	<!--
Example #16
0
function print_user_search_rows($email = false)
{
    global $vbulletin, $vbphrase, $stylevar;
    print_label_row($vbphrase['username'], "\n\t\t<input type=\"text\" class=\"bginput\" name=\"user[username]\" tabindex=\"1\" size=\"35\"\n\t\t/><input type=\"image\" src=\"../" . $vbulletin->options['cleargifurl'] . "\" width=\"1\" height=\"1\"\n\t\t/><input type=\"submit\" class=\"button\" value=\"{$vbphrase['exact_match']}\" tabindex=\"1\" name=\"user[exact]\" />\n\t", '', 'top', 'user[username]');
    if ($email) {
        global $iusergroupcache;
        $userarray = array('usergroupid' => 0, 'membergroupids' => '');
        $iusergroupcache = array();
        $usergroups = $vbulletin->db->query_read("SELECT usergroupid, title, (forumpermissions & " . $vbulletin->bf_ugp_forumpermissions['canview'] . ") AS CANVIEW FROM " . TABLE_PREFIX . "usergroup ORDER BY title");
        while ($usergroup = $vbulletin->db->fetch_array($usergroups)) {
            if ($usergroup['CANVIEW']) {
                $userarray['membergroupids'] .= "{$usergroup['usergroupid']},";
            }
            $iusergroupcache["{$usergroup['usergroupid']}"] = $usergroup['title'];
        }
        unset($usergroup);
        $vbulletin->db->free_result($usergroups);
        print_checkbox_row($vbphrase['all_usergroups'], 'usergroup_all', 0, -1, $vbphrase['all_usergroups'], 'check_all_usergroups(this.form, this.checked);');
        print_membergroup_row($vbphrase['primary_usergroup'], 'user[usergroupid]', 2, $userarray);
        print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroup]', 2);
        print_yes_no_row($vbphrase['include_users_that_have_declined_email'], 'user[adminemail]', 0);
    } else {
        print_chooser_row($vbphrase['primary_usergroup'], 'user[usergroupid]', 'usergroup', -1, '-- ' . $vbphrase['all_usergroups'] . ' --');
        print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroup]', 2);
    }
    print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>');
    print_input_row($vbphrase['email'], 'user[email]');
    print_input_row($vbphrase['parent_email_address'], 'user[parentemail]');
    print_yes_no_other_row($vbphrase['coppa_user'], 'user[coppauser]', $vbphrase['either'], -1);
    print_input_row($vbphrase['home_page'], 'user[homepage]');
    print_input_row($vbphrase['icq_uin'], 'user[icq]');
    print_input_row($vbphrase['aim_screen_name'], 'user[aim]');
    print_input_row($vbphrase['yahoo_id'], 'user[yahoo]');
    print_input_row($vbphrase['msn_id'], 'user[msn]');
    print_input_row($vbphrase['skype_name'], 'user[skype]');
    print_input_row($vbphrase['signature'], 'user[signature]');
    print_input_row($vbphrase['user_title'], 'user[usertitle]');
    print_input_row($vbphrase['join_date_is_after'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[joindateafter]');
    print_input_row($vbphrase['join_date_is_before'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[joindatebefore]');
    print_input_row($vbphrase['last_activity_is_after'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastactivityafter]');
    print_input_row($vbphrase['last_activity_is_before'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastactivitybefore]');
    print_input_row($vbphrase['last_post_is_after'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastpostafter]');
    print_input_row($vbphrase['last_post_is_before'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastpostbefore]');
    print_input_row($vbphrase['birthday_is_after'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[birthdayafter]');
    print_input_row($vbphrase['birthday_is_before'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[birthdaybefore]');
    print_input_row($vbphrase['posts_are_greater_than'], 'user[postslower]', '', 1, 7);
    print_input_row($vbphrase['posts_are_less_than'], 'user[postsupper]', '', 1, 7);
    print_input_row($vbphrase['reputation_is_greater_than'], 'user[reputationlower]', '', 1, 7);
    print_input_row($vbphrase['reputation_is_less_than'], 'user[reputationupper]', '', 1, 7);
    print_input_row($vbphrase['warnings_are_greater_than'], 'user[warningslower]', '', 1, 7);
    print_input_row($vbphrase['warnings_are_less_than'], 'user[warningsupper]', '', 1, 7);
    print_input_row($vbphrase['infractions_are_greater_than'], 'user[infractionslower]', '', 1, 7);
    print_input_row($vbphrase['infractions_are_less_than'], 'user[infractionsupper]', '', 1, 7);
    print_input_row($vbphrase['infraction_points_are_greater_than'], 'user[pointslower]', '', 1, 7);
    print_input_row($vbphrase['infraction_points_are_less_than'], 'user[pointsupper]', '', 1, 7);
    print_input_row($vbphrase['userid_is_greater_than'], 'user[useridlower]', '', 1, 7);
    print_input_row($vbphrase['userid_is_less_than'], 'user[useridupper]', '', 1, 7);
    print_input_row($vbphrase['registration_ip_address'], 'user[ipaddress]');
    print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>');
    $forms = array(0 => $vbphrase['edit_your_details'], 1 => "{$vbphrase['options']}: {$vbphrase['log_in']} / {$vbphrase['privacy']}", 2 => "{$vbphrase['options']}: {$vbphrase['messaging']} / {$vbphrase['notification']}", 3 => "{$vbphrase['options']}: {$vbphrase['thread_viewing']}", 4 => "{$vbphrase['options']}: {$vbphrase['date']} / {$vbphrase['time']}", 5 => "{$vbphrase['options']}: {$vbphrase['other']}");
    $currentform = -1;
    print_table_header($vbphrase['user_profile_fields']);
    $profilefields = $vbulletin->db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "profilefield AS profilefield\n\t\tLEFT JOIN " . TABLE_PREFIX . "profilefieldcategory AS profilefieldcategory ON\n\t\t\t(profilefield.profilefieldcategoryid = profilefieldcategory.profilefieldcategoryid)\n\t\tORDER BY profilefield.form, profilefieldcategory.displayorder, profilefield.displayorder\n\t");
    while ($profilefield = $vbulletin->db->fetch_array($profilefields)) {
        if ($profilefield['form'] != $currentform) {
            print_description_row(construct_phrase($vbphrase['fields_from_form_x'], $forms["{$profilefield['form']}"]), false, 2, 'optiontitle');
            $currentform = $profilefield['form'];
        }
        $profilefield['def'] = 0;
        print_profilefield_row('profile', $profilefield);
    }
    print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>');
}
Example #17
0
File: ad.php Project: Kheros/MMOver
 if (sizeof($ad_name_cache)) {
     $criteria_options['ad_x_not_displayed'] = array('<select name="criteria[ad_x_not_displayed][condition1]" tabindex="1">' . construct_select_options($ad_name_cache, $criteria_cache['ad_x_not_displayed']['condition1']) . '</select>');
 }
 // hook to allow third-party additions of criteria
 ($hook = vBulletinHook::fetch_hook('ads_list_criteria')) ? eval($hook) : false;
 // build the editor form
 print_form_header('ad', 'update');
 construct_hidden_code('adid', $vbulletin->GPC['adid']);
 if ($vbulletin->GPC['ad_location_orig']) {
     construct_hidden_code('ad_location_orig', $vbulletin->GPC['ad_location_orig']);
 }
 print_table_header($table_title);
 print_input_row($vbphrase['title'] . '<dfn>' . $vbphrase['ad_title_description'] . '</dfn>', 'title', $ad['title'], 0, 60);
 print_select_row($vbphrase['ad_location'] . '<dfn>' . $vbphrase['ad_location_description'] . '</dfn>', 'ad_location', $location_options, $vbulletin->GPC['ad_location'] ? $vbulletin->GPC['ad_location'] : $ad['adlocation']);
 print_textarea_row($vbphrase['ad_html'] . '<dfn>' . $vbphrase['ad_html_description'] . '</dfn>', 'ad_html', $ad['html'] ? $ad['html'] : $ad['snippet'], 8, 60, true, false);
 print_input_row($vbphrase['display_order'], 'displayorder', $ad['displayorder'], 0, 10);
 print_yes_no_row($vbphrase['active'] . '<dfn>' . $vbphrase['ad_active_description'] . '</dfn>', 'active', $ad['active']);
 print_description_row('<strong>' . $vbphrase['display_ad_if_elipsis'] . '</strong>', false, 2, 'tcat', '', 'criteria');
 if ($display_active_criteria_first) {
     function print_ad_criterion($criteria_option_id, &$criteria_options, $criteria_cache)
     {
         global $vbphrase;
         $criteria_option = $criteria_options["{$criteria_option_id}"];
         print_description_row("<label><input type=\"checkbox\" id=\"cb_{$criteria_option_id}\" tabindex=\"1\" name=\"criteria[{$criteria_option_id}][active]\" title=\"{$vbphrase['criterion_is_active']}\" value=\"1\"" . (empty($criteria_cache["{$criteria_option_id}"]) ? '' : ' checked="checked"') . " />" . "<span id=\"span_{$criteria_option_id}\">" . construct_phrase($vbphrase[$criteria_option_id . '_criteria'], $criteria_option[0], $criteria_option[1], $criteria_option[2]) . '</span></label>');
         unset($criteria_options["{$criteria_option_id}"]);
     }
     foreach (array_keys($criteria_cache) as $id) {
         print_ad_criterion($id, $criteria_options, $criteria_cache);
     }
     foreach ($criteria_options as $id => $criteria_option) {
         print_ad_criterion($id, $criteria_options, $criteria_cache);
Example #18
0
        $userlist["{$user['userid']}"] = $user['username'];
    }
    print_form_header('modlog', 'view');
    print_table_header($vbphrase['moderator_log_viewer']);
    print_input_row($vbphrase['log_entries_to_show_per_page'], 'perpage', 15);
    print_select_row($vbphrase['show_only_entries_generated_by'], 'userid', $userlist);
    print_time_row($vbphrase['start_date'], 'startdate', 0, 0);
    print_time_row($vbphrase['end_date'], 'enddate', 0, 0);
    if (count($products = fetch_product_list()) > 1) {
        print_select_row($vbphrase['product'], 'product', array('' => $vbphrase['all_products']) + $products);
    }
    print_select_row($vbphrase['order_by'], 'orderby', array('date' => $vbphrase['date'], 'user' => $vbphrase['username']), 'date');
    print_submit_row($vbphrase['view'], 0);
    if (can_access_logs($vbulletin->config['SpecialUsers']['canpruneadminlog'], 0, '')) {
        print_form_header('modlog', 'prunelog');
        print_table_header($vbphrase['prune_moderator_log']);
        print_select_row($vbphrase['remove_entries_logged_by_user'], 'userid', $userlist);
        if (count($products) > 1) {
            print_select_row($vbphrase['product'], 'product', array('' => $vbphrase['all_products']) + $products);
        }
        print_input_row($vbphrase['remove_entries_older_than_days'], 'daysprune', 30);
        print_submit_row($vbphrase['prune_log_entries'], 0);
    }
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:56, Sat Oct 11th 2008
|| # CVS: $RCSfile$ - $Revision: 26275 $
|| ####################################################################
\*======================================================================*/
Example #19
0
    print_stop_message('saved_administrator_permissions_successfully');
}
// #############################################################################
if ($_REQUEST['do'] == 'edit') {
    echo "<p align=\"center\">{$vbphrase['give_admin_access_arbitrary_html']}</p>";
    print_form_header('adminpermissions', 'update');
    construct_hidden_code('userid', $vbulletin->GPC['userid']);
    construct_hidden_code('oldpermissions', $user['adminpermissions']);
    print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['administrator_permissions'], $user['username'], $user['userid']));
    print_label_row("{$vbphrase['administrator']}: <a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u=" . $vbulletin->GPC['userid'] . "\">{$user['username']}</a>", '<div align="' . $stylevar['right'] . '"><input type="button" class="button" value=" ' . $vbphrase['all_yes'] . ' " onclick="js_check_all_option(this.form, 1);" /> <input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="js_check_all_option(this.form, 0);" /></div>', 'thead');
    foreach (convert_bits_to_array($user['adminpermissions'], $ADMINPERMISSIONS) as $field => $value) {
        print_yes_no_row($permsphrase["{$field}"] == '' ? $vbphrase['n_a'] : $permsphrase["{$field}"], "adminpermissions[{$field}]", $value);
    }
    ($hook = vBulletinHook::fetch_hook('admin_permissions_form')) ? eval($hook) : false;
    print_select_row($vbphrase['control_panel_style_choice'], 'cssprefs', array_merge(array('' => "({$vbphrase['default']})"), fetch_cpcss_options()), $user['cssprefs']);
    print_input_row($vbphrase['dismissed_news_item_ids'], 'dismissednews', $user['dismissednews']);
    print_submit_row();
}
// #############################################################################
if ($_REQUEST['do'] == 'modify') {
    print_form_header('adminpermissions', 'edit');
    print_table_header($vbphrase['administrator_permissions'], 3);
    $users = $db->query_read("\n\t\tSELECT user.username, usergroupid, membergroupids, infractiongroupids, administrator.*\n\t\tFROM " . TABLE_PREFIX . "administrator AS administrator\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\tORDER BY user.username\n\t");
    while ($user = $db->fetch_array($users)) {
        $perms = fetch_permissions(0, $user['userid'], $user);
        if ($perms['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) {
            print_cells_row(array("<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$user['userid']}\" name=\"user{$user['userid']}\"><b>{$user['username']}</b></a>", '-', construct_link_code($vbphrase['view_control_panel_log'], "adminlog.php?" . $vbulletin->session->vars['sessionurl'] . "do=view&script=&u={$user['userid']}") . construct_link_code($vbphrase['edit_permissions'], "adminpermissions.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$user['userid']}")), 0, '', 0);
        }
    }
    print_table_footer();
}
Example #20
0
            print_stop_message('no_users_matched_your_query');
        }
    } else {
        print_stop_message('please_complete_required_fields');
    }
}
// ############################# start prune users #########################
if ($_REQUEST['do'] == 'prune') {
    $vbulletin->input->clean_array_gpc('r', array('usergroupid' => TYPE_UINT, 'daysprune' => TYPE_INT, 'joindateunix' => TYPE_INT, 'minposts' => TYPE_INT));
    print_form_header('user', 'pruneusers');
    print_table_header($vbphrase['user_moving_pruning_system']);
    print_description_row('<blockquote>' . $vbphrase['this_system_allows_you_to_mass_move_delete_users'] . '</blockquote>');
    print_chooser_row($vbphrase['usergroup'], 'usergroupid', 'usergroup', iif($vbulletin->GPC['usergroupid'], $vbulletin->GPC['usergroupid'], -1), $vbphrase['all_usergroups']);
    print_input_row($vbphrase['has_not_logged_on_for_xx_days'], 'daysprune', iif($vbulletin->GPC['daysprune'], $vbulletin->GPC['daysprune'], 365));
    print_time_row($vbphrase['join_date_is_before'], 'joindate', $vbulletin->GPC['joindateunix'], false, false, 'middle');
    print_input_row($vbphrase['posts_is_less_than'], 'minposts', iif($vbulletin->GPC['minposts'], $vbulletin->GPC['minposts'], '0'));
    print_label_row($vbphrase['order_by'], '<select name="order" tabindex="1" class="bginput">
		<option value="username">' . $vbphrase['username'] . '</option>
		<option value="email">' . $vbphrase['email'] . '</option>
		<option value="usergroup">' . $vbphrase['usergroup'] . '</option>
		<option value="posts">' . $vbphrase['post_count'] . '</option>
		<option value="lastactivity">' . $vbphrase['last_activity'] . '</option>
		<option value="joindate">' . $vbphrase['join_date'] . '</option>
	</select>', '', 'top', 'order');
    print_submit_row($vbphrase['find']);
}
// ############################# user change history #########################
if ($_REQUEST['do'] == 'changehistory') {
    require_once DIR . '/includes/class_userchangelog.php';
    require_once DIR . '/includes/functions_misc.php';
    $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_UINT));
Example #21
0
    if (empty($prefixset)) {
        $prefixset = array('prefixsetid' => '', 'title' => '', 'displayorder' => 10);
    }
    print_form_header('prefix', 'insertset');
    if ($prefixset['prefixsetid']) {
        print_table_header($vbphrase['editing_prefix_set']);
        print_label_row($vbphrase['prefix_set_id_alphanumeric_note'], $prefixset['prefixsetid'], '', 'top', 'prefixsetid');
        construct_hidden_code('origprefixsetid', $prefixset['prefixsetid']);
    } else {
        print_table_header($vbphrase['adding_prefix_set']);
        print_input_row($vbphrase['prefix_set_id_alphanumeric_note'], 'prefixsetid', '', true, 35, 25);
    }
    $trans_link = "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&fieldname=prefix&t=1&varname=";
    // has varname appended
    print_input_row($vbphrase['title'] . ($prefixset['prefixsetid'] ? '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . "prefixset_{$prefixset['prefixsetid']}_title", 1) . '</dfn>' : ''), 'title', $prefixset['title']);
    print_input_row($vbphrase['display_order'], 'displayorder', $prefixset['displayorder']);
    $enabled_forums = array();
    if ($prefixset['prefixsetid']) {
        $forums_sql = $db->query_read("\r\n\t\t\tSELECT forumid\r\n\t\t\tFROM " . TABLE_PREFIX . "forumprefixset\r\n\t\t\tWHERE prefixsetid = '" . $db->escape_string($prefixset['prefixsetid']) . "'\r\n\t\t");
        while ($forum = $db->fetch_array($forums_sql)) {
            $enabled_forums[] = $forum['forumid'];
        }
    }
    if (empty($enabled_forums)) {
        // default to selecting "none"
        $enabled_forums = array(-1);
    }
    print_forum_chooser($vbphrase['use_prefix_set_in_these_forums'], 'forumids[]', $enabled_forums, $vbphrase['none'], false, true);
    print_submit_row();
}
// ########################################################################
Example #22
0
     $select_options[0] = 'No Attachment';
     $sql = "SELECT * FROM " . TABLE_PREFIX . "qhvbmailer_attachments ORDER BY created DESC";
     $attachments = $db->query_read_slave($sql);
     while ($attachment = $db->fetch_array($attachments)) {
         $select_options[$attachment['id']] = $attachment['filename'];
     }
     for ($i = 1; $i < 100; $i++) {
         $select_options_days[$i] = $i;
     }
     print_form_header('qhvbmailer', 'manage_newsletters', false, true);
     print_table_header('Add/Edit Newsletter');
     construct_hidden_code('act', '3');
     construct_hidden_code('template_id', $template['id']);
     print_input_row('Varname', 'varname', $template['varname']);
     print_select_row('Send Every (amount of days)', 'nl_every', $select_options_days, $template['nl_every']);
     print_input_row('Subject', 'subject', $template_phrases["nl_" . $template['id'] . "_" . $template['varname'] . "_subject"]);
     print_select_row('Attachment', 'attachment_id', $select_options, $template['attachment_id']);
     print_textarea_row('Text Body', 'text', $template_phrases["nl_" . $template['id'] . "_" . $template['varname'] . "_text"], 8, 80);
     print_textarea_row('HTML Body', 'html', $template_phrases["nl_" . $template['id'] . "_" . $template['varname'] . "_html"], 24, 80, false, false, '', false, 'elm1');
     print_submit_row('Add/Edit Newsletter');
 } elseif ($_GET['act'] == 3) {
     $vbulletin->input->clean_array_gpc('p', array('template_id' => TYPE_UINT, 'varname' => TYPE_STR, 'nl_every' => TYPE_UINT, 'subject' => TYPE_STR, 'attachment_id' => TYPE_INT, 'text' => TYPE_STR, 'html' => TYPE_STR));
     if ($vbulletin->GPC['nl_every'] > 0) {
         if ($vbulletin->GPC['template_id'] > 0) {
             //Edit
             $sql = "SELECT * FROM " . TABLE_PREFIX . "qhvbmailer_templates WHERE id='" . $vbulletin->GPC['template_id'] . "'";
             $template = $db->query_first($sql);
             if ($db->query_write("UPDATE " . TABLE_PREFIX . "qhvbmailer_templates SET nl_every='" . $vbulletin->GPC['nl_every'] . "', attachment_id='" . $vbulletin->GPC['attachment_id'] . "' WHERE id='" . $vbulletin->GPC['template_id'] . "'")) {
                 $db->query_write("UPDATE " . TABLE_PREFIX . "phrase SET text='" . $db->escape_string($vbulletin->GPC['subject']) . "' WHERE varname='nl_" . $template['id'] . "_" . $template['varname'] . "_subject'");
                 $db->query_write("UPDATE " . TABLE_PREFIX . "phrase SET text='" . $db->escape_string($vbulletin->GPC['text']) . "' WHERE varname='nl_" . $template['id'] . "_" . $template['varname'] . "_text'");
                 $db->query_write("UPDATE " . TABLE_PREFIX . "phrase SET text='" . $db->escape_string($vbulletin->GPC['html']) . "' WHERE varname='nl_" . $template['id'] . "_" . $template['varname'] . "_html'");
    // make a list of usergroups into which to move this user
    $usergroups = array();
    foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) {
        if (!($usergroup['genericoptions'] & $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'])) {
            $usergroups["{$usergroupid}"] = $usergroup['title'];
            if ($selectedid == 0) {
                $selectedid = $usergroupid;
            }
        }
    }
    $temporary_phrase = $vbphrase['temporary_ban_options'];
    $permanent_phrase = $vbphrase['permanent_ban_options'];
    // make a list of banning period options
    $periodoptions = array($temporary_phrase => array('D_1' => construct_phrase($vbphrase['x_days'], 1), 'D_2' => construct_phrase($vbphrase['x_days'], 2), 'D_3' => construct_phrase($vbphrase['x_days'], 3), 'D_4' => construct_phrase($vbphrase['x_days'], 4), 'D_5' => construct_phrase($vbphrase['x_days'], 5), 'D_6' => construct_phrase($vbphrase['x_days'], 6), 'D_7' => construct_phrase($vbphrase['x_days'], 7), 'D_10' => construct_phrase($vbphrase['x_days'], 10), 'D_14' => construct_phrase($vbphrase['x_weeks'], 2), 'D_21' => construct_phrase($vbphrase['x_weeks'], 3), 'M_1' => construct_phrase($vbphrase['x_months'], 1), 'M_2' => construct_phrase($vbphrase['x_months'], 2), 'M_3' => construct_phrase($vbphrase['x_months'], 3), 'M_4' => construct_phrase($vbphrase['x_months'], 4), 'M_5' => construct_phrase($vbphrase['x_months'], 5), 'M_6' => construct_phrase($vbphrase['x_months'], 6), 'Y_1' => construct_phrase($vbphrase['x_years'], 1), 'Y_2' => construct_phrase($vbphrase['x_years'], 2)), $permanent_phrase => array('PERMA' => "{$vbphrase['permanent']} - {$vbphrase['never_lift_ban']}"));
    $methods = array('points' => $vbphrase['points'], 'infractions' => $vbphrase['infractions']);
    print_input_row($vbphrase['amount'], 'amount', $infraction['amount'], true, 5);
    print_select_row($vbphrase['method'], 'method', $methods, $infraction['method']);
    print_chooser_row($vbphrase['primary_usergroup'], 'usergroupid', 'usergroup', $infraction['usergroupid'], '-- ' . $vbphrase['all_usergroups'] . ' --');
    print_select_row($vbphrase['move_user_to_usergroup'], 'banusergroupid', $usergroups, $selectedid);
    print_select_row($vbphrase['lift_ban_after'], 'period', $periodoptions, $infraction['period']);
    print_submit_row($vbphrase['save']);
}
// ###################### Start do update #######################
if ($_POST['do'] == 'updatebangroup') {
    $vbulletin->input->clean_array_gpc('p', array('method' => TYPE_NOHTML, 'amount' => TYPE_UINT, 'usergroupid' => TYPE_INT, 'banusergroupid' => TYPE_UINT, 'period' => TYPE_NOHTML));
    if (empty($vbulletin->GPC['amount'])) {
        print_stop_message('please_complete_required_fields');
    }
    if (empty($vbulletin->GPC['infractionbanid'])) {
        $db->query_write("INSERT INTO " . TABLE_PREFIX . "infractionban (amount) VALUES (0)");
        $vbulletin->GPC['infractionbanid'] = $db->insert_id();
Example #24
0
    print_label_row($vbphrase['text_direction'], '<label for="rb_l2r"><input type="radio" name="options[direction]" id="rb_l2r" value="1" tabindex="1"' . iif($language['direction'], ' checked="checked"') . " />{$vbphrase['left_to_right']}</label><br />" . '
		 <label for="rb_r2l"><input type="radio" name="options[direction]" id="rb_r2l" value="0" tabindex="1"' . iif(!$language['direction'], ' checked="checked"') . " />{$vbphrase['right_to_left']}</label>", '', 'top', 'direction');
    print_input_row($vbphrase['language_code'], 'languagecode', $language['languagecode']);
    print_input_row($vbphrase['html_charset'] . "<code>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=<b>{$language['charset']}</b>&quot; /&gt;</code>", 'charset', $language['charset']);
    print_input_row($vbphrase['image_folder_override'], 'imagesoverride', $language['imagesoverride']);
    print_description_row($vbphrase['date_time_formatting'], 0, 2, 'thead');
    print_input_row($vbphrase['locale'], 'locale', $language['locale']);
    print_input_row($vbphrase['date_format_override'], 'dateoverride', $language['dateoverride']);
    print_input_row($vbphrase['time_format_override'], 'timeoverride', $language['timeoverride']);
    print_input_row($vbphrase['registereddate_format_override'], 'registereddateoverride', $language['registereddateoverride']);
    print_input_row($vbphrase['calformat1_format_override'], 'calformat1override', $language['calformat1override']);
    print_input_row($vbphrase['calformat2_format_override'], 'calformat2override', $language['calformat2override']);
    print_input_row($vbphrase['logdate_format_override'], 'logdateoverride', $language['logdateoverride']);
    print_description_row($vbphrase['number_formatting'], 0, 2, 'thead');
    print_input_row($vbphrase['decimal_separator'], 'decimalsep', $language['decimalsep'], 1, 3, 1);
    print_input_row($vbphrase['thousands_separator'], 'thousandsep', $language['thousandsep'], 1, 3, 1);
    print_submit_row($vbphrase['save']);
}
// ##########################################################################
if ($_REQUEST['do'] == 'edit') {
    $vbulletin->input->clean_array_gpc('r', array('fieldname' => TYPE_NOHTML, 'pagenumber' => TYPE_UINT, 'prev' => TYPE_STR, 'next' => TYPE_STR));
    if ($vbulletin->GPC['prev'] != '' or $vbulletin->GPC['next'] != '') {
        if ($vbulletin->GPC['prev'] != '') {
            $vbulletin->GPC['pagenumber'] -= 1;
        } else {
            $vbulletin->GPC['pagenumber'] += 1;
        }
    }
    if ($vbulletin->GPC['fieldname'] == '') {
        $vbulletin->GPC['fieldname'] = 'global';
    }
Example #25
0
        $cell[] = construct_link_code($vbphrase['edit'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=editreputation&reputationid={$comment['reputationid']}", false, '', true) . ' ' . construct_link_code($vbphrase['delete'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=deletereputation&reputationid={$comment['reputationid']}", false, '', true);
        print_cells_row($cell);
    }
    print_table_footer(7, "{$firstpage} {$prevpage} &nbsp; {$nextpage} {$lastpage}");
}
// *************************************************************************************************
if ($_REQUEST['do'] == 'editreputation') {
    $vbulletin->input->clean_array_gpc('r', array('reputationid' => TYPE_INT));
    if ($repinfo = $db->query_first("\n\t\tSELECT rep.*, whoadded.username as whoadded_username, user.username, thread.title, thread.threadid\n\t\tFROM " . TABLE_PREFIX . "reputation AS rep\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (rep.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS whoadded ON (rep.whoadded = whoadded.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post ON (rep.postid = post.postid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)\n\t\tWHERE reputationid = " . $vbulletin->GPC['reputationid'])) {
        print_form_header('adminreputation', 'doeditreputation');
        print_table_header($vbphrase['edit_reputation']);
        print_label_row($vbphrase['thread'], $repinfo['title'] ? "<a href=\"" . fetch_seo_url('thread|bburl', $repinfo, array('p' => $repinfo['postid'])) . "#post{$repinfo['postid']}" . "\">{$repinfo['title']}</a>" : '');
        print_label_row($vbphrase['leftby'], $repinfo['whoadded_username']);
        print_label_row($vbphrase['leftfor'], $repinfo['username']);
        print_input_row($vbphrase['comment'], 'reputation[reason]', $repinfo['reason']);
        print_input_row($vbphrase['reputation'], 'reputation[reputation]', $repinfo['reputation'], 0, 5);
        construct_hidden_code('reputationid', $vbulletin->GPC['reputationid']);
        construct_hidden_code('oldreputation', $repinfo[reputation]);
        construct_hidden_code('userid', $repinfo['userid']);
        print_submit_row();
    } else {
        print_stop_message('no_matches_found');
    }
}
// *************************************************************************************************
if ($_POST['do'] == 'doeditreputation') {
    $vbulletin->input->clean_array_gpc('p', array('reputation' => TYPE_ARRAY, 'reputationid' => TYPE_INT, 'oldreputation' => TYPE_INT, 'userid' => TYPE_INT));
    $db->query_write(fetch_query_sql($vbulletin->GPC['reputation'], 'reputation', "WHERE reputationid=" . $vbulletin->GPC['reputationid']));
    if ($vbulletin->GPC['oldreputation'] != $vbulletin->GPC['reputation']['reputation']) {
        $diff = $vbulletin->GPC['oldreputation'] - $vbulletin->GPC['reputation']['reputation'];
        $user = fetch_userinfo($vbulletin->GPC['userid']);
Example #26
0
            verify_upload_folder($vbulletin->GPC['sigpicpath']);
            // update $vboptions
            $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET value =\n\t\t\t\tCASE varname\n\t\t\t\t\tWHEN 'avatarpath' THEN '" . $db->escape_string($vbulletin->GPC['avatarpath']) . "'\n\t\t\t\t\tWHEN 'avatarurl' THEN '" . $db->escape_string($vbulletin->GPC['avatarurl']) . "'\n\t\t\t\t\tWHEN 'profilepicpath' THEN '" . $db->escape_string($vbulletin->GPC['profilepicpath']) . "'\n\t\t\t\t\tWHEN 'profilepicurl' THEN '" . $db->escape_string($vbulletin->GPC['profilepicurl']) . "'\n\t\t\t\t\tWHEN 'sigpicpath' THEN '" . $db->escape_string($vbulletin->GPC['sigpicpath']) . "'\n\t\t\t\t\tWHEN 'sigpicurl' THEN '" . $db->escape_string($vbulletin->GPC['sigpicurl']) . "'\n\t\t\t\tELSE value END\n\t\t\t\tWHERE varname IN('avatarpath', 'avatarurl', 'profilepicurl', 'profilepicpath', 'sigpicurl', 'sigpicpath')\n\t\t\t");
            build_options();
            break;
    }
    // #############################################################################
    print_form_header('avatar', 'domoveavatar');
    print_table_header(construct_phrase($vbphrase['edit_storage_type'], "<span class=\"normal\">" . $vbphrase['user_pictures'] . "</span>"));
    construct_hidden_code('dowhat', $vbulletin->GPC['dowhat']);
    if ($vbulletin->GPC['dowhat'] == 'DB_to_FS') {
        print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_images_from_database_to_filesystem']);
    } else {
        print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_images_from_filesystem_to_database']);
    }
    print_input_row($vbphrase['number_of_users_to_process_per_cycle'], 'perpage', 300, 1, 5);
    print_submit_row($vbphrase['go']);
}
// ################### Move avatars ######################################
if ($_REQUEST['do'] == 'domoveavatar') {
    $vbulletin->input->clean_array_gpc('r', array('perpage' => TYPE_INT, 'startat' => TYPE_INT));
    if (is_demo_mode()) {
        print_cp_message('This function is disabled within demo mode');
    }
    if ($vbulletin->GPC['perpage'] < 1) {
        $vbulletin->GPC['perpage'] = 10;
    }
    if ($vbulletin->GPC['startat'] < 0) {
        $vbulletin->GPC['startat'] = 0;
    }
    if ($vbulletin->debug) {
Example #27
0
                $time_before = microtime();
                $db->query_write($query);
                $time_taken = fetch_microtime_difference($time_before);
                print_form_header('queries', 'doquery');
                print_table_header($vbphrase['vbulletin_message']);
                if ($errornum = $db->errno()) {
                    print_description_row(construct_phrase($vbphrase['an_error_occured_while_attempting_to_run_your_query'], $errornum, nl2br(htmlspecialchars_uni($db->error()))));
                } else {
                    print_description_row(construct_phrase($vbphrase['affected_rows'], vb_number_format($db->affected_rows()), vb_number_format($time_taken, 4)));
                }
                print_table_footer();
            }
            break;
    }
}
// ##################### START MODIFY #####################
if ($_REQUEST['do'] == 'modify') {
    print_form_header('queries', 'doquery');
    print_table_header($vbphrase['execute_sql_query']);
    print_select_row($vbphrase['auto_query'], 'autoquery', $queryoptions, -1);
    print_textarea_row($vbphrase['manual_query'], 'query', '', 10, 55);
    print_input_row($vbphrase['results_to_show_per_page'], 'perpage', 20);
    print_submit_row($vbphrase['continue']);
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 37230 $
|| ####################################################################
\*======================================================================*/
Example #28
0
             $type['mimetype'] = implode("\n", unserialize($type['mimetype']));
         }
         construct_hidden_code('extension', $type['extension']);
         print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['attachment_type'], $type['extension'], $type['extension']));
     }
 } else {
     $type = null;
 }
 if (!$type) {
     $type = array('enabled' => 1);
     print_table_header($vbphrase['add_new_extension']);
 }
 print_input_row($vbphrase['extension'], 'type[extension]', $type['extension']);
 print_input_row(construct_phrase($vbphrase['maximum_filesize_dfn']), 'type[size]', $type['size']);
 print_input_row($vbphrase['max_width_dfn'], 'type[width]', $type['width']);
 print_input_row($vbphrase['max_height_dfn'], 'type[height]', $type['height']);
 print_textarea_row($vbphrase['mime_type_dfn'], 'type[mimetype]', $type['mimetype']);
 ($hook = vBulletinHook::fetch_hook('admin_attachmenttype')) ? eval($hook) : false;
 $existing = @unserialize($type['contenttypes']);
 print_table_break();
 print_table_header($vbphrase['content_type'], 4);
 print_cells_row(array($vbphrase['product'], $vbphrase['location'], $vbphrase['new_window'], $vbphrase['enabled']), 1, 'tcat');
 $indexed_types = array();
 $collection = new vB_Collection_ContentType();
 $collection->filterAttachable(true);
 foreach ($collection as $type) {
     $value['package'] = $type->getPackageClass();
     $value['class'] = $type->getClass();
     $indexed_types[$type->getID()] = $value;
 }
 foreach ($indexed_types as $contenttypeid => $content) {
        // edit existing
        print_table_header($vbphrase['edit_social_bookmarking_site'] . " <span class=\"normal\">{$bookmarksite['title']}</span>");
        construct_hidden_code('bookmarksiteid', $bookmarksite['bookmarksiteid']);
    } else {
        // add new
        $bookmarksite = $vbulletin->db->query_first("SELECT MAX(displayorder) AS displayorder FROM " . TABLE_PREFIX . "bookmarksite");
        $bookmarksite['displayorder'] += 10;
        $bookmarksite['url'] = 'http://';
        $bookmarksite['active'] = true;
        $bookmarksite['utf8encode'] = false;
        print_table_header($vbphrase['add_new_social_bookmarking_site']);
    }
    print_input_row($vbphrase['title'], 'title', $bookmarksite['title'], false, 50);
    print_input_row($vbphrase['icon'] . '<dfn>' . $vbphrase['icon_bookmarksite_help'] . '</dfn>', 'iconpath', $bookmarksite['iconpath'], true, 50);
    print_input_row($vbphrase['link'] . '<dfn>' . $vbphrase['link_replacement_variables_help'] . '</dfn>', 'url', $bookmarksite['url'], true, 50);
    print_input_row($vbphrase['display_order'], 'displayorder', $bookmarksite['displayorder'], true, 2);
    print_yes_no_row($vbphrase['active'], 'active', $bookmarksite['active']);
    print_yes_no_row($vbphrase['utf8encode_title'] . '<dfn>' . $vbphrase['utf8encode_title_help'] . '</dfn>', 'utf8encode', $bookmarksite['utf8encode']);
    print_submit_row();
}
// #############################################################################
// quick update of active and display order fields
if ($_POST['do'] == 'quickupdate') {
    $vbulletin->input->clean_array_gpc('p', array('active' => TYPE_ARRAY_BOOL, 'displayorder' => TYPE_ARRAY_UINT, 'displayorderswap' => TYPE_CONVERT_KEYS));
    $changes = false;
    $update_ids = '0';
    $update_active = '';
    $update_displayorder = '';
    $bookmarksites_result = $db->query_read("SELECT bookmarksiteid, displayorder, active FROM " . TABLE_PREFIX . "bookmarksite");
    while ($bookmarksite = $db->fetch_array($bookmarksites_result)) {
        if (intval($bookmarksite['active']) != $vbulletin->GPC['active']["{$bookmarksite['bookmarksiteid']}"] or $bookmarksite['displayorder'] != $vbulletin->GPC['displayorder']["{$bookmarksite['bookmarksiteid']}"]) {
Example #30
0
}
// ############## ADD/EDIT GROUP SETTINGS FORM ###########################
if ($do == 'group_settings') {
    // check for existing plugin
    if (!array_key_exists($vbulletin->GPC['plugin'], $plugins)) {
        define('CP_REDIRECT', $this_script . '.php?do=list');
        print_stop_message('invalid_nntp_plugin_specified');
    }
    // load existing group
    $group_id = $vbulletin->GPC['group_id'];
    $nntp_group->get_group($group_id);
    print_form_header($this_script, 'set_group_settings');
    construct_hidden_code('plugin', $vbulletin->GPC['plugin']);
    construct_hidden_code('group_id', $nntp_group->get_group_id());
    print_table_header($vbphrase['nntp_set_group'], 2);
    print_input_row($vbphrase['nntp_group_name'], 'group_name', $nntp_group->get_group_name());
    ($hook = vBulletinHook::fetch_hook('nntp_gate_group_settings')) ? eval($hook) : false;
    $is_active = $nntp_group->get_is_active();
    if (is_null($is_active) || $is_active) {
        $is_active = 'yes';
    }
    print_yes_no_row($vbphrase['nntp_group_is_active'], 'is_active', 'yes' == $is_active);
    print_submit_row($vbphrase['save'], '', 2, $vbphrase['no']);
}
// ###################### Start Remove ###################################
if ($_REQUEST['do'] == 'remove_group') {
    // check for there is no groups mapped to this one
    //    admincp_check_for_mapped_groups( $vbulletin->GPC['group_id'] );
    print_form_header($this_script, 'kill_group');
    construct_hidden_code('group_id', $vbulletin->GPC['group_id']);
    print_table_header($vbphrase['confirm_deletion']);