本文整理汇总了PHP中print_table_header函数的典型用法代码示例。如果您正苦于以下问题:PHP print_table_header函数的具体用法?PHP print_table_header怎么用?PHP print_table_header使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_table_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_statistic_code
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']);
}
示例2: print_diagnostic_test_result
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();
}
}
示例3: print_setting_group
/**
* Prints a setting group for use in options.php?do=options
*
* @param string Settings group ID
* @param boolean Show advanced settings?
*/
function print_setting_group($dogroup, $advanced = 0)
{
global $settingscache, $grouptitlecache, $bgcounter, $settingphrase;
if (!is_array($settingscache["{$dogroup}"])) {
return;
}
$userContext = vB::getUserContext();
if (!empty($settingscache[$dogroup]['groupperm']) and !$userContext->hasAdminPermission($settingscache[$dogroup]['groupperm'])) {
return;
}
$vbphrase = vB_Api::instanceInternal('phrase')->fetch(array('group_requires_admin_perm', 'edit', 'delete', 'add_setting', 'rebuild', 'rebuild_all_attachments'));
print_column_style_code(array('width:45%', 'width:55%'));
echo "<thead>\r\n";
$vb5_config = vB::getConfig();
$title = $settingphrase["settinggroup_{$grouptitlecache[$dogroup]}"];
if ($vb5_config['Misc']['debug'] and $userContext->hasAdminPermission('canadminsettingsall')) {
$title .= '<span class="normal">' . construct_link_code($vbphrase['edit'], "options.php?" . vB::getCurrentSession()->get('sessionurl') . "do=editgroup&grouptitle={$dogroup}") . construct_link_code($vbphrase['delete'], "options.php?" . vB::getCurrentSession()->get('sessionurl') . "do=removegroup&grouptitle={$dogroup}") . construct_link_code($vbphrase['add_setting'], "options.php?" . vB::getCurrentSession()->get('sessionurl') . "do=addsetting&grouptitle={$dogroup}") . '</span>';
}
print_table_header($title);
echo "</thead>\r\n";
$bgcounter = 1;
foreach ($settingscache["{$dogroup}"] as $settingid => $setting) {
if (!empty($setting['adminperm']) and !$userContext->hasAdminPermission($setting['adminperm'])) {
continue;
}
if (($advanced or !$setting['advanced']) and !empty($setting['varname'])) {
print_setting_row($setting, $settingphrase, true, $userContext);
}
}
}
示例4: print_editor
public function print_editor($masterstyleid)
{
global $vbulletin, $vbphrase;
$addon = $masterstyleid == -2 ? '_mobile' : '';
$header = $vbphrase["stylevar_{$this->stylevarid}_name{$addon}"] ? $vbphrase["stylevar_{$this->stylevarid}_name{$addon}"] : $this->stylevarid;
$addbit = false;
if ($vbulletin->GPC['dostyleid'] == -1 or $vbulletin->GPC['dostyleid'] == -2) {
$header .= ' - <span class="smallfont">' . construct_link_code($vbphrase['edit'], "stylevar.php?" . $vbulletin->session->vars['sessionurl'] . "do=dfnedit&stylevarid=" . $this->stylevarid . "&dostyleid=" . $vbulletin->GPC['dostyleid']);
$addbit = true;
}
if ($this->inherited == -1 or $this->inherited == -2) {
if (!$addbit) {
$header .= ' - <span class="smallfont">';
} else {
$header .= ' - ';
}
$header .= (count($header) == 1 ? '<span class="smallfont">' : '') . construct_link_code($vbphrase['revert'], "stylevar.php?" . $vbulletin->session->vars['sessionurl'] . "do=confirmrevert&dostyleid=" . $vbulletin->GPC['dostyleid'] . "&stylevarid=" . $this->stylevarid . "&rootstyle=" . $this->inherited);
}
if ($addbit) {
$header .= '</span>';
}
print_table_header($header);
if ($vbphrase["stylevar_{$this->stylevarid}_description{$addon}"]) {
print_description_row($vbphrase["stylevar_{$this->stylevarid}_description{$addon}"], false, 2);
}
// once we have LSB change this to self::
$this->print_editor_form();
}
示例5: print_channel_permission_rows
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 //
}
示例6: print_setting_group
/**
* Prints a setting group for use in options.php?do=options
*
* @param string Settings group ID
* @param boolean Show advanced settings?
*/
function print_setting_group($dogroup, $advanced = 0)
{
global $settingscache, $grouptitlecache, $vbulletin, $vbphrase, $bgcounter, $settingphrase, $stylevar;
if (!is_array($settingscache["{$dogroup}"])) {
return;
}
print_column_style_code(array('width:45%', 'width:55%'));
echo "<thead>\r\n";
print_table_header($settingphrase["settinggroup_{$grouptitlecache[$dogroup]}"] . iif($vbulletin->debug, '<span class="normal">' . construct_link_code($vbphrase['edit'], "options.php?" . $vbulletin->session->vars['sessionurl'] . "do=editgroup&grouptitle={$dogroup}") . construct_link_code($vbphrase['delete'], "options.php?" . $vbulletin->session->vars['sessionurl'] . "do=removegroup&grouptitle={$dogroup}") . construct_link_code($vbphrase['add_setting'], "options.php?" . $vbulletin->session->vars['sessionurl'] . "do=addsetting&grouptitle={$dogroup}") . '</span>'));
echo "</thead>\r\n";
$bgcounter = 1;
foreach ($settingscache["{$dogroup}"] as $settingid => $setting) {
if (($advanced or !$setting['advanced']) and !empty($setting['varname'])) {
print_setting_row($setting, $settingphrase);
}
}
}
示例7: print_editor
public function print_editor()
{
global $vbulletin, $vbphrase;
$vb5_config =& vB::getConfig();
$header = $vbphrase["stylevar_{$this->stylevarid}_name"] ? $vbphrase["stylevar_{$this->stylevarid}_name"] : $this->stylevarid;
$addbit = false;
if ($vbulletin->GPC['dostyleid'] == -1) {
$header .= ' - <span class="smallfont">' . construct_link_code($vbphrase['edit'], "stylevar.php?" . vB::getCurrentSession()->get('sessionurl') . "do=dfnedit&stylevarid=" . $this->stylevarid);
$addbit = true;
}
if ($this->inherited == -1) {
if (!$addbit) {
$header .= ' - <span class="smallfont">';
$addbit = true;
} else {
$header .= ' - ';
}
$header .= construct_link_code($vbphrase['revert_gcpglobal'], "stylevar.php?" . vB::getCurrentSession()->get('sessionurl') . "do=confirmrevert&dostyleid=" . $vbulletin->GPC['dostyleid'] . "&stylevarid=" . $this->stylevarid . "&rootstyle=-1");
}
if ($addbit) {
$header .= '</span>';
}
print_table_header($header);
if ($vbphrase["stylevar_{$this->stylevarid}_description"]) {
print_description_row($vbphrase["stylevar_{$this->stylevarid}_description"], false, 2);
}
if ($vb5_config['Misc']['debug']) {
print_label_row($vbphrase['stylevarid'], $this->stylevarid);
}
// output this stylevar's inheritance level (inherited or customized)
// so that we can update the stylevar list and show inherited status
// immediately
echo '<script type="text/javascript">
window.vBulletinStylevarInheritance = window.vBulletinStylevarInheritance ? window.vBulletinStylevarInheritance : {};
window.vBulletinStylevarInheritance["' . $this->stylevarid . '"] = ' . $this->inherited . ';
</script>';
// once we have LSB change this to self::
$this->print_editor_form();
}
示例8: fetch_userinfo
// ###################### 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>');
}
}
}
print_table_footer();
}
示例9: microtime
$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 $
|| ####################################################################
\*======================================================================*/
示例10: unset
$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&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();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
示例11: print_stop_message
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
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
示例12: preg_replace
}
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
build_product_datastore();
示例13: print_table_footer
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;
$db->query_write("DELETE FROM " . TABLE_PREFIX . "moderator WHERE userid = " . $vbulletin->GPC['userid'] . " AND forumid <> -1");
// if the user is in the moderators usergroup, then move them to registered users usergroup
示例14: print_upgrade_footer
echo "<blockquote><p> </p>";
echo "{$vbphrase['upgrade_wrong_version']}";
echo "<p> </p></blockquote>";
print_upgrade_footer();
}
}
// #############################################################################
// FINAL step (notice the SCRIPTCOMPLETE define)
if ($vbulletin->GPC['step'] == 1) {
$db->query_write("\r\n\t\tDELETE FROM " . TABLE_PREFIX . "phrase\r\n\t\tWHERE varname LIKE 'notice\\_%\\_title'\r\n\t\t\tAND fieldname = 'global'\r\n\t");
$db->query_write("\r\n\t\tALTER TABLE " . TABLE_PREFIX . "event CHANGE utc utc DECIMAL(4,2) NOT NULL DEFAULT '0.0'\r\n\t");
$rows = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "adminmessage WHERE varname = 'after_upgrade_password_check'");
if ($rows['count'] == 0) {
$db->query_write("\r\n\t\t\tINSERT INTO " . TABLE_PREFIX . "adminmessage\r\n\t\t\t\t(varname, dismissable, script, action, execurl, method, dateline, status)\r\n\t\t\tVALUES\r\n\t\t\t\t('after_upgrade_password_check', 1, 'passwordcheck.php', 'check', 'passwordcheck.php?do=check', 'get', " . TIMENOW . ", 'undone')\r\n\t\t\t\r\n\t\t");
}
print_form_header('', '');
print_table_header($upgrade_phrases['upgrade_373.php']['weak_password_notice']);
print_description_row($upgrade_phrases['upgrade_373.php']['weak_password_description']);
print_table_footer();
// tell log_upgrade_step() that the script is done
define('SCRIPTCOMPLETE', true);
}
// #############################################################################
print_next_step();
print_upgrade_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:56, Sat Oct 11th 2008
|| # CVS: $RCSfile$ - $Revision: 13568 $
|| ####################################################################
\*======================================================================*/
示例15: build_attachment_permissions
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();
/*======================================================================*\
|| ####################################################################