Make WordPress Core

Changeset 614


Ignore:
Timestamp:
12/15/2003 09:55:47 AM (22 years ago)
Author:
saxmatt
Message:

Hacks file option and include.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-072-to-080.php

    r601 r614  
    55$step = $HTTP_GET_VARS['step'];
    66if (!$step) $step = 0;
    7 //update_option('blogdescription', 'hahahah');
    87?>
    98<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    124123<?php
    125124$wpdb->hide_errors(); // Turn this off for dev and we should probably just fix the queries anyway
    126         // fix timezone diff range
    127         $wpdb->query("UPDATE $tableoptionvalues SET optionvalue_max = 23 , optionvalue_min = -23 WHERE option_id = 51");
    128         echo ' .';
    129         flush();
    130         // fix upload users description
    131         $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");
    132         echo ' .';
    133         flush();
    134         // and file types
    135         $wpdb->query("UPDATE $tableoptions SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34");
    136         echo ' .';
    137         flush();
    138         // add link to php date format. this could be to a wordpress.org page in the future
    139         $wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 52");
    140         $wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 53");
    141         echo ' .';
    142         flush();
     125// fix timezone diff range
     126$wpdb->query("UPDATE $tableoptionvalues SET optionvalue_max = 23 , optionvalue_min = -23 WHERE option_id = 51");
     127echo ' .';
     128flush();
     129// fix upload users description
     130$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");
     131echo ' .';
     132flush();
     133// and file types
     134$wpdb->query("UPDATE $tableoptions SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34");
     135echo ' .';
     136flush();
     137// add link to php date format. this could be to a wordpress.org page in the future
     138$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 52");
     139$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 53");
     140echo ' .';
     141flush();
     142if (!$wpdb->get_var("SELECT option_id FROM $tableoptinos WHERE option_name = 'hack_file'")) {
     143    $wpdb->query("INSERT INTO `$tableoptions`
     144        ( `option_id` , `blog_id` , `option_name` , `option_can_override` , `option_type` , `option_value` , `option_width` , `option_height` , `option_description` , `option_admin_level` )
     145        VALUES
     146        ('', '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&#8217;t be overwritten when you upgrade. The file must be in your wordpress root and called <code>my-hacks.php</code>', '8')");
     147    $optionid = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'hack_file'");
     148    $wpdb->query("INSERT INTO $tableoptiongroup_options
     149        (group_id, option_id, seq)
     150        VALUES
     151        (2, $optionid, 5)");
     152}
    143153?>
    144154    <strong>Done with the options updates. Now for a bit of comment action</strong></p>
  • trunk/wp-includes/functions.php

    r609 r614  
    16611661}
    16621662
     1663// Check for hacks file if the option is enabled
     1664if (get_settings('hack_file')) {
     1665    if (file_exists($abspath . '/my-hacks.php'))
     1666        require($abspath . '/my-hacks.php');
     1667}
    16631668?>
  • trunk/wp-settings.php

    r612 r614  
    11<?php
    2 // This is the name of the include directory. No "/" allowed.
    3 $b2inc = 'wp-includes';
    4 
    5 require ($abspath . 'wp-config-extra.php');
    6 require ($abspath . $b2inc . '/wp-db.php');
    7 require ($abspath . $b2inc . '/functions.php');
    8 require ($abspath . $b2inc . '/template-functions.php');
    9 require ($abspath . $b2inc . '/class-xmlrpc.php');
    10 require ($abspath . $b2inc . '/class-xmlrpcs.php');
    11 require ($abspath . '/wp-links/links.php');
    12 
    132$HTTP_HOST = getenv('HTTP_HOST');  /* domain name */
    143$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
     
    3019$tableoptiongroup_options = $table_prefix . 'optiongroup_options';
    3120
     21// This is the name of the include directory. No "/" allowed.
     22$b2inc = 'wp-includes';
     23
     24require ($abspath . 'wp-config-extra.php');
     25require ($abspath . $b2inc . '/wp-db.php');
     26require ($abspath . $b2inc . '/functions.php');
     27require ($abspath . $b2inc . '/template-functions.php');
     28require ($abspath . $b2inc . '/class-xmlrpc.php');
     29require ($abspath . $b2inc . '/class-xmlrpcs.php');
     30require ($abspath . '/wp-links/links.php');
    3231
    3332//setup the old globals from b2config.php
Note: See TracChangeset for help on using the changeset viewer.