Hacks file option and include.
git-svn-id: http://svn.automattic.com/wordpress/trunk@614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
39e68a7a6f
commit
eb2969916c
|
@ -4,7 +4,6 @@ require('install-helper.php');
|
||||||
|
|
||||||
$step = $HTTP_GET_VARS['step'];
|
$step = $HTTP_GET_VARS['step'];
|
||||||
if (!$step) $step = 0;
|
if (!$step) $step = 0;
|
||||||
//update_option('blogdescription', 'hahahah');
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
@ -123,23 +122,34 @@ if (!$wpdb->get_var("SELECT option_name FROM $tableoptions WHERE option_name = '
|
||||||
<p>Working
|
<p>Working
|
||||||
<?php
|
<?php
|
||||||
$wpdb->hide_errors(); // Turn this off for dev and we should probably just fix the queries anyway
|
$wpdb->hide_errors(); // Turn this off for dev and we should probably just fix the queries anyway
|
||||||
// fix timezone diff range
|
// fix timezone diff range
|
||||||
$wpdb->query("UPDATE $tableoptionvalues SET optionvalue_max = 23 , optionvalue_min = -23 WHERE option_id = 51");
|
$wpdb->query("UPDATE $tableoptionvalues SET optionvalue_max = 23 , optionvalue_min = -23 WHERE option_id = 51");
|
||||||
echo ' .';
|
echo ' .';
|
||||||
flush();
|
flush();
|
||||||
// fix upload users description
|
// fix upload users description
|
||||||
$wpdb->query("UPDATE $tableoptions SET option_description = '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'' WHERE option_id = 37");
|
$wpdb->query("UPDATE $tableoptions SET option_description = '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'' WHERE option_id = 37");
|
||||||
echo ' .';
|
echo ' .';
|
||||||
flush();
|
flush();
|
||||||
// and file types
|
// and file types
|
||||||
$wpdb->query("UPDATE $tableoptions SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34");
|
$wpdb->query("UPDATE $tableoptions SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34");
|
||||||
echo ' .';
|
echo ' .';
|
||||||
flush();
|
flush();
|
||||||
// add link to php date format. this could be to a wordpress.org page in the future
|
// add link to php date format. this could be to a wordpress.org page in the future
|
||||||
$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 52");
|
$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 52");
|
||||||
$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 53");
|
$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 53");
|
||||||
echo ' .';
|
echo ' .';
|
||||||
flush();
|
flush();
|
||||||
|
if (!$wpdb->get_var("SELECT option_id FROM $tableoptinos WHERE option_name = 'hack_file'")) {
|
||||||
|
$wpdb->query("INSERT INTO `$tableoptions`
|
||||||
|
( `option_id` , `blog_id` , `option_name` , `option_can_override` , `option_type` , `option_value` , `option_width` , `option_height` , `option_description` , `option_admin_level` )
|
||||||
|
VALUES
|
||||||
|
('', '0', 'hack_file', 'Y', '2', '0', '20', '8', 'Set this to true if you plan to use a hacks file. This is a place for you to store code hacks that won’t be overwritten when you upgrade. The file must be in your wordpress root and called <code>my-hacks.php</code>', '8')");
|
||||||
|
$optionid = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'hack_file'");
|
||||||
|
$wpdb->query("INSERT INTO $tableoptiongroup_options
|
||||||
|
(group_id, option_id, seq)
|
||||||
|
VALUES
|
||||||
|
(2, $optionid, 5)");
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<strong>Done with the options updates. Now for a bit of comment action</strong></p>
|
<strong>Done with the options updates. Now for a bit of comment action</strong></p>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -1660,4 +1660,9 @@ function add_filter($tag, $function_to_add) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
// Check for hacks file if the option is enabled
|
||||||
|
if (get_settings('hack_file')) {
|
||||||
|
if (file_exists($abspath . '/my-hacks.php'))
|
||||||
|
require($abspath . '/my-hacks.php');
|
||||||
|
}
|
||||||
|
?>
|
|
@ -1,15 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// This is the name of the include directory. No "/" allowed.
|
|
||||||
$b2inc = 'wp-includes';
|
|
||||||
|
|
||||||
require ($abspath . 'wp-config-extra.php');
|
|
||||||
require ($abspath . $b2inc . '/wp-db.php');
|
|
||||||
require ($abspath . $b2inc . '/functions.php');
|
|
||||||
require ($abspath . $b2inc . '/template-functions.php');
|
|
||||||
require ($abspath . $b2inc . '/class-xmlrpc.php');
|
|
||||||
require ($abspath . $b2inc . '/class-xmlrpcs.php');
|
|
||||||
require ($abspath . '/wp-links/links.php');
|
|
||||||
|
|
||||||
$HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
|
$HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
|
||||||
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
|
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
|
||||||
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
|
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
|
||||||
|
@ -29,6 +18,16 @@ $tableoptionvalues = $table_prefix . 'optionvalues';
|
||||||
$tableoptiongroups = $table_prefix . 'optiongroups';
|
$tableoptiongroups = $table_prefix . 'optiongroups';
|
||||||
$tableoptiongroup_options = $table_prefix . 'optiongroup_options';
|
$tableoptiongroup_options = $table_prefix . 'optiongroup_options';
|
||||||
|
|
||||||
|
// This is the name of the include directory. No "/" allowed.
|
||||||
|
$b2inc = 'wp-includes';
|
||||||
|
|
||||||
|
require ($abspath . 'wp-config-extra.php');
|
||||||
|
require ($abspath . $b2inc . '/wp-db.php');
|
||||||
|
require ($abspath . $b2inc . '/functions.php');
|
||||||
|
require ($abspath . $b2inc . '/template-functions.php');
|
||||||
|
require ($abspath . $b2inc . '/class-xmlrpc.php');
|
||||||
|
require ($abspath . $b2inc . '/class-xmlrpcs.php');
|
||||||
|
require ($abspath . '/wp-links/links.php');
|
||||||
|
|
||||||
//setup the old globals from b2config.php
|
//setup the old globals from b2config.php
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue