Пример #1
0
function print_diagnostic_test_result($status, $reasons = array(), $exit = 1)
{
	// $status values = -1: indeterminate; 0: failed; 1: passed
	// $reasons a list of reasons why the test passed/failed
	// $exit values = 0: continue execution; 1: stop here
	global $vbphrase;

	print_form_header('', '');

	print_table_header($vbphrase['results']);

	if (is_array($reasons))
	{
		foreach ($reasons AS $reason)
		{
			print_description_row($reason);
		}
	}
	else if (!empty($reasons))

	{
		print_description_row($reasons);
	}

	print_table_footer();

	if ($exit == 1)
	{
		print_cp_footer();
	}
}
Пример #2
0
function print_statistic_code($title, $name, $start, $end, $nullvalue = true, $scope = 'daily', $sort = 'date_desc')
{

	global $vbphrase;

	print_form_header('stats', $name);
	print_table_header($title);

	print_time_row($vbphrase['start_date'], 'start', $start, false);
	print_time_row($vbphrase['end_date'], 'end', $end, false);

	if ($name != 'activity')
	{
		print_select_row($vbphrase['scope'], 'scope', array('daily' => $vbphrase['daily'], 'weekly' => $vbphrase['weekly'], 'monthly' => $vbphrase['monthly']), $scope);
	}
	else
	{
		construct_hidden_code('scope', 'daily');
	}
	print_select_row($vbphrase['order_by'], 'sort', array(
		'date_asc'   => $vbphrase['date_ascending'],
		'date_desc'  => $vbphrase['date_descending'],
		'total_asc'  => $vbphrase['total_ascending'],
		'total_desc' => $vbphrase['total_descending'],
	), $sort);
	print_yes_no_row($vbphrase['include_empty_results'], 'nullvalue', $nullvalue);
	print_submit_row($vbphrase['go']);
}
Пример #3
0
function kbank_print_form_header($phpscript = '', $do = '', $uploadform = false, $addtable = true, $name = 'cpform', $width = '90%', $target = '', $echobr = true, $method = 'post', $cellspacing = 0)
{
    global $vbulletin, $tableadded;
    if (VB_AREA == 'AdminCP') {
        //back-end
        print_form_header($phpscript, $do, $uploadform, $addtable, $name, $width, $target, $echobr, $method, $cellspacing);
    } else {
        //font-end
        print_form_header($phpscript, $do, $uploadform, $addtable, $name, '100%', $target, $echobr, $method, $cellspacing);
    }
}
Пример #4
0
		}
	}
	print_table_footer();
}

// ###################### Start viewing resources for specific user ########################
if ($_REQUEST['do'] == 'viewuser')
{
	$userinfo = fetch_userinfo($vbulletin->GPC['userid']);
	if (!$userinfo)
	{
		print_stop_message('invalid_user_specified');
	}
	$perms = cache_permissions($userinfo);

	print_form_header('', '');
	print_table_header($userinfo['username'] . " <span class=\"normal\">(userid: $userinfo[userid])</span>");

	foreach ($userinfo['forumpermissions'] AS $forumid => $forumperms)
	{
		print_table_header($vbulletin->forumcache["$forumid"]['title'] . " <span class=\"normal\">(forumid: $forumid)</span>");
		foreach ($vbulletin->bf_ugp_forumpermissions AS $key => $val)
		{

			if (bitwise($userinfo['forumpermissions']["$forumid"], $val))
			{
				print_label_row($bitfieldnames["$val"], '<b>' . $vbphrase['yes'] . '</b>');
			}
			else
			{
				print_label_row($bitfieldnames["$val"], '<b>' . $vbphrase['no'] . '</b>');
Пример #5
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 $
|| ####################################################################
\*======================================================================*/
Пример #6
0
        $userdm->set('reputation', $user['reputation'] - $repinfo['reputation']);
        $userdm->save();
        unset($userdm);
    }
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "reputation\n\t\tWHERE reputationid = " . $vbulletin->GPC['reputationid']);
    define('CP_REDIRECT', "adminreputation.php?do=list&amp;u={$repinfo['userid']}");
    print_stop_message('deleted_reputation_successfully');
}
// *************************************************************************************************
if ($_REQUEST['do'] == 'deletereputation') {
    $vbulletin->input->clean_array_gpc('r', array('reputationid' => TYPE_INT));
    print_delete_confirmation('reputation', $vbulletin->GPC['reputationid'], 'adminreputation', 'killreputation');
}
if ($_REQUEST['do'] == 'modify') {
    $reputationlevels = $db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "reputationlevel\n\t\tORDER BY minimumreputation\n\t");
    print_form_header('adminreputation', 'updateminimums');
    print_table_header($vbphrase['user_reputation_manager'], 3);
    print_cells_row(array($vbphrase['reputation_level'], $vbphrase['minimum_reputation_level'], $vbphrase['controls']), 1);
    while ($reputationlevel = $db->fetch_array($reputationlevels)) {
        $reputationlevel['level'] = htmlspecialchars_uni($vbphrase['reputation' . $reputationlevel['reputationlevelid']]);
        $cell = array();
        $cell[] = "{$vbphrase['user']} <b>{$reputationlevel['level']}</b>";
        $cell[] = "<input type=\"text\" class=\"bginput\" tabindex=\"1\" name=\"reputation[{$reputationlevel['reputationlevelid']}]\" value=\"{$reputationlevel['minimumreputation']}\" size=\"5\" />";
        $cell[] = construct_link_code($vbphrase['edit'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&reputationlevelid={$reputationlevel['reputationlevelid']}") . construct_link_code($vbphrase['delete'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=remove&minimumreputation={$reputationlevel['minimumreputation']}");
        print_cells_row($cell);
    }
    print_submit_row($vbphrase['update'], $vbphrase['reset'], 3);
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
Пример #7
0
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();
    }
    $db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "infractionban\n\t\tSET amount = " . $vbulletin->GPC['amount'] . ",\n\t\t\tmethod = '" . $db->escape_string($vbulletin->GPC['method']) . "',\n\t\t\tusergroupid = " . $vbulletin->GPC['usergroupid'] . ",\n\t\t\tbanusergroupid = " . $vbulletin->GPC['banusergroupid'] . ",\n\t\t\tperiod = '" . $db->escape_string($vbulletin->GPC['period']) . "'\n\t\tWHERE infractionbanid = " . $vbulletin->GPC['infractionbanid'] . "\n\t");
    define('CP_REDIRECT', 'admininfraction.php?do=modify');
    print_stop_message('saved_automatic_ban_successfully');
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'removebangroup') {
    print_form_header('admininfraction', 'killbangroup');
    construct_hidden_code('infractionbanid', $vbulletin->GPC['infractionbanid']);
    print_table_header(construct_phrase($vbphrase['confirm_deletion_x'], $vbphrase['automatic_ban']));
    print_description_row($vbphrase['are_you_sure_you_want_to_delete_this_automatic_ban']);
    print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'killbangroup') {
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "infractionban WHERE infractionbanid = " . $vbulletin->GPC['infractionbanid']);
    define('CP_REDIRECT', 'admininfraction.php?do=modify');
    print_stop_message('deleted_automatic_ban_successfully');
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
Пример #8
0
}
// ########################################################################
if ($_REQUEST['do'] == 'list') {
    $prefixsets_sql = $db->query_read("\r\n\t\tSELECT *\r\n\t\tFROM " . TABLE_PREFIX . "prefixset\r\n\t\tORDER BY displayorder\r\n\t");
    $prefixsets = array();
    while ($prefixset = $db->fetch_array($prefixsets_sql)) {
        $prefixsets["{$prefixset['prefixsetid']}"] = $prefixset;
        $prefixsets["{$prefixset['prefixsetid']}"]['prefixes'] = array();
    }
    $prefixes_sql = $db->query_read("\r\n\t\tSELECT *\r\n\t\tFROM " . TABLE_PREFIX . "prefix\r\n\t\tORDER BY displayorder\r\n\t");
    while ($prefix = $db->fetch_array($prefixes_sql)) {
        if (isset($prefixsets["{$prefix['prefixsetid']}"])) {
            $prefixsets["{$prefix['prefixsetid']}"]['prefixes']["{$prefix['prefixid']}"] = $prefix;
        }
    }
    print_form_header('prefix', 'displayorder');
    print_table_header($vbphrase['thread_prefixes'], 3);
    ?>
	<script type="text/javascript">
	<!--
	function selectprefixes(prefixset)
	{
		var els = YAHOO.util.Dom.getElementsByClassName(prefixset);

		var toggle = document.getElementById(prefixset);

		for (var i = 0; i < els.length; i++)
		{
			els[i].checked = toggle.checked;
		}
Пример #9
0
    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();
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:56, Sat Oct 11th 2008
|| # CVS: $RCSfile$ - $Revision: 25308 $
Пример #10
0
        }
    }
    // end if ($languageid != 0)
    // ***********************
}
// ##########################################################################
if ($_REQUEST['do'] == 'modify') {
    /*
    $typeoptions = array();
    $phrasetypes = fetch_phrasetypes_array();
    foreach($phrasetypes AS $fieldname => $type)
    {
    	$typeoptions["$fieldname"] = construct_phrase($vbphrase['x_phrases'], $type['title']);
    }
    */
    print_form_header('language', 'add');
    construct_hidden_code('goto', "language.php?" . $vbulletin->session->vars['sessionurl']);
    print_table_header($vbphrase['language_manager'], 4);
    print_cells_row(array($vbphrase['language'], '', '', $vbphrase['default']), 1);
    if ($vbulletin->debug) {
        print_language_row(array('languageid' => -1, 'title' => "<i>{$vbphrase['master_language']}</i>"));
    }
    $languages = fetch_languages_array();
    foreach ($languages as $_languageid => $language) {
        print_language_row($language);
    }
    print_description_row(construct_link_code($vbphrase['search_phrases'], "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=search") . construct_link_code($vbphrase['view_quickref'], "javascript:js_open_phrase_ref(0,0);") . construct_link_code($vbphrase['rebuild_all_languages'], "language.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild&amp;goto=language.php?" . $vbulletin->session->vars['sessionurl']), 0, 4, 'thead" style="text-align:center; font-weight:normal');
    print_table_footer(4, '
		<input type="submit" class="button" value="' . $vbphrase['add_new_language'] . '" tabindex="1" />
		<input type="button" class="button" value="' . $vbphrase['download_upload_language'] . '" tabindex="1" onclick="window.location=\'language.php?do=files\';" />
	');
Пример #11
0
         } else {
             $color = 'red';
         }
         print_description_row('<table width="100%" border="0"><tr><td width="22%"><font color="' . $color . '">' . $template_phrases[$template['id'] . "_" . $template['varname'] . "_subject"] . '</font></td><td width="29%">' . date("m-d-Y h:i:s A", $campaign['send_when']) . '</td><td width="8%">' . $sent . '</td><td width="8%">' . $failed . '</td><td width="15%">' . $unique_reads . '</td><td width="12%"><a href="qhvbmailer.php?do=manage_campaigns&act=2&campaign_id=' . $campaign['id'] . '">Full Stats</a></td><td width="8%"><a href="qhvbmailer.php?do=manage_campaigns&act=3&campaign_id=' . $campaign['id'] . '">Delete</a></tr></table>');
     }
     print_submit_row('Refresh', '');
 } elseif ($_GET['act'] == 2) {
     $vbulletin->input->clean_array_gpc('g', array('campaign_id' => TYPE_UINT));
     $campaign_id = $vbulletin->GPC['campaign_id'];
     if ($campaign_id > 0) {
         $sent = countTracks($campaign_id, 'sent');
         $failed = countTracks($campaign_id, 'failed');
         $unqread = countTracks($campaign_id, 'unique_read');
         $read = countTracks($campaign_id, 'read');
         $links = countTracks($campaign_id, 'link');
         print_form_header('qhvbmailer', 'manage_campaigns');
         print_table_header('Campaign Statistics');
         if (file_exists(DIR . '/includes/charts/chart.php')) {
             print_description_row('<center>' . InsertChart('../includes/charts/charts.swf', '../includes/charts/charts_library', '../includes/charts/chart.php?sent=' . $sent . '&failed=' . $failed . '&unqread=' . $unqread . '&read=' . $read . '&links=' . $links, 400, 320, 'FFFFFF', true) . '</center>');
         } else {
             print_cp_message('No charts file!', 'qhvbmailer.php?do=manage_campaigns', 2);
         }
         print_submit_row('Back', '');
     } else {
         print_cp_message('Campaign ID must be greater than zero!', 'qhvbmailer.php?do=manage_campaigns', 2);
     }
 } elseif ($_GET['act'] == 3) {
     $vbulletin->input->clean_array_gpc('g', array('campaign_id' => TYPE_UINT));
     if ($vbulletin->GPC['campaign_id'] > 0) {
         $db->query_write("DELETE FROM " . TABLE_PREFIX . "qhvbmailer_campaigns WHERE id='" . $vbulletin->GPC['campaign_id'] . "'");
         print_cp_message('Campaign deleted!', 'qhvbmailer.php?do=manage_campaigns', 1);
Пример #12
0
				<select name="movegroup" tabindex="1" class="bginput">' . $groupslist . '</select></b>
				</span></center>', 0, 7);
            print_submit_row($vbphrase['go'], $vbphrase['check_all'], 7);
            echo '<p>' . $vbphrase['this_action_is_not_reversible'] . '</p>';
        } else {
            define('CP_REDIRECT', "user.php?do=prune" . "&usergroupid=" . $vbulletin->GPC['usergroupid'] . "&daysprune=" . $vbulletin->GPC['daysprune'] . "&joindateunix={$joindateunix}" . "&minposts=" . $vbulletin->GPC['minposts']);
            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']);
Пример #13
0
    while ($user = $db->fetch_array($users)) {
        $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 $
|| ####################################################################
Пример #14
0
        print_form_header('', '');
        print_table_header($upgradecode_phrases['vb_database_backup_system']);
        print_description_row($upgradecore_phrases['dump_database_desc']);
        print_table_footer();
        $sqltable = array('all tables' => $upgradecore_phrases['dump_all_tables']);
        $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 ############
Пример #15
0
 }
 // check that this usergroup has some join requests
 if ($vbulletin->usergroupcache["{$vbulletin->GPC['usergroupid']}"]['joinrequests']) {
     // everything seems okay, so make a total record for this usergroup
     $usergroup =& $vbulletin->usergroupcache["{$vbulletin->GPC['usergroupid']}"];
     // query the usergroup leaders of this usergroup
     $leaders = array();
     $getleaders = $db->query_read("\n\t\t\t\tSELECT usergroupleader.userid, user.username\n\t\t\t\tFROM " . TABLE_PREFIX . "usergroupleader AS usergroupleader\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\t\t\tWHERE usergroupleader.usergroupid = " . $vbulletin->GPC['usergroupid'] . "\n\t\t\t");
     while ($getleader = $db->fetch_array($getleaders)) {
         $leaders[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$getleader['userid']}\">{$getleader['username']}</a>";
     }
     unset($getleader);
     $db->free_result($getleaders);
     // query the requests for this usergroup
     $requests = $db->query_read("\n\t\t\t\tSELECT req.*, user.username\n\t\t\t\tFROM " . TABLE_PREFIX . "usergrouprequest AS req\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\t\t\tWHERE req.usergroupid = " . $vbulletin->GPC['usergroupid'] . "\n\t\t\t\tORDER BY user.username\n\t\t\t");
     print_form_header('usergroup', 'processjoinrequests');
     construct_hidden_code('usergroupid', $vbulletin->GPC['usergroupid']);
     print_table_header("{$usergroup['title']} - ({$vbphrase['join_requests']}: {$usergroup['joinrequests']})", 6);
     if (!empty($leaders)) {
         print_description_row("<span style=\"font-weight:normal\">(" . $vbphrase['usergroup_leader'] . ': ' . implode(', ', $leaders) . ')</span>', 0, 6, 'thead');
     }
     print_cells_row(array($vbphrase['username'], $vbphrase['reason'], '<span style="white-space:nowrap">' . $vbphrase['date'] . '</span>', '<input type="button" value="' . $vbphrase['accept'] . '" onclick="js_check_all_option(this.form, 1);" class="button" title="' . $vbphrase['check_all'] . '" />', '<input type="button" value=" ' . $vbphrase['deny'] . ' " onclick="js_check_all_option(this.form, 0);" class="button" title="' . $vbphrase['check_all'] . '" />', '<input type="button" value="' . $vbphrase['ignore'] . '" onclick="js_check_all_option(this.form, -1);" class="button" title="' . $vbphrase['check_all'] . '" />'), 1);
     $i = 0;
     while ($request = $db->fetch_array($requests)) {
         if ($i > 0 and $i % 10 == 0) {
             print_description_row('<div align="center"><input type="submit" class="button" value="' . $vbphrase['process'] . '" accesskey="s" tabindex="1" /></div>', 0, 6, 'thead');
         }
         $i++;
         $cell = array("<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$request['userid']}\"><b>{$request['username']}</b></a>", $request['reason'], '<span class="smallfont">' . vbdate($vbulletin->options['dateformat'], $request['dateline']) . '<br />' . vbdate($vbulletin->options['timeformat'], $request['dateline']) . '</span>', '<label for="a' . $request['usergrouprequestid'] . '" class="smallfont">' . $vbphrase['accept'] . '<input type="radio" name="request[' . $request['usergrouprequestid'] . ']" value="1" id="a' . $request['usergrouprequestid'] . '" tabindex="1" /></label>', '<label for="d' . $request['usergrouprequestid'] . '" class="smallfont">' . $vbphrase['deny'] . '<input type="radio" name="request[' . $request['usergrouprequestid'] . ']" value="0" id="d' . $request['usergrouprequestid'] . '" tabindex="1" /></label>', '<label for="i' . $request['usergrouprequestid'] . '" class="smallfont">' . $vbphrase['ignore'] . '<input type="radio" name="request[' . $request['usergrouprequestid'] . ']" value="-1" id="i' . $request['usergrouprequestid'] . '" tabindex="1" checked="checked" /></label>');
         print_cells_row($cell, 0, '', -5);
     }
Пример #16
0
/**
* Processes a raw template for conditionals, phrases etc into PHP code for eval()
*
* @param	string	Template
*
* @return	string
*/
function compile_template($template)
{
    $orig_template = $template;
    $template = addslashes($template);
    $template = process_template_conditionals($template);
    $template = process_template_phrases('phrase', $template, 'parse_phrase_tag');
    if (!function_exists('replace_template_variables')) {
        require_once DIR . '/includes/functions_misc.php';
    }
    $template = replace_template_variables($template, false);
    ($hook = vBulletinHook::fetch_hook('template_compile')) ? eval($hook) : false;
    $template = str_replace('\\\\$', '\\$', $template);
    if (function_exists('token_get_all')) {
        $tokens = @token_get_all('<?php $var = "' . $template . '"; ?>');
        foreach ($tokens as $token) {
            if (is_array($token)) {
                switch ($token[0]) {
                    case T_INCLUDE:
                    case T_INCLUDE_ONCE:
                    case T_REQUIRE:
                    case T_REQUIRE_ONCE:
                        global $vbphrase;
                        echo "<p>&nbsp;</p><p>&nbsp;</p>";
                        print_form_header('', '', 0, 1, '', '65%');
                        print_table_header($vbphrase['vbulletin_message']);
                        print_description_row($vbphrase['file_inclusion_not_permitted']);
                        print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)'));
                        print_cp_footer();
                        exit;
                }
            }
        }
    }
    if (function_exists('verify_demo_template')) {
        verify_demo_template($template);
    }
    return $template;
}
Пример #17
0
        $vbulletin->GPC['rgb'] = preg_split('#\\s*,\\s*#si', $vbulletin->GPC['rgb'], -1, PREG_SPLIT_NO_EMPTY);
        $vbulletin->GPC['hex'] = '#';
        foreach ($vbulletin->GPC['rgb'] as $i => $value) {
            $vbulletin->GPC['hex'] .= strtoupper(str_pad(dechex($value), 2, '0', STR_PAD_LEFT));
        }
        $vbulletin->GPC['rgb'] = implode(',', $vbulletin->GPC['rgb']);
    } else {
        if ($vbulletin->GPC['hexdec']) {
            if (preg_match('/#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/siU', $vbulletin->GPC['hex'], $matches)) {
                $vbulletin->GPC['rgb'] = array();
                for ($i = 1; $i <= 3; $i++) {
                    $vbulletin->GPC['rgb'][] = hexdec($matches["{$i}"]);
                }
                $vbulletin->GPC['rgb'] = implode(',', $vbulletin->GPC['rgb']);
                $vbulletin->GPC['hex'] = strtoupper("#{$matches['1']}{$matches['2']}{$matches['3']}");
            }
        }
    }
    print_form_header('template', 'colorconverter');
    print_table_header('Color Converter');
    print_label_row('Hexadecimal Color (#xxyyzz)', "<span style=\"padding:4px; background-color:" . $vbulletin->GPC['hex'] . "\"><input type=\"text\" class=\"bginput\" name=\"hex\" value=\"" . $vbulletin->GPC['hex'] . "\" size=\"20\" maxlength=\"7\" /> <input type=\"submit\" class=\"button\" name=\"hexdec\" value=\"Hex &raquo; RGB\" /></span>");
    print_label_row('RGB Color (r,g,b)', "<span style=\"padding:4px; background-color:rgb(" . $vbulletin->GPC['rgb'] . ")\"><input type=\"text\" class=\"bginput\" name=\"rgb\" value=\"" . $vbulletin->GPC['rgb'] . "\" size=\"20\" maxlength=\"11\" /> <input type=\"submit\" class=\"button\" name=\"dechex\" value=\"RGB &raquo; Hex\" /></span>");
    print_table_footer();
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 22:41, Fri Oct 10th 2008
|| # CVS: $RCSfile$ - $Revision: 27113 $
|| ####################################################################
\*======================================================================*/
Пример #18
0
            // #############################################################################
            // move userpics from database to filesystem
        // #############################################################################
        // move userpics from database to filesystem
        case 'DB_to_FS':
            // check path is valid
            verify_upload_folder($vbulletin->GPC['avatarpath']);
            verify_upload_folder($vbulletin->GPC['profilepicpath']);
            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');
Пример #19
0
    }
    echo "</div>\n";
    echo "</td>\n</tr>\n";
    if (!empty($modlist)) {
        print_table_footer(1, $vbphrase['total'] . ": <b>" . count($modlist) . "</b>");
    } else {
        print_table_footer();
    }
}
// ###################### Start Remove moderator from all forums #######################
if ($_REQUEST['do'] == 'removeall') {
    $modinfo = $db->query_first("\n\t\tSELECT username FROM " . TABLE_PREFIX . "moderator AS moderator\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\tWHERE moderator.userid = " . $vbulletin->GPC['userid'] . "\n\t");
    if (!$modinfo) {
        print_stop_message('user_no_longer_moderator');
    }
    print_form_header('moderator', 'killall', 0, 1, '', '75%');
    construct_hidden_code('userid', $vbulletin->GPC['userid']);
    print_table_header($vbphrase['confirm_deletion']);
    print_description_row('<blockquote><br />' . $vbphrase['are_you_sure_you_want_to_delete_this_moderator'] . "<br /></blockquote>\n\t");
    print_submit_row($vbphrase['yes'], 0, 2, $vbphrase['no']);
}
// ###################### Start Kill moderator from all forums #######################
if ($_POST['do'] == 'killall') {
    if (empty($vbulletin->GPC['userid'])) {
        print_stop_message('invalid_users_specified');
    }
    $getuserid = $db->query_first("\n\t\tSELECT user.*,\n\t\tIF (user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid\n\t\tFROM " . TABLE_PREFIX . "moderator AS moderator\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\tWHERE moderator.userid = " . $vbulletin->GPC['userid'] . "\n\t\t\tAND forumid <> -1\n\t");
    if (!$getuserid) {
        print_stop_message('user_no_longer_moderator');
    } else {
        ($hook = vBulletinHook::fetch_hook('admin_moderator_killall')) ? eval($hook) : false;
Пример #20
0
    $vbulletin->GPC['type']['contenttypes'] = serialize($contenttypes);
    define('CP_REDIRECT', 'attachment.php?do=types');
    if ($vbulletin->GPC['extension']) {
        $db->query_write(fetch_query_sql($vbulletin->GPC['type'], 'attachmenttype', 'WHERE extension = \'' . $db->escape_string($vbulletin->GPC['extension']) . '\''));
        build_attachment_permissions();
    } else {
        /*insert query*/
        $db->query_write("\n\t\t\tINSERT INTO " . TABLE_PREFIX . "attachmenttype\n\t\t\t(\n\t\t\t\textension,\n\t\t\t\tsize,\n\t\t\t\theight,\n\t\t\t\twidth,\n\t\t\t\tmimetype,\n\t\t\t\tcontenttypes\n\t\t\t)\n\t\t\tVALUES\n\t\t\t(\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['type']['extension']) . "',\n\t\t\t\t" . intval($vbulletin->GPC['type']['size']) . ",\n\t\t\t\t" . intval($vbulletin->GPC['type']['height']) . ",\n\t\t\t\t" . intval($vbulletin->GPC['type']['width']) . ",\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['type']['mimetype']) . "',\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['type']['contenttype']) . "'\n\t\t\t)\n\t\t");
        build_attachment_permissions();
    }
    print_stop_message('saved_attachment_type_x_successfully', $vbulletin->GPC['type']['extension']);
}
// ###################### Remove File Type ####################
if ($_REQUEST['do'] == 'removetype') {
    $vbulletin->input->clean_array_gpc('r', array('extension' => TYPE_STR));
    print_form_header('attachment', 'killtype', 0, 1, '', '75%');
    construct_hidden_code('extension', $vbulletin->GPC['extension']);
    print_table_header(construct_phrase($vbphrase['confirm_deletion_of_attachment_type_x'], $vbulletin->GPC['extension']));
    print_description_row("\n\t\t<blockquote><br />" . construct_phrase($vbphrase['are_you_sure_you_want_to_delete_the_attachment_type_x'], $vbulletin->GPC['extension']) . "\n\t\t<br /></blockquote>\n\t");
    print_submit_row($vbphrase['yes'], 0, 2, $vbphrase['no']);
}
// ###################### Kill File Type ####################
if ($_POST['do'] == 'killtype') {
    $vbulletin->input->clean_array_gpc('r', array('extension' => TYPE_STR));
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "attachmenttype\n\t\tWHERE extension = '" . $db->escape_string($vbulletin->GPC['extension']) . "'\n\t");
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "attachmentpermission\n\t\tWHERE extension = '" . $db->escape_string($vbulletin->GPC['extension']) . "'\n\t");
    build_attachment_permissions();
    define('CP_REDIRECT', 'attachment.php?do=types');
    print_stop_message('deleted_attachment_type_successfully');
}
print_cp_footer();
Пример #21
0
     print_stop_message('invalid_product_version');
 }
 if ($vbulletin->GPC['editing']) {
     $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
Пример #22
0
// #############################################################################
// ask user if they want to change a setting that is causing some of the CP login issues
if ($vbulletin->GPC['step'] == 3) {
    $vbulletin->input->clean_array_gpc('p', array('settingconfirm' => TYPE_UINT, 'disablesetting' => TYPE_UINT));
    if ($vbulletin->GPC['settingconfirm'] == 1) {
        echo '<p>';
        if ($vbulletin->GPC['disablesetting'] == 1) {
            $db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value=0 WHERE varname='timeoutcontrolpanel'");
            echo $upgrade_phrases['upgrade_300b5.php']['disabled_timeout_admin'];
        } else {
            echo $upgrade_phrases['upgrade_300b5.php']['timeout_admin_not_changed'];
        }
        echo '</p>';
    } else {
        if ($vbulletin->options['timeoutcontrolpanel'] == 1) {
            print_form_header('upgrade_300b5', '');
            construct_hidden_code('step', $vbulletin->GPC['step']);
            construct_hidden_code('settingconfirm', 1);
            print_table_header($upgrade_phrases['upgrade_300b5.php']['change_setting_value']);
            print_yes_no_row($upgrade_phrases['upgrade_300b5.php']['setting_info'], 'disablesetting', 0);
            print_submit_row($upgrade_phrases['upgrade_300b5.php']['proceed'], '');
            print_cp_footer();
        } else {
            echo "<p>{$upgrade_phrases['upgrade_300b5.php']['no_change_needed']}</p>";
        }
    }
}
// #############################################################################
// FINAL step (notice the SCRIPTCOMPLETE define)
if ($vbulletin->GPC['step'] == 4) {
    // tell log_upgrade_step() that the script is done
Пример #23
0
		{
			case 'edit': window.location = "usertitle.php?<?php 
    echo vB::getCurrentSession()->get('sessionurl_js');
    ?>
do=edit&usertitleid=" + usertitleid; break;
			case 'kill': window.location = "usertitle.php?<?php 
    echo vB::getCurrentSession()->get('sessionurl_js');
    ?>
do=remove&usertitleid=" + usertitleid; break;
			default: return false; break;
		}
	}
	</script>
	<?php 
    $options = array('edit' => $vbphrase['edit'], 'kill' => $vbphrase['delete']);
    print_form_header('usertitle', 'add');
    print_table_header($vbphrase['user_title_manager_gcpuser'], 3);
    print_description_row('<p>' . construct_phrase($vbphrase['it_is_recommended_that_you_update_user_titles'], vB::getCurrentSession()->get('sessionurl')) . '</p>', 0, 3);
    print_cells_row(array($vbphrase['user_title_guser'], $vbphrase['minimum_posts'], $vbphrase['controls']), 1);
    foreach ($usertitles as $usertitle) {
        print_cells_row(array('<b>' . $usertitle['title'] . '</b>', $usertitle['minposts'], "\n\t<select name=\"u{$usertitle['usertitleid']}\" onchange=\"js_usergroup_jump({$usertitle['usertitleid']}, this);\" class=\"bginput\">\n" . construct_select_options($options) . "\t</select>\n\t<input type=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_usergroup_jump({$usertitle['usertitleid']}, this.form.u{$usertitle['usertitleid']});\" />\n\t"));
    }
    print_submit_row($vbphrase['add_new_user_title_gcpuser'], 0, 3);
}
print_cp_footer();
/*=========================================================================*\
|| #######################################################################
|| # Downloaded: 15:45, Tue Sep 8th 2015
|| # CVS: $RCSfile$ - $Revision: 83432 $
|| #######################################################################
\*=========================================================================*/
Пример #24
0
	function updatetemplate_print_error_page($template_un, $error)
	{
		global $vbulletin, $vbphrase;
		print_form_header('template', 'updatetemplate', 0, 1, '', '75%');
		construct_hidden_code('confirmerrors', 1);
		construct_hidden_code('title', $vbulletin->GPC['title']);
		construct_hidden_code('template', $template_un);
		construct_hidden_code('templateid', $vbulletin->GPC['templateid']);
		construct_hidden_code('group', $vbulletin->GPC['group']);
		construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']);
		construct_hidden_code('dostyleid', $vbulletin->GPC['dostyleid']);
		construct_hidden_code('product', $vbulletin->GPC['product']);
		construct_hidden_code('savehistory', intval($vbulletin->GPC['savehistory']));
		construct_hidden_code('histcomment', $vbulletin->GPC['histcomment']);
		print_table_header($vbphrase['vbulletin_message']);
		print_description_row($error);
		print_submit_row($vbphrase['continue'], 0, 2, $vbphrase['go_back']);
		print_cp_footer();
	}
Пример #25
0
		$permusers = $db->query_read("
			SELECT user.userid, user.username, user.usergroupid AS busergroupid,
				userban.usergroupid AS ousergroupid,
				IF(userban.displaygroupid = 0, userban.usergroupid, userban.displaygroupid) AS odisplaygroupid,
				bandate, liftdate, reason,
				adminuser.userid AS adminid, adminuser.username AS adminname
			FROM " . TABLE_PREFIX . "user AS user
			LEFT JOIN " . TABLE_PREFIX . "userban AS userban ON(userban.userid = user.userid)
			LEFT JOIN " . TABLE_PREFIX . "user AS adminuser ON(adminuser.userid = userban.adminid)
			WHERE user.usergroupid IN(" . implode(',', array_keys($querygroups)) . ")
				AND (userban.liftdate = 0 OR userban.liftdate = NULL)
			ORDER BY user.username
			LIMIT $start, $perpage
		");

		print_form_header('banning', 'banuser');
		construct_hidden_code('period', 'PERMANENT');
		print_table_header("$vbphrase[banned_users]: $vbphrase[permanent_ban] <span class=\"normal\">$vbphrase[usergroups]: " . implode(', ', $querygroups) . '</span>', 8);
		if ($pagecount > 1)
		{
			$pagenav = "<strong>$vbphrase[go_to_page]</strong>";
			for ($thispage = 1; $thispage <= $pagecount; $thispage++)
			{
				if ($thispage == $vbulletin->GPC['pagenumber'])
				{
					$pagenav .= " <strong>[$thispage]</strong> ";
				}
				else
				{
					$pagenav .= " <a href=\"banning.php?$session[sessionurl]do=modify&amp;page=$thispage\" class=\"normal\">$thispage</a> ";
				}
Пример #26
0
    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']);
    print_description_row($vbphrase['nntp_are_you_sure_you_want_to_delete_this_group']);
    print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);
}
// ###################### Start Kill #####################################
if ($_REQUEST['do'] == 'kill_group') {
    $group_id = $vbulletin->GPC['group_id'];
    define('CP_REDIRECT', $this_script . '.php?do=list');
    if ($nntp_group->delete_group($group_id)) {
        print_stop_message('nntp_group_deleted_successfully');
    } else {
        print_stop_message('nntp_group_deleted_defeated');
    }
}
Пример #27
0
                $_languageid = $db->insert_id();
                $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\t\tSET value = " . $_languageid . "\n\t\t\tWHERE varname = 'languageid'\n\t\t");
                $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\tSET languageid = 0\n\t\t");
                build_options();
                build_language($_languageid);
                build_language_datastore();
                define('SCRIPT_REDIRECT', true);
            } else {
                $sellanguages = array();
                while ($language = $db->fetch_array($languages)) {
                    $sellanguages[$language['languageid']] = $language['title'];
                }
                $languageids = implode(',', array_keys($sellanguages));
                $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\tSET languageid = 0\n\t\t\tWHERE languageid NOT IN ({$languageids})\n\t\t");
                if (empty($vbulletin->GPC['languageid'])) {
                    print_form_header('tools', 'language');
                    print_table_header('Select the new default language');
                    print_select_row('Language', 'languageid', $sellanguages, $vbulletin->options['languageid']);
                    print_submit_row('Submit', '');
                } else {
                    $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\t\t\tSET value = " . $vbulletin->GPC['languageid'] . "\n\t\t\t\tWHERE varname = 'languageid'\n\t\t\t");
                    build_options();
                    build_language($vbulletin->GPC['languageid']);
                    build_language_datastore();
                    define('SCRIPT_REDIRECT', true);
                }
            }
        }
    }
}
if (defined('SCRIPT_REDIRECT')) {
Пример #28
0
/**
* Halts execution and shows the specified message
*
* @param	string	Message to display
* @param	mixed	If specified, a redirect will be performed to the URL in this parameter
* @param	integer	If redirect is specified, this is the time in seconds to delay before redirect
* @param	string	If specified, will provide a specific URL for "Go Back". If empty, no button will be displayed!
* @param bool		If true along with redirect, 'CONTINUE' button will be used instead of automatic redirect
*/
function print_cp_message($text = '', $redirect = NULL, $delay = 1, $backurl = NULL, $continue = false)
{
    global $vbulletin, $vbphrase;
    if ($redirect and $vbulletin->session->vars['sessionurl']) {
        if (strpos($redirect, '?') === false) {
            $redirect .= '?';
        }
        $redirect .= '&' . $vbulletin->session->vars['sessionurl'];
    }
    if (!defined('DONE_CPHEADER')) {
        print_cp_header($vbphrase['vbulletin_message']);
    }
    echo '<p>&nbsp;</p><p>&nbsp;</p>';
    print_form_header('', '', 0, 1, 'messageform', '65%');
    print_table_header($vbphrase['vbulletin_message']);
    print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>");
    if ($redirect and $redirect !== NULL) {
        // redirect to the new page
        if ($continue) {
            $continueurl = str_replace('&amp;', '&', $redirect);
            print_table_footer(2, construct_button_code($vbphrase['continue'], create_full_url($continueurl)));
        } else {
            print_table_footer();
            $redirect_click = create_full_url($redirect);
            $redirect_click = str_replace('"', '', $redirect_click);
            echo '<p align="center" class="smallfont">' . construct_phrase($vbphrase['if_you_are_not_automatically_redirected_click_here_x'], $redirect_click) . "</p>\n";
            print_cp_redirect($redirect, $delay);
        }
    } else {
        // end the table and halt
        if ($backurl === NULL) {
            $backurl = 'javascript:history.back(1)';
        }
        if (strpos($backurl, 'history.back(') !== false) {
            //if we are attempting to run a history.back(1), check we have a history to go back to, otherwise attempt to close the window.
            $back_button = '&nbsp;
				<input type="button" id="backbutton" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="if (history.length) { history.back(1); } else { self.close(); }"/>
				&nbsp;
				<script type="text/javascript">
				<!--
				if (history.length < 1 || ((is_saf || is_moz) && history.length <= 1)) // safari + gecko start at 1
				{
					document.getElementById("backbutton").parentNode.removeChild(document.getElementById("backbutton"));
				}
				//-->
				</script>';
        } else {
            if ($backurl !== '') {
                // regular window.location=url call
                $backurl = create_full_url($backurl);
                $backurl = str_replace(array('"', "'"), '', $backurl);
                $back_button = '<input type="button" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="window.location=\'' . $backurl . '\';"/>';
            } else {
                $back_button = '';
            }
        }
        print_table_footer(2, $back_button);
    }
    // and now terminate the script
    print_cp_footer();
}
Пример #29
0
    //update the datastore bookmarksite cache
    if ($changes) {
        build_bookmarksite_datastore();
    }
    $_REQUEST['do'] = 'modify';
}
// ########################################################################
// we want to display the bookmark list - this is the default action
if ($_REQUEST['do'] == 'modify') {
    if (!$vbulletin->options['socialbookmarks']) {
        print_table_start();
        print_description_row(fetch_error('social_bookmarks_disabled'));
        print_table_footer(2, '', '', false);
    }
    // display the form and table header
    print_form_header('bookmarksite', 'quickupdate');
    print_table_header($vbphrase['social_bookmarking_manager'], 3);
    $bookmarksites_result = $db->query_read("\n\t\tSELECT * FROM " . TABLE_PREFIX . "bookmarksite AS bookmarksite\n\t\tORDER BY displayorder, title\n\t");
    $bookmarksite_count = $db->num_rows($bookmarksites_result);
    if ($bookmarksite_count) {
        print_description_row('<label><input type="checkbox" id="allbox" checked="checked" />' . $vbphrase['toggle_active_status_for_all'] . '</label><input type="image" src="../' . $vbulletin->options['cleargifurl'] . '" name="normalsubmit" />', false, 3, 'thead" style="font-weight:normal; padding:0px 4px 0px 4px');
        print_column_style_code(array('width:20%; white-space:nowrap', 'width:60%', "width:20%; white-space:nowrap; text-align:{$stylevar['right']}"));
        while ($bookmarksite = $db->fetch_array($bookmarksites_result)) {
            print_cells_row(array('<label class="smallfont"><input type="checkbox" name="active[' . $bookmarksite['bookmarksiteid'] . ']" value="1"' . ($bookmarksite['active'] ? ' checked="checked"' : '') . ' />' . $vbphrase['active'] . '</label> &nbsp; ' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_down.gif" name="displayorderswap[' . $bookmarksite['bookmarksiteid'] . ',higher]" />' . '<input type="text" name="displayorder[' . $bookmarksite['bookmarksiteid'] . ']" value="' . $bookmarksite['displayorder'] . '" class="bginput" size="4" title="' . $vbphrase['display_order'] . '" style="text-align:' . $stylevar['right'] . '" />' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_up.gif" name="displayorderswap[' . $bookmarksite['bookmarksiteid'] . ',lower]" />', '<a href="bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&amp;bookmarksiteid=' . $bookmarksite['bookmarksiteid'] . '" title="' . $vbphrase['edit'] . '">' . $bookmarksite['title'] . '</a>', construct_link_code($vbphrase['edit'], 'bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&amp;bookmarksiteid=' . $bookmarksite['bookmarksiteid']) . construct_link_code($vbphrase['delete'], 'bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=delete&amp;bookmarksiteid=' . $bookmarksite['bookmarksiteid'])), false, '', -1);
        }
        $db->free_result($bookmarksites_result);
    }
    echo '<tr>
		<td class="tfoot">' . ($bookmarksite_count ? '<input type="submit" class="button" accesskey="s" value="' . $vbphrase['save'] . '" /> <input type="reset" class="button" accesskey="r" value="' . $vbphrase['reset'] . '" />' : '&nbsp;') . '</td>
		<td class="tfoot" align="' . $stylevar['right'] . '" colspan="2"><input type="button" class="button" value="' . $vbphrase['add_new_social_bookmarking_site'] . '" onclick="window.location=\'bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=add\';" /></td>
	</tr>';
Пример #30
0
        require_once DIR . '/includes/functions_ad.php';
        require_once DIR . '/includes/adminfunctions_template.php';
        foreach ($changed_locations as $location) {
            // same as above, we're not telling user errors here, because they already confirmed the error else where
            $template = wrap_ad_template(build_ad_template($location), $location);
            $template_un = $template;
            $template = compile_template($template);
            $db->query_write("\r\n\t\t\t\tUPDATE " . TABLE_PREFIX . "template SET\r\n\t\t\t\t\ttemplate = '" . $db->escape_string($template) . "',\r\n\t\t\t\t\ttemplate_un = '" . $db->escape_string($template_un) . "',\r\n\t\t\t\t\tdateline = " . TIMENOW . ",\r\n\t\t\t\t\tusername = '******'username']) . "'\r\n\t\t\t\tWHERE\r\n\t\t\t\t\ttitle = 'ad_" . $db->escape_string($location) . "'\r\n\t\t\t\t\tAND styleid IN (-1,0)\r\n\t\t\t");
        }
    }
    $_REQUEST['do'] = 'modify';
}
// #############################################################################
// list existing ads
if ($_REQUEST['do'] == 'modify') {
    print_form_header('ad', 'quickupdate');
    print_column_style_code(array('width:100%', 'white-space:nowrap'));
    print_table_header($vbphrase['ad_manager']);
    $ad_result = $db->query("SELECT * FROM " . TABLE_PREFIX . "ad ORDER BY displayorder, title");
    $ad_count = $db->num_rows($ad_result);
    if ($ad_count) {
        print_description_row('<label><input type="checkbox" id="allbox" checked="checked" />' . $vbphrase['toggle_active_status_for_all'] . '</label><input type="image" src="../' . $vbulletin->options['cleargifurl'] . '" name="normalsubmit" />', false, 2, 'thead" style="font-weight:normal; padding:0px 4px 0px 4px');
        while ($ad = $db->fetch_array($ad_result)) {
            print_label_row('<a href="ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=locate&amp;editloc=1&amp;ad_location=' . $ad['adlocation'] . '&amp;adid=' . $ad['adid'] . '" title="' . $vbphrase['edit_ad'] . '">' . $ad['title'] . '</a>', '<div style="white-space:nowrap">' . '<label class="smallfont"><input type="checkbox" name="active[' . $ad['adid'] . ']" value="1"' . ($ad['active'] ? ' checked="checked"' : '') . ' />' . $vbphrase['active'] . '</label> ' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_down.gif" name="displayorderswap[' . $ad['adid'] . ',higher]" />' . '<input type="text" name="displayorder[' . $ad['adid'] . ']" value="' . $ad['displayorder'] . '" class="bginput" size="4" title="' . $vbphrase['display_order'] . '" style="text-align:' . vB_Template_Runtime::fetchStyleVar('right') . '" />' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_up.gif" name="displayorderswap[' . $ad['adid'] . ',lower]" />' . construct_link_code($vbphrase['edit'], 'ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=locate&amp;editloc=1&amp;ad_location=' . $ad['adlocation'] . '&amp;adid=' . $ad['adid']) . construct_link_code($vbphrase['delete'], 'ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=delete&amp;adid=' . $ad['adid']) . '</div>');
        }
    }
    print_label_row('<input type="button" class="button" value="' . $vbphrase['add_new_ad'] . '" onclick="window.location=\'ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=locate\';" />', $ad_count ? '<div align="' . vB_Template_Runtime::fetchStyleVar('right') . '"><input type="submit" class="button" accesskey="s" value="' . $vbphrase['save'] . '" /> <input type="reset" class="button" accesskey="r" value="' . $vbphrase['reset'] . '" /></div>' : '&nbsp;', 'tfoot');
    print_table_footer();
    ?>
	<script type="text/javascript">
	<!--