[wp-cvs] wordpress/wp-admin admin-footer.php, 1.9,
1.10 admin-functions.php, 1.29, 1.30 admin-header.php, 1.24,
1.25 auth.php, 1.7, 1.8 bookmarklet.php, 1.10,
1.11 categories.php, 1.32, 1.33 edit-comments.php, 1.26,
1.27 edit-form-comment.php, 1.10, 1.11 edit-form.php, 1.23,
1.24 edit.php, 1.23, 1.24 import-b2.php, 1.11,
1.12 import-blogger.php, 1.13, 1.14 import-greymatter.php,
1.15, 1.16 import-livejournal.php, 1.5, 1.6 import-mt.php,
1.12, 1.13 import-rss.php, 1.5, 1.6 import-textpattern.php,
1.11, 1.12 index.php, 1.8, 1.9 install-helper.php, 1.3,
1.4 install.php, 1.32, 1.33 link-add.php, 1.13,
1.14 link-categories.php, 1.10, 1.11 link-import.php, 1.12,
1.13 link-parse-opml.php, 1.7, 1.8 menu.php, 1.17,
1.18 moderation.php, 1.12, 1.13 optionhandler.php, 1.9,
1.10 options-discussion.php, 1.17, 1.18 options-general.php,
1.22, 1.23 options-head.php, 1.9, 1.10 options-misc.php, 1.11,
1.12 options-permalink.php, 1.35, 1.36 options-reading.php,
1.11, 1.12 options-writing.php, 1.20, 1.21 options.php, 1.25,
1.26 plugins.php, 1.13, 1.14 quicktags.php, 1.2,
1.3 setup-config.php, 1.3, 1.4 sidebar.php, 1.12,
1.13 templates.php, 1.20, 1.21 upgrade-functions.php, 1.60,
1.61 upgrade.php, 1.11, 1.12 upload.php, 1.15, 1.16 xmlrpc.php,
1.6, 1.7
Ryan Boren
rboren at users.sourceforge.net
Tue Jun 15 23:24:38 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16581/wp-admin
Modified Files:
admin-footer.php admin-functions.php admin-header.php auth.php
bookmarklet.php categories.php edit-comments.php
edit-form-comment.php edit-form.php edit.php import-b2.php
import-blogger.php import-greymatter.php
import-livejournal.php import-mt.php import-rss.php
import-textpattern.php index.php install-helper.php
install.php link-add.php link-categories.php link-import.php
link-parse-opml.php menu.php moderation.php optionhandler.php
options-discussion.php options-general.php options-head.php
options-misc.php options-permalink.php options-reading.php
options-writing.php options.php plugins.php quicktags.php
setup-config.php sidebar.php templates.php
upgrade-functions.php upgrade.php upload.php xmlrpc.php
Log Message:
Death to \r.
Index: optionhandler.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/optionhandler.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** optionhandler.php 11 Jun 2004 18:23:12 -0000 1.9
--- optionhandler.php 15 Jun 2004 23:24:35 -0000 1.10
***************
*** 1,118 ****
! <?php
! require_once('../wp-config.php');
! /**
! ** get_option_widget()
! ** parameters:
! ** option_result - result set containing option_id, option_name, option_type,
! ** option_value, option_description, option_admin_level
! ** editable - flag to determine whether the returned widget will be editable
! **/
! function get_option_widget($option_result, $editable, $between)
! {
! global $wpdb;
! $disabled = $editable ? '' : 'disabled';
!
! switch ($option_result->option_type) {
! case 1: // integer
! case 3: // string
! case 8: // float
! case 6: // range -- treat same as integer for now!
! if (($option_result->option_type == 1) || ($option_result->option_type == 1)) {
! $width = 6;
! } else {
! $width = $option_result->option_width;
! }
! return <<<TEXTINPUT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <input type="text" name="$option_result->option_name" size="$width" value="$option_result->option_value" $disabled/>
! TEXTINPUT;
! //break;
!
! case 2: // boolean
! $true_selected = ($option_result->option_value == '1') ? 'selected="selected"' : '';
! $false_selected = ($option_result->option_value == '0') ? 'selected="selected"' : '';
! return <<<BOOLSELECT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <select name="$option_result->option_name" $disabled>
! <option value="1" $true_selected>true</option>
! <option value="0" $false_selected>false</option>
! </select>
! BOOLSELECT;
! //break;
!
! case 5: // select
! $ret = <<<SELECT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <select name="$option_result->option_name" id="$option_result->option_name" $disabled>
! SELECT;
!
! $select = $wpdb->get_results("SELECT optionvalue, optionvalue_desc "
! ."FROM $wpdb->optionvalues "
! ."WHERE option_id = $option_result->option_id "
! ."ORDER BY optionvalue_seq");
! if ($select) {
! foreach($select as $option) {
! $ret .= '<option value="'.$option->optionvalue.'"';
! //error_log("comparing [$option_result->option_value] == [$option->optionvalue]");
! if ($option_result->option_value == $option->optionvalue) {
! $ret .=' selected="selected"';
! }
! $ret .= ">$option->optionvalue_desc</option>\n";
! }
! }
! $ret .= '</select>';
! return $ret;
! //break;
!
! case 7: // SQL select
! // first get the sql to run
! $sql = $wpdb->get_var("SELECT optionvalue FROM $wpdb->optionvalues WHERE option_id = $option_result->option_id");
! if (!$sql) {
! return $option_result->option_name . $editable;
! }
!
! // now we may need to do table name substitution
! eval("include('../wp-config.php');\$sql = \"$sql\";");
!
! $ret = <<<SELECT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <select name="$option_result->option_name" $disabled>
! SELECT;
!
! $select = $wpdb->get_results("$sql");
! if ($select) {
! foreach($select as $option) {
! $ret .= '<option value="'.$option->value.'"';
! //error_log("comparing [$option_result->option_value] == [$option->optionvalue]");
! if ($option_result->option_value == $option->value) {
! $ret .=' selected="selected"';
! }
! $ret .= ">$option->label</option>\n";
! }
! }
! $ret .= '</select>';
! return $ret;
! //break;
!
! } // end switch
! return $option_result->option_name . $editable;
! } // end function get_option_widget
!
!
! function validate_option($option, $name, $val) {
! global $wpdb;
! $msg = '';
! switch ($option->option_type) {
! case 6: // range
! // get range
! $range = $wpdb->get_row("SELECT optionvalue_max, optionvalue_min FROM $wpdb->optionvalues WHERE option_id = $option->option_id");
! if ($range) {
! if (($val < $range->optionvalue_min) || ($val > $range->optionvalue_max)) {
! $msg = "$name is outside the valid range ($range->optionvalue_min - $range->optionvalue_max). ";
! }
! }
! } // end switch
! return $msg;
! } // end validate_option
!
?>
\ No newline at end of file
--- 1,118 ----
! <?php
! require_once('../wp-config.php');
! /**
! ** get_option_widget()
! ** parameters:
! ** option_result - result set containing option_id, option_name, option_type,
! ** option_value, option_description, option_admin_level
! ** editable - flag to determine whether the returned widget will be editable
! **/
! function get_option_widget($option_result, $editable, $between)
! {
! global $wpdb;
! $disabled = $editable ? '' : 'disabled';
!
! switch ($option_result->option_type) {
! case 1: // integer
! case 3: // string
! case 8: // float
! case 6: // range -- treat same as integer for now!
! if (($option_result->option_type == 1) || ($option_result->option_type == 1)) {
! $width = 6;
! } else {
! $width = $option_result->option_width;
! }
! return <<<TEXTINPUT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <input type="text" name="$option_result->option_name" size="$width" value="$option_result->option_value" $disabled/>
! TEXTINPUT;
! //break;
!
! case 2: // boolean
! $true_selected = ($option_result->option_value == '1') ? 'selected="selected"' : '';
! $false_selected = ($option_result->option_value == '0') ? 'selected="selected"' : '';
! return <<<BOOLSELECT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <select name="$option_result->option_name" $disabled>
! <option value="1" $true_selected>true</option>
! <option value="0" $false_selected>false</option>
! </select>
! BOOLSELECT;
! //break;
!
! case 5: // select
! $ret = <<<SELECT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <select name="$option_result->option_name" id="$option_result->option_name" $disabled>
! SELECT;
!
! $select = $wpdb->get_results("SELECT optionvalue, optionvalue_desc "
! ."FROM $wpdb->optionvalues "
! ."WHERE option_id = $option_result->option_id "
! ."ORDER BY optionvalue_seq");
! if ($select) {
! foreach($select as $option) {
! $ret .= '<option value="'.$option->optionvalue.'"';
! //error_log("comparing [$option_result->option_value] == [$option->optionvalue]");
! if ($option_result->option_value == $option->optionvalue) {
! $ret .=' selected="selected"';
! }
! $ret .= ">$option->optionvalue_desc</option>\n";
! }
! }
! $ret .= '</select>';
! return $ret;
! //break;
!
! case 7: // SQL select
! // first get the sql to run
! $sql = $wpdb->get_var("SELECT optionvalue FROM $wpdb->optionvalues WHERE option_id = $option_result->option_id");
! if (!$sql) {
! return $option_result->option_name . $editable;
! }
!
! // now we may need to do table name substitution
! eval("include('../wp-config.php');\$sql = \"$sql\";");
!
! $ret = <<<SELECT
! <label for="$option_result->option_name">$option_result->option_name</label>$between
! <select name="$option_result->option_name" $disabled>
! SELECT;
!
! $select = $wpdb->get_results("$sql");
! if ($select) {
! foreach($select as $option) {
! $ret .= '<option value="'.$option->value.'"';
! //error_log("comparing [$option_result->option_value] == [$option->optionvalue]");
! if ($option_result->option_value == $option->value) {
! $ret .=' selected="selected"';
! }
! $ret .= ">$option->label</option>\n";
! }
! }
! $ret .= '</select>';
! return $ret;
! //break;
!
! } // end switch
! return $option_result->option_name . $editable;
! } // end function get_option_widget
!
!
! function validate_option($option, $name, $val) {
! global $wpdb;
! $msg = '';
! switch ($option->option_type) {
! case 6: // range
! // get range
! $range = $wpdb->get_row("SELECT optionvalue_max, optionvalue_min FROM $wpdb->optionvalues WHERE option_id = $option->option_id");
! if ($range) {
! if (($val < $range->optionvalue_min) || ($val > $range->optionvalue_max)) {
! $msg = "$name is outside the valid range ($range->optionvalue_min - $range->optionvalue_max). ";
! }
! }
! } // end switch
! return $msg;
! } // end validate_option
!
?>
\ No newline at end of file
Index: import-b2.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/import-b2.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** import-b2.php 11 Jun 2004 18:23:11 -0000 1.11
--- import-b2.php 15 Jun 2004 23:24:35 -0000 1.12
***************
*** 1,246 ****
! <?php
! if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php.");
! require_once('../wp-config.php');
! require('upgrade-functions.php');
! $step = $_GET['step'];
! if (!$step) $step = 0;
! ?>
! <!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">
! <title>WordPress — b2 Conversion</title>
! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
! <style media="screen" type="text/css">
! body {
! font-family: Georgia, "Times New Roman", Times, serif;
! margin-left: 15%;
! margin-right: 15%;
! }
! #logo {
! margin: 0;
! padding: 0;
! background-image: url(http://wordpress.org/images/wordpress.gif);
! background-repeat: no-repeat;
! height: 60px;
! border-bottom: 4px solid #333;
! }
! #logo a {
! display: block;
! height: 60px;
! }
! #logo a span {
! display: none;
! }
! p, li {
! line-height: 140%;
! }
! </style>
! </head>
! <body>
! <h1 id="logo"><a href="http://wordpress.org"><span>WordPress</span></a></h1>
! <?php
! switch($step) {
!
! case 0:
! ?>
! <p>Welcome to WordPress. Since you’re upgrading from b2 everything should be relatively
! familiar to you. Here are some notes on upgrading:</p>
! <ul>
! <li>If you’re using an older version of b2, it's probably a good idea to upgrade
! to at least .61 before making the leap to WordPress.</li>
! <li>The templates are so much better, and there is so much more going on than
! before it’s probably worth it to start from scratch and work back to your
! design.</li>
! <li>You need to transfer some of your settings from your old <code>b2config.php</code>
! to <code>wp-config.php</code> file.</li>
! <li>WordPress issues should be discussed in our <a href="http://wordpress.org/support/">support
! forums</a>.</li>
! <li><strong>Back up</strong> your database before you do anything. Yes, you.</li>
! </ul>
! <p>Have you looked at the <a href="../readme.html">readme</a>? If
! you’re all ready, <a href="import-b2.php?step=1">let’s go</a>!</p>
! <?php
! break;
!
! case 1:
! ?>
! <h1>Step 1</h1>
! <p>Okay first we’re going to set up the links database. This will allow you to host your own blogroll, complete with Weblogs.com updates.</p>
! <?php
!
! $got_links = false;
! $got_cats = false;
! $got_row = false;
! ?>
! <p>Installing WP-Links.</p>
! <p>Checking for tables...</p>
! <?php
! $result = mysql_list_tables(DB_NAME);
! if (!$result) {
! print "DB Error, could not list tables\n";
! print 'MySQL Error: ' . mysql_error();
! exit;
! }
!
! while ($row = mysql_fetch_row($result)) {
! if ($row[0] == $wpdb->links)
! $got_links = true;
! if ($row[0] == $wpdb->linkcategories)
! $got_cats = true;
! //print "Table: $row[0]<br />\n";
! }
! if (!$got_cats) {
! echo "<p>Can't find table '$wpdb->linkcategories', gonna create it...</p>\n";
! $sql = "CREATE TABLE $wpdb->linkcategories ( " .
! " cat_id int(11) NOT NULL auto_increment, " .
! " cat_name tinytext NOT NULL, ".
! " auto_toggle enum ('Y','N') NOT NULL default 'N', ".
! " PRIMARY KEY (cat_id) ".
! ") ";
! $result = mysql_query($sql) or print ("Can't create the table '$wpdb->linkcategories' in the database.<br />" . $sql . "<br />" . mysql_error());
! if ($result != false) {
! echo "<p>Table '$wpdb->linkcategories' created OK</p>\n";
! $got_cats = true;
! }
! } else {
! echo "<p>Found table '$wpdb->linkcategories', don't need to create it...</p>\n";
! $got_cats = true;
! }
! if (!$got_links) {
! echo "<p>Can't find '$wpdb->links', gonna create it...</p>\n";
! $sql = "CREATE TABLE $wpdb->links ( " .
! " link_id int(11) NOT NULL auto_increment, " .
! " link_url varchar(255) NOT NULL default '', " .
! " link_name varchar(255) NOT NULL default '', " .
! " link_image varchar(255) NOT NULL default '', " .
! " link_target varchar(25) NOT NULL default '', " .
! " link_category int(11) NOT NULL default 0, " .
! " link_description varchar(255) NOT NULL default '', " .
! " link_visible enum ('Y','N') NOT NULL default 'Y', " .
! " link_owner int NOT NULL DEFAULT '1', " .
! " link_rating int NOT NULL DEFAULT '0', " .
! " link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " .
! " link_rel varchar(255) NOT NULL default '', " .
! " link_notes MEDIUMTEXT NOT NULL default '', " .
! " PRIMARY KEY (link_id) " .
! ") ";
! $result = mysql_query($sql) or print ("Can't create the table '$wpdb->links' in the database.<br />" . $sql . "<br />" . mysql_error());
! $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://wordpress.org/', 'WordPress', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');");
! $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://photomatt.net/', 'Matt', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');");
! $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://zed1.com/b2/', 'Mike', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');");
!
! if ($result != false) {
! echo "<p>Table '$wpdb->links' created OK</p>\n";
! $got_links = true;
! }
! } else {
! echo "<p>Found table '$wpdb->links', don't need to create it...</p>\n";
! echo "<p>... may need to update it though. Looking for column link_updated...</p>\n";
! $query = "SELECT link_updated FROM $wpdb->links LIMIT 1";
! $q = @mysql_query($query);
! if ($q != false) {
! if ($row = mysql_fetch_object($q)) {
! echo "<p>You have column link_updated. Good!</p>\n";
! }
! } else {
! $query = "ALTER TABLE $wpdb->links ADD COLUMN link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'";
! $q = mysql_query($query) or mysql_doh("Doh, couldn't add column.", $query, mysql_error());
! echo "<p>Added column link_updated...</p>\n";
! }
! echo "<p>Looking for column link_rel...</p>\n";
! $query = "SELECT link_rel FROM $wpdb->links LIMIT 1";
! $q = @mysql_query($query);
! if ($q != false) {
! if ($row = mysql_fetch_object($q)) {
! echo "<p>You have column link_rel. Good!</p>\n";
! }
! } else {
! $query = "ALTER TABLE $wpdb->links ADD COLUMN link_rel varchar(255) NOT NULL DEFAULT '' ";
! $q = mysql_query($query) or mysql_doh("Doh, couldn't add column.", $query, mysql_error());
! echo "<p>Added column link_rel...</p>\n";
! }
! $got_links = true;
! }
!
! if ($got_links && $got_cats) {
! echo "<p>Looking for category 1...</p>\n";
! $sql = "SELECT * FROM $wpdb->linkcategories WHERE cat_id=1 ";
! $result = mysql_query($sql) or print ("Can't query '$wpdb->linkcategories'.<br />" . $sql . "<br />" . mysql_error());
! if ($result != false) {
! if ($row = mysql_fetch_object($result)) {
! echo "<p>You have at least 1 category. Good!</p>\n";
! $got_row = true;
! } else {
! echo "<p>Gonna insert category 1...</p>\n";
! $sql = "INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, 'General')";
! $result = mysql_query($sql) or print ("Can't query insert category.<br />" . $sql . "<br />" . mysql_error());
! if ($result != false) {
! echo "<p>Inserted category Ok</p>\n";
! $got_row = true;
! }
! }
! }
! }
!
! if ($got_row) {
! echo "<p>All done!</p>\n";
! }
! ?>
! <p>Did you defeat the boss monster at the end? Good, then you’re ready for
! <a href="import-b2.php?step=2">Step 2</a>.</p>
! <?php
! break;
! case 2:
! ?>
! <h1>Step 2</h1>
! <p>First we’re going to add excerpt, post, and password functionality...</p>
!
! <?php
!
! $query = "ALTER TABLE $wpdb->posts ADD COLUMN post_excerpt text NOT NULL;";
! $q = $wpdb->query($query);
! // 0.71 mods
! $query = "ALTER TABLE $wpdb->posts ADD post_status ENUM('publish','draft','private') NOT NULL,
! ADD comment_status ENUM('open','closed') NOT NULL,
! ADD ping_status ENUM('open','closed') NOT NULL,
! ADD post_password varchar(20) NOT NULL;";
! $q = $wpdb->query($query);
! ?>
!
! <p>That went well! Now let's clean up the b2 database structure a bit...</p>
!
! <?php
! $query = "ALTER TABLE $wpdb->posts DROP INDEX ID";
!
! $q = $wpdb->query($query);
!
! ?>
!
! <p>One down, two to go...</p>
!
!
! <p>So far so good.</p>
! <?php
!
! $query="ALTER TABLE $wpdb->posts DROP post_karma";
! $q = $wpdb->query($query);
! flush();
! ?>
!
! <p>Almost there...</p>
!
! <?php
!
! $query = "ALTER TABLE $wpdb->users DROP INDEX ID";
!
! $q = $wpdb->query($query);
! upgrade_all();
! ?>
!
! <p>Welcome to the family. <a href="../">Have fun</a>!</p>
! <?php
! break;
! }
! ?>
!
! </body>
</html>
\ No newline at end of file
--- 1,246 ----
! <?php
! if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php.");
! require_once('../wp-config.php');
! require('upgrade-functions.php');
! $step = $_GET['step'];
! if (!$step) $step = 0;
! ?>
! <!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">
! <title>WordPress — b2 Conversion</title>
! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
! <style media="screen" type="text/css">
! body {
! font-family: Georgia, "Times New Roman", Times, serif;
! margin-left: 15%;
! margin-right: 15%;
! }
! #logo {
! margin: 0;
! padding: 0;
! background-image: url(http://wordpress.org/images/wordpress.gif);
! background-repeat: no-repeat;
! height: 60px;
! border-bottom: 4px solid #333;
! }
! #logo a {
! display: block;
! height: 60px;
! }
! #logo a span {
! display: none;
! }
! p, li {
! line-height: 140%;
! }
! </style>
! </head>
! <body>
! <h1 id="logo"><a href="http://wordpress.org"><span>WordPress</span></a></h1>
! <?php
! switch($step) {
!
! case 0:
! ?>
! <p>Welcome to WordPress. Since you’re upgrading from b2 everything should be relatively
! familiar to you. Here are some notes on upgrading:</p>
! <ul>
! <li>If you’re using an older version of b2, it's probably a good idea to upgrade
! to at least .61 before making the leap to WordPress.</li>
! <li>The templates are so much better, and there is so much more going on than
! before it’s probably worth it to start from scratch and work back to your
! design.</li>
! <li>You need to transfer some of your settings from your old <code>b2config.php</code>
! to <code>wp-config.php</code> file.</li>
! <li>WordPress issues should be discussed in our <a href="http://wordpress.org/support/">support
! forums</a>.</li>
! <li><strong>Back up</strong> your database before you do anything. Yes, you.</li>
! </ul>
! <p>Have you looked at the <a href="../readme.html">readme</a>? If
! you’re all ready, <a href="import-b2.php?step=1">let’s go</a>!</p>
! <?php
! break;
!
! case 1:
! ?>
! <h1>Step 1</h1>
! <p>Okay first we’re going to set up the links database. This will allow you to host your own blogroll, complete with Weblogs.com updates.</p>
! <?php
!
! $got_links = false;
! $got_cats = false;
! $got_row = false;
! ?>
! <p>Installing WP-Links.</p>
! <p>Checking for tables...</p>
! <?php
! $result = mysql_list_tables(DB_NAME);
! if (!$result) {
! print "DB Error, could not list tables\n";
! print 'MySQL Error: ' . mysql_error();
! exit;
! }
!
! while ($row = mysql_fetch_row($result)) {
! if ($row[0] == $wpdb->links)
! $got_links = true;
! if ($row[0] == $wpdb->linkcategories)
! $got_cats = true;
! //print "Table: $row[0]<br />\n";
! }
! if (!$got_cats) {
! echo "<p>Can't find table '$wpdb->linkcategories', gonna create it...</p>\n";
! $sql = "CREATE TABLE $wpdb->linkcategories ( " .
! " cat_id int(11) NOT NULL auto_increment, " .
! " cat_name tinytext NOT NULL, ".
! " auto_toggle enum ('Y','N') NOT NULL default 'N', ".
! " PRIMARY KEY (cat_id) ".
! ") ";
! $result = mysql_query($sql) or print ("Can't create the table '$wpdb->linkcategories' in the database.<br />" . $sql . "<br />" . mysql_error());
! if ($result != false) {
! echo "<p>Table '$wpdb->linkcategories' created OK</p>\n";
! $got_cats = true;
! }
! } else {
! echo "<p>Found table '$wpdb->linkcategories', don't need to create it...</p>\n";
! $got_cats = true;
! }
! if (!$got_links) {
! echo "<p>Can't find '$wpdb->links', gonna create it...</p>\n";
! $sql = "CREATE TABLE $wpdb->links ( " .
! " link_id int(11) NOT NULL auto_increment, " .
! " link_url varchar(255) NOT NULL default '', " .
! " link_name varchar(255) NOT NULL default '', " .
! " link_image varchar(255) NOT NULL default '', " .
! " link_target varchar(25) NOT NULL default '', " .
! " link_category int(11) NOT NULL default 0, " .
! " link_description varchar(255) NOT NULL default '', " .
! " link_visible enum ('Y','N') NOT NULL default 'Y', " .
! " link_owner int NOT NULL DEFAULT '1', " .
! " link_rating int NOT NULL DEFAULT '0', " .
! " link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " .
! " link_rel varchar(255) NOT NULL default '', " .
! " link_notes MEDIUMTEXT NOT NULL default '', " .
! " PRIMARY KEY (link_id) " .
! ") ";
! $result = mysql_query($sql) or print ("Can't create the table '$wpdb->links' in the database.<br />" . $sql . "<br />" . mysql_error());
! $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://wordpress.org/', 'WordPress', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');");
! $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://photomatt.net/', 'Matt', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');");
! $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://zed1.com/b2/', 'Mike', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');");
!
! if ($result != false) {
! echo "<p>Table '$wpdb->links' created OK</p>\n";
! $got_links = true;
! }
! } else {
! echo "<p>Found table '$wpdb->links', don't need to create it...</p>\n";
! echo "<p>... may need to update it though. Looking for column link_updated...</p>\n";
! $query = "SELECT link_updated FROM $wpdb->links LIMIT 1";
! $q = @mysql_query($query);
! if ($q != false) {
! if ($row = mysql_fetch_object($q)) {
! echo "<p>You have column link_updated. Good!</p>\n";
! }
! } else {
! $query = "ALTER TABLE $wpdb->links ADD COLUMN link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'";
! $q = mysql_query($query) or mysql_doh("Doh, couldn't add column.", $query, mysql_error());
! echo "<p>Added column link_updated...</p>\n";
! }
! echo "<p>Looking for column link_rel...</p>\n";
! $query = "SELECT link_rel FROM $wpdb->links LIMIT 1";
! $q = @mysql_query($query);
! if ($q != false) {
! if ($row = mysql_fetch_object($q)) {
! echo "<p>You have column link_rel. Good!</p>\n";
! }
! } else {
! $query = "ALTER TABLE $wpdb->links ADD COLUMN link_rel varchar(255) NOT NULL DEFAULT '' ";
! $q = mysql_query($query) or mysql_doh("Doh, couldn't add column.", $query, mysql_error());
! echo "<p>Added column link_rel...</p>\n";
! }
! $got_links = true;
! }
!
! if ($got_links && $got_cats) {
! echo "<p>Looking for category 1...</p>\n";
! $sql = "SELECT * FROM $wpdb->linkcategories WHERE cat_id=1 ";
! $result = mysql_query($sql) or print ("Can't query '$wpdb->linkcategories'.<br />" . $sql . "<br />" . mysql_error());
! if ($result != false) {
! if ($row = mysql_fetch_object($result)) {
! echo "<p>You have at least 1 category. Good!</p>\n";
! $got_row = true;
! } else {
! echo "<p>Gonna insert category 1...</p>\n";
! $sql = "INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, 'General')";
! $result = mysql_query($sql) or print ("Can't query insert category.<br />" . $sql . "<br />" . mysql_error());
! if ($result != false) {
! echo "<p>Inserted category Ok</p>\n";
! $got_row = true;
! }
! }
! }
! }
!
! if ($got_row) {
! echo "<p>All done!</p>\n";
! }
! ?>
! <p>Did you defeat the boss monster at the end? Good, then you’re ready for
! <a href="import-b2.php?step=2">Step 2</a>.</p>
! <?php
! break;
! case 2:
! ?>
! <h1>Step 2</h1>
! <p>First we’re going to add excerpt, post, and password functionality...</p>
!
! <?php
!
! $query = "ALTER TABLE $wpdb->posts ADD COLUMN post_excerpt text NOT NULL;";
! $q = $wpdb->query($query);
! // 0.71 mods
! $query = "ALTER TABLE $wpdb->posts ADD post_status ENUM('publish','draft','private') NOT NULL,
! ADD comment_status ENUM('open','closed') NOT NULL,
! ADD ping_status ENUM('open','closed') NOT NULL,
! ADD post_password varchar(20) NOT NULL;";
! $q = $wpdb->query($query);
! ?>
!
! <p>That went well! Now let's clean up the b2 database structure a bit...</p>
!
! <?php
! $query = "ALTER TABLE $wpdb->posts DROP INDEX ID";
!
! $q = $wpdb->query($query);
!
! ?>
!
! <p>One down, two to go...</p>
!
!
! <p>So far so good.</p>
! <?php
!
! $query="ALTER TABLE $wpdb->posts DROP post_karma";
! $q = $wpdb->query($query);
! flush();
! ?>
!
! <p>Almost there...</p>
!
! <?php
!
! $query = "ALTER TABLE $wpdb->users DROP INDEX ID";
!
! $q = $wpdb->query($query);
! upgrade_all();
! ?>
!
! <p>Welcome to the family. <a href="../">Have fun</a>!</p>
! <?php
! break;
! }
! ?>
!
! </body>
</html>
\ No newline at end of file
Index: admin-footer.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-footer.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** admin-footer.php 11 Jun 2004 18:23:11 -0000 1.9
--- admin-footer.php 15 Jun 2004 23:24:35 -0000 1.10
***************
*** 1,9 ****
!
! <p id="footer"><strong><a href="http://wordpress.org/">WordPress</a></strong> <?php bloginfo('version'); ?> — <a href="http://wordpress.org/support/"><?php _e('Support Forums'); ?></a><br />
! <?php
! printf(__('%s seconds'), number_format(timer_stop(), 2));
! ?>
! </p>
! <?php do_action('admin_footer', ''); ?>
! </body>
</html>
\ No newline at end of file
--- 1,9 ----
!
! <p id="footer"><strong><a href="http://wordpress.org/">WordPress</a></strong> <?php bloginfo('version'); ?> — <a href="http://wordpress.org/support/"><?php _e('Support Forums'); ?></a><br />
! <?php
! printf(__('%s seconds'), number_format(timer_stop(), 2));
! ?>
! </p>
! <?php do_action('admin_footer', ''); ?>
! </body>
</html>
\ No newline at end of file
Index: options-discussion.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options-discussion.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** options-discussion.php 13 Jun 2004 16:14:57 -0000 1.17
--- options-discussion.php 15 Jun 2004 23:24:35 -0000 1.18
***************
*** 1,114 ****
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Discussion Options');
! $parent_file = 'options-general.php';
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone', 'option_group_id');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
! $standalone = 0;
! include_once('admin-header.php');
! include('options-head.php');
! ?>
!
! <div class="wrap">
! <h2><?php _e('Discussion Options') ?></h2>
! <form name="form1" method="post" action="options.php">
! <input type="hidden" name="action" value="update" />
! <input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_max_links','moderation_keys'" />
! <fieldset class="options">
! <legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend>
! <ul>
! <li>
! <label for="default_pingback_flag">
! <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> />
! <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>
! </li>
! <li>
! <label for="default_ping_status">
! <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> />
! <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>
! </li>
! <li>
! <label for="default_comment_status">
! <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> />
! <?php _e('Allow people to post comments on the article') ?></label>
! </li>
! </ul>
! </fieldset>
! <fieldset class="options">
! <legend><?php _e('E-mail me whenever:') ?></legend>
! <ul>
! <li>
! <label for="comments_notify">
! <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> />
! <?php _e('Anyone posts a comment') ?> </label>
! </li>
! <li>
! <label for="moderation_notify">
! <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> />
! <?php _e('A comment is approved or declined') ?> </label>
! </li>
! </ul>
! </fieldset>
! <fieldset class="options">
! <legend><?php _e('Before a comment appears:') ?></legend>
! <ul>
! <li>
! <label for="comment_moderation">
! <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> />
! <?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label>
! </li>
! <li>
! <label for="require_name_email">
! <input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> />
! <?php _e('User must fill out name and e-mail') ?> </label>
! </li>
! </ul>
! </fieldset>
! <fieldset class="options">
! <legend><?php _e('Comment Moderation') ?></legend>
! <p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_settings('comment_max_links'). '" />' ) ?></p>
!
! <p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://wiki.wordpress.org/index.php/SpamWords">Common spam words</a>.') ?></p>
! <p>
! <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php echo get_settings('moderation_keys'); ?></textarea>
! </p>
! </fieldset>
! <p class="submit">
! <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
! </p>
! </form>
! </div>
! <?php include("admin-footer.php") ?>
--- 1,114 ----
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Discussion Options');
! $parent_file = 'options-general.php';
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone', 'option_group_id');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
! $standalone = 0;
! include_once('admin-header.php');
! include('options-head.php');
! ?>
!
! <div class="wrap">
! <h2><?php _e('Discussion Options') ?></h2>
! <form name="form1" method="post" action="options.php">
! <input type="hidden" name="action" value="update" />
! <input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_max_links','moderation_keys'" />
! <fieldset class="options">
! <legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend>
! <ul>
! <li>
! <label for="default_pingback_flag">
! <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> />
! <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>
! </li>
! <li>
! <label for="default_ping_status">
! <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> />
! <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>
! </li>
! <li>
! <label for="default_comment_status">
! <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> />
! <?php _e('Allow people to post comments on the article') ?></label>
! </li>
! </ul>
! </fieldset>
! <fieldset class="options">
! <legend><?php _e('E-mail me whenever:') ?></legend>
! <ul>
! <li>
! <label for="comments_notify">
! <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> />
! <?php _e('Anyone posts a comment') ?> </label>
! </li>
! <li>
! <label for="moderation_notify">
! <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> />
! <?php _e('A comment is approved or declined') ?> </label>
! </li>
! </ul>
! </fieldset>
! <fieldset class="options">
! <legend><?php _e('Before a comment appears:') ?></legend>
! <ul>
! <li>
! <label for="comment_moderation">
! <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> />
! <?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label>
! </li>
! <li>
! <label for="require_name_email">
! <input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> />
! <?php _e('User must fill out name and e-mail') ?> </label>
! </li>
! </ul>
! </fieldset>
! <fieldset class="options">
! <legend><?php _e('Comment Moderation') ?></legend>
! <p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_settings('comment_max_links'). '" />' ) ?></p>
!
! <p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://wiki.wordpress.org/index.php/SpamWords">Common spam words</a>.') ?></p>
! <p>
! <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php echo get_settings('moderation_keys'); ?></textarea>
! </p>
! </fieldset>
! <p class="submit">
! <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
! </p>
! </form>
! </div>
! <?php include("admin-footer.php") ?>
Index: options-reading.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options-reading.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** options-reading.php 13 Jun 2004 16:14:57 -0000 1.11
--- options-reading.php 15 Jun 2004 23:24:35 -0000 1.12
***************
*** 1,102 ****
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Reading Options');
! $parent_file = 'options-general.php';
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone', 'option_group_id');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
! $standalone = 0;
! include_once('admin-header.php');
! include('options-head.php');
! ?>
!
! <div class="wrap">
! <h2><?php _e('Reading Options') ?></h2>
! <form name="form1" method="post" action="options.php">
! <input type="hidden" name="action" value="update" />
! <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />
! <fieldset class="options">
! <legend><?php _e('Front Page') ?></legend>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr valign="top">
! <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
! <td><input name="posts_per_page" type="text" id="posts_per_page" value="<?php echo get_settings('posts_per_page'); ?>" size="3" />
! <select name="what_to_show" id="what_to_show" >
! <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option>
! <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option>
! <option value="paged" <?php selected('paged', get_settings('what_to_show')); ?>><?php _e('posts paged') ?></option>
! </select> </td>
! </tr>
! </table>
! </fieldset>
!
! <fieldset class="options">
! <legend><?php _e('Syndication Feeds') ?></legend>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr valign="top">
! <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
! <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php echo get_settings('posts_per_rss'); ?>" size="3" />
! <?php _('posts') ?></td>
! </tr>
! <tr valign="top">
! <th scope="row"><?php _e('For each article, show:') ?> </th>
! <td><label>
! <input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> />
! <?php _e('full text') ?></label> <br>
! <label>
! <input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> />
! <?php _('summary') ?></label> </td>
! </tr>
! </table>
! </fieldset>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr valign="top">
! <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>
! <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" />
! <br />
! <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
! </tr>
! </table>
! <p>
! <label>
! <input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />
! <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
! </p>
! <p class="submit">
! <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
! </p>
! </form>
! </div>
! <?php include("admin-footer.php") ?>
--- 1,102 ----
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Reading Options');
! $parent_file = 'options-general.php';
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone', 'option_group_id');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
! $standalone = 0;
! include_once('admin-header.php');
! include('options-head.php');
! ?>
!
! <div class="wrap">
! <h2><?php _e('Reading Options') ?></h2>
! <form name="form1" method="post" action="options.php">
! <input type="hidden" name="action" value="update" />
! <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />
! <fieldset class="options">
! <legend><?php _e('Front Page') ?></legend>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr valign="top">
! <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
! <td><input name="posts_per_page" type="text" id="posts_per_page" value="<?php echo get_settings('posts_per_page'); ?>" size="3" />
! <select name="what_to_show" id="what_to_show" >
! <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option>
! <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option>
! <option value="paged" <?php selected('paged', get_settings('what_to_show')); ?>><?php _e('posts paged') ?></option>
! </select> </td>
! </tr>
! </table>
! </fieldset>
!
! <fieldset class="options">
! <legend><?php _e('Syndication Feeds') ?></legend>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr valign="top">
! <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
! <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php echo get_settings('posts_per_rss'); ?>" size="3" />
! <?php _('posts') ?></td>
! </tr>
! <tr valign="top">
! <th scope="row"><?php _e('For each article, show:') ?> </th>
! <td><label>
! <input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> />
! <?php _e('full text') ?></label> <br>
! <label>
! <input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> />
! <?php _('summary') ?></label> </td>
! </tr>
! </table>
! </fieldset>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr valign="top">
! <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>
! <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" />
! <br />
! <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
! </tr>
! </table>
! <p>
! <label>
! <input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />
! <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
! </p>
! <p class="submit">
! <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
! </p>
! </form>
! </div>
! <?php include("admin-footer.php") ?>
Index: import-greymatter.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/import-greymatter.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** import-greymatter.php 11 Jun 2004 18:23:12 -0000 1.15
--- import-greymatter.php 15 Jun 2004 23:24:35 -0000 1.16
***************
*** 1,341 ****
! <?php
!
! require_once('../wp-config.php');
! require('upgrade-functions.php');
!
! $wpvarstoreset = array('action', 'gmpath', 'archivespath');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
!
! switch ($action) {
!
! case "step1":
!
! function gm2autobr($string) { // transforms GM's |*| into b2's <br />\n
! $string = str_replace("|*|","<br />\n",$string);
! return($string);
! }
!
! if (!chdir($archivespath))
! die("Wrong path, $archivespath\ndoesn't exist\non the server");
!
! if (!chdir($gmpath))
! die("Wrong path, $gmpath\ndoesn't exist\non the server");
! ?>
! <html>
! <head>
! <title>GM 2 b2 - converting...</title>
! <link rel="stylesheet" href="wp-admin/b2.css" type="text/css">
! <style type="text/css">
! <!--
! <?php
! if (!preg_match("/Nav/",$HTTP_USER_AGENT)) {
! ?>
! textarea,input,select {
! background-color: #f0f0f0;
! border-width: 1px;
! border-color: #cccccc;
! border-style: solid;
! padding: 2px;
! margin: 1px;
! }
! <?php
! }
! ?>
! -->
! </style>
! </head>
! <body style="margin: 20px;">
! <p><font face="times new roman" style="font-size: 39px;">gm 2 <img src="../wp-images/wpminilogo.png" width="50" height="50" border="0" alt="WP" align="top" /></font></p>
! <p>The importer is running...</p>
! <ul>
! <li>importing users... <ul><?php
!
! chdir($gmpath);
! $userbase = file("gm-authors.cgi");
!
! $connexion = mysql_connect($server,$loginsql,$passsql) or die ("Oops, MySQL connection error ! Couldn't connect to $server with the username $loginsql");
! $bdd = mysql_select_db(DB_NAME,$connexion) or die ("Oops, can't find any database named DB_NAME here !");
!
! foreach($userbase as $user) {
! $userdata=explode("|", $user);
!
! $user_ip="127.0.0.1";
! $user_domain="localhost";
! $user_browser="server";
!
! $s=$userdata[4];
! $user_joindate=substr($s,6,4)."-".substr($s,0,2)."-".substr($s,3,2)." 00:00:00";
!
! $user_login=addslashes($userdata[0]);
! $pass1=addslashes($userdata[1]);
! $user_nickname=addslashes($userdata[0]);
! $user_email=addslashes($userdata[2]);
! $user_url=addslashes($userdata[3]);
! $user_joindate=addslashes($user_joindate);
!
! $loginthere = $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'");
! if ($loginthere) {
! echo "<li>user <i>$user_login</i>... <b>Already exists</b></li>";
! continue;
! }
!
! $query = "INSERT INTO $wpdb->users (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','1','nickname')";
! $result = mysql_query($query);
! if ($result==false) {
! die ("<strong>ERROR</strong>: couldn't register an user!");
! }
! echo "<li>user <i>$user_login</i>... <b>Done</b></li>";
!
! }
!
! ?></ul><b>Done</b></li>
! <li>importing posts, comments, and karma...<br /><ul><?php
!
! chdir($archivespath);
!
! for($i = 0; $i <= $lastentry; $i = $i + 1) {
!
! $entryfile = "";
!
! if ($i<10000000) {
! $entryfile .= "0";
! if ($i<1000000) {
! $entryfile .= "0";
! if ($i<100000) {
! $entryfile .= "0";
! if ($i<10000) {
! $entryfile .= "0";
! if ($i<1000) {
! $entryfile .= "0";
! if ($i<100) {
! $entryfile .= "0";
! if ($i<10) {
! $entryfile .= "0";
! }}}}}}}
!
! $entryfile .= "$i";
!
! if (is_file($entryfile.".cgi")) {
!
! $entry=file($entryfile.".cgi");
! echo "<li>entry # $entryfile ";
! $postinfo=explode("|",$entry[0]);
! $postmaincontent=gm2autobr($entry[2]);
! $postmorecontent=gm2autobr($entry[3]);
!
! $post_author=trim(addslashes($postinfo[1]));
! // we'll check the author is registered, or if it's a deleted author
! $sql = "SELECT * FROM $wpdb->users WHERE user_login = '$post_author'";
! $result = mysql_query($sql);
! if (!mysql_num_rows($result)) { // if deleted from GM, we register the author as a level 0 user in b2
! $user_ip="127.0.0.1";
! $user_domain="localhost";
! $user_browser="server";
! $user_joindate="1979-06-06 00:41:00";
! $user_login=addslashes($post_author);
! $pass1=addslashes("password");
! $user_nickname=addslashes($post_author);
! $user_email=addslashes("user at deleted.com");
! $user_url=addslashes("");
! $user_joindate=addslashes($user_joindate);
! $query = "INSERT INTO $wpdb->users (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','0','nickname')";
! $result = mysql_query($query);
! if ($result==false) {
! die ("<strong>ERROR</strong>: couldn't register an user!");
! }
! echo ": registered deleted user <i>$user_login</i> at level 0 ";
! }
!
! $sql = "SELECT * FROM $wpdb->users WHERE user_login = '$post_author'";
! $result = mysql_query($sql);
! $myrow = mysql_fetch_array($result);
! $post_author_ID=$myrow[0];
!
! $post_title=gm2autobr($postinfo[2]);
! $post_title=addslashes($post_title);
!
! $postyear=$postinfo[6];
! $postmonth=zeroise($postinfo[4],2);
! $postday=zeroise($postinfo[5],2);
! $posthour=zeroise($postinfo[7],2);
! $postminute=zeroise($postinfo[8],2);
! $postsecond=zeroise($postinfo[9],2);
!
! if (($postinfo[10]=="PM") && ($posthour!="12"))
! $posthour=$posthour+12;
!
! $post_date="$postyear-$postmonth-$postday $posthour:$postminute:$postsecond";
!
! $post_content=$postmaincontent;
! if (strlen($postmorecontent)>3)
! $post_content .= "<!--more--><br /><br />".$postmorecontent;
! $post_content=addslashes($post_content);
!
! $post_karma=$postinfo[12];
!
! $query = "INSERT INTO $wpdb->posts (post_author,post_date,post_content,post_title) VALUES ('$post_author_ID','$post_date','$post_content','$post_title')";
! $result = mysql_query($query) or die(mysql_error());
!
! if (!$result)
! die ("Error in posting...");
!
! $sql2 = "SELECT * FROM $wpdb->posts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
! $result2 = mysql_query($sql2);
! $myrow2 = mysql_fetch_array($result2);
! $post_ID=$myrow2[0];
!
! // Grab a default category.
! $post_category = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories LIMIT 1");
!
! // Update the post2cat table.
! $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_ID AND category_id = $post_category");
!
! if (!$exists) {
! $wpdb->query("
! INSERT INTO $wpdb->post2cat
! (post_id, category_id)
! VALUES
! ($post_ID, $post_category)
! ");
! }
!
! $c=count($entry);
! if ($c>4) {
! for ($j=4;$j<$c;$j++) {
! $entry[$j]=gm2autobr($entry[$j]);
! $commentinfo=explode("|",$entry[$j]);
! $comment_post_ID=$post_ID;
! $comment_author=addslashes($commentinfo[0]);
! $comment_author_email=addslashes($commentinfo[2]);
! $comment_author_url=addslashes($commentinfo[3]);
! $comment_author_IP=addslashes($commentinfo[1]);
!
! $commentyear=$commentinfo[7];
! $commentmonth=zeroise($commentinfo[5],2);
! $commentday=zeroise($commentinfo[6],2);
! $commenthour=zeroise($commentinfo[8],2);
! $commentminute=zeroise($commentinfo[9],2);
! $commentsecond=zeroise($commentinfo[10],2);
! if (($commentinfo[11]=="PM") && ($commenthour!="12"))
! $commenthour=$commenthour+12;
! $comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond";
!
! $comment_content=addslashes($commentinfo[12]);
!
! $sql3 = "INSERT INTO $wpdb->comments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content) VALUES ('$comment_post_ID','$comment_author','$comment_author_email','$comment_author_url','$comment_author_IP','$comment_date','$comment_content')";
! $result3 = mysql_query($sql3);
! if (!$result3)
! die ("There is an error with the database, it can't store your comment..");
! }
! $comments=$c-4;
! echo ": imported $comments comment";
! if ($comments>1)
! echo "s";
! }
! echo "... <b>Done</b></li>";
! }
! }
! upgrade_all();
! ?>
! </ul><b>Done</b></li></ul>
! <p> </p>
! <p>Completed GM 2 b2 import !</p>
! <p>Now you can go and <a href="wp-login.php">log in</a>, have fun !</p>
! <?php
! break;
!
!
!
!
!
!
! default:
!
! ?><html>
! <head>
! <title>GM 2 b2 importer utility</title>
! <link rel="stylesheet" href="wp-admin/b2.css" type="text/css">
! <style type="text/css">
! <!--
! <?php
! if (!preg_match("/Nav/",$HTTP_USER_AGENT)) {
! ?>
! textarea,input,select {
! background-color: #f0f0f0;
! border-width: 1px;
! border-color: #cccccc;
! border-style: solid;
! padding: 2px;
! margin: 1px;
! }
! <?php
! }
! ?>
! -->
! </style>
! </head>
! <body style="margin: 20px;">
! <p><font face="times new roman" style="font-size: 39px;">gm 2 <img src="../wp-images/wpminilogo.png" width="50" height="50" border="0" alt="WP" align="top" /></font></p>
! <p>This is a basic GreyMatter to WordPress import script.</p>
! <p>What it does:</p>
! <ul>
! <li>parses gm-authors.cgi to import authors: everyone is imported at level 1</li>
! <li>parses the entries cgi files to import posts, comments, and karma on posts (although karma is not used on WordPress yet)<br />if authors are found not to be in gm-authors.cgi, imports them at level 0</li>
! </ul>
! <p>What it does not:</p>
! <ul>
! <li>parse gm-counter.cgi (what's the use of that file ?), gm-banlist.cgi, gm-cplog.cgi (you can make a CP log hack if you really feel like it, but I question the need of a CP log)</li>
! <li>import gm-templates. you'll start with the basic template wp.php</li>
! <li>doesn't keep entries on top</li>
! </ul>
! <p> </p>
!
! <h3>First step: install WordPress</h3>
! <p>Install the WordPress blog as explained in the <a href="../readme.html" target="_blank">ReadMe</a>, then immediately come back here.</p>
!
! <form name="stepOne" method="get">
! <input type="hidden" name="action" value="step1" />
! <h3>Second step: GreyMatter details:</h3>
! <p><table cellpadding="0">
! <tr>
! <td>Path to GM files:</td>
! <td><input type="text" style="width:300px" name="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
! </tr>
! <tr>
! <td>Path to GM entries:</td>
! <td><input type="text" style="width:300px" name="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
! </tr>
! <tr>
! <td colspan="2"><br />This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)</td>
! </tr>
! <tr>
! <td>Last entry's number:</td>
! <td><input type="text" name="lastentry" value="00000001" /></td>
! </tr>
! </table>
! </p>
! <p>When you're ready, click OK to start importing: <input type="submit" name="submit" value="OK" class="search" /></p>
! </form>
!
! </body>
! </html>
! <?php
! break;
!
! }
!
?>
\ No newline at end of file
--- 1,341 ----
! <?php
!
! require_once('../wp-config.php');
! require('upgrade-functions.php');
!
! $wpvarstoreset = array('action', 'gmpath', 'archivespath');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
!
! switch ($action) {
!
! case "step1":
!
! function gm2autobr($string) { // transforms GM's |*| into b2's <br />\n
! $string = str_replace("|*|","<br />\n",$string);
! return($string);
! }
!
! if (!chdir($archivespath))
! die("Wrong path, $archivespath\ndoesn't exist\non the server");
!
! if (!chdir($gmpath))
! die("Wrong path, $gmpath\ndoesn't exist\non the server");
! ?>
! <html>
! <head>
! <title>GM 2 b2 - converting...</title>
! <link rel="stylesheet" href="wp-admin/b2.css" type="text/css">
! <style type="text/css">
! <!--
! <?php
! if (!preg_match("/Nav/",$HTTP_USER_AGENT)) {
! ?>
! textarea,input,select {
! background-color: #f0f0f0;
! border-width: 1px;
! border-color: #cccccc;
! border-style: solid;
! padding: 2px;
! margin: 1px;
! }
! <?php
! }
! ?>
! -->
! </style>
! </head>
! <body style="margin: 20px;">
! <p><font face="times new roman" style="font-size: 39px;">gm 2 <img src="../wp-images/wpminilogo.png" width="50" height="50" border="0" alt="WP" align="top" /></font></p>
! <p>The importer is running...</p>
! <ul>
! <li>importing users... <ul><?php
!
! chdir($gmpath);
! $userbase = file("gm-authors.cgi");
!
! $connexion = mysql_connect($server,$loginsql,$passsql) or die ("Oops, MySQL connection error ! Couldn't connect to $server with the username $loginsql");
! $bdd = mysql_select_db(DB_NAME,$connexion) or die ("Oops, can't find any database named DB_NAME here !");
!
! foreach($userbase as $user) {
! $userdata=explode("|", $user);
!
! $user_ip="127.0.0.1";
! $user_domain="localhost";
! $user_browser="server";
!
! $s=$userdata[4];
! $user_joindate=substr($s,6,4)."-".substr($s,0,2)."-".substr($s,3,2)." 00:00:00";
!
! $user_login=addslashes($userdata[0]);
! $pass1=addslashes($userdata[1]);
! $user_nickname=addslashes($userdata[0]);
! $user_email=addslashes($userdata[2]);
! $user_url=addslashes($userdata[3]);
! $user_joindate=addslashes($user_joindate);
!
! $loginthere = $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'");
! if ($loginthere) {
! echo "<li>user <i>$user_login</i>... <b>Already exists</b></li>";
! continue;
! }
!
! $query = "INSERT INTO $wpdb->users (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','1','nickname')";
! $result = mysql_query($query);
! if ($result==false) {
! die ("<strong>ERROR</strong>: couldn't register an user!");
! }
! echo "<li>user <i>$user_login</i>... <b>Done</b></li>";
!
! }
!
! ?></ul><b>Done</b></li>
! <li>importing posts, comments, and karma...<br /><ul><?php
!
! chdir($archivespath);
!
! for($i = 0; $i <= $lastentry; $i = $i + 1) {
!
! $entryfile = "";
!
! if ($i<10000000) {
! $entryfile .= "0";
! if ($i<1000000) {
! $entryfile .= "0";
! if ($i<100000) {
! $entryfile .= "0";
! if ($i<10000) {
! $entryfile .= "0";
! if ($i<1000) {
! $entryfile .= "0";
! if ($i<100) {
! $entryfile .= "0";
! if ($i<10) {
! $entryfile .= "0";
! }}}}}}}
!
! $entryfile .= "$i";
!
! if (is_file($entryfile.".cgi")) {
!
! $entry=file($entryfile.".cgi");
! echo "<li>entry # $entryfile ";
! $postinfo=explode("|",$entry[0]);
! $postmaincontent=gm2autobr($entry[2]);
! $postmorecontent=gm2autobr($entry[3]);
!
! $post_author=trim(addslashes($postinfo[1]));
! // we'll check the author is registered, or if it's a deleted author
! $sql = "SELECT * FROM $wpdb->users WHERE user_login = '$post_author'";
! $result = mysql_query($sql);
! if (!mysql_num_rows($result)) { // if deleted from GM, we register the author as a level 0 user in b2
! $user_ip="127.0.0.1";
! $user_domain="localhost";
! $user_browser="server";
! $user_joindate="1979-06-06 00:41:00";
! $user_login=addslashes($post_author);
! $pass1=addslashes("password");
! $user_nickname=addslashes($post_author);
! $user_email=addslashes("user at deleted.com");
! $user_url=addslashes("");
! $user_joindate=addslashes($user_joindate);
! $query = "INSERT INTO $wpdb->users (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','0','nickname')";
! $result = mysql_query($query);
! if ($result==false) {
! die ("<strong>ERROR</strong>: couldn't register an user!");
! }
! echo ": registered deleted user <i>$user_login</i> at level 0 ";
! }
!
! $sql = "SELECT * FROM $wpdb->users WHERE user_login = '$post_author'";
! $result = mysql_query($sql);
! $myrow = mysql_fetch_array($result);
! $post_author_ID=$myrow[0];
!
! $post_title=gm2autobr($postinfo[2]);
! $post_title=addslashes($post_title);
!
! $postyear=$postinfo[6];
! $postmonth=zeroise($postinfo[4],2);
! $postday=zeroise($postinfo[5],2);
! $posthour=zeroise($postinfo[7],2);
! $postminute=zeroise($postinfo[8],2);
! $postsecond=zeroise($postinfo[9],2);
!
! if (($postinfo[10]=="PM") && ($posthour!="12"))
! $posthour=$posthour+12;
!
! $post_date="$postyear-$postmonth-$postday $posthour:$postminute:$postsecond";
!
! $post_content=$postmaincontent;
! if (strlen($postmorecontent)>3)
! $post_content .= "<!--more--><br /><br />".$postmorecontent;
! $post_content=addslashes($post_content);
!
! $post_karma=$postinfo[12];
!
! $query = "INSERT INTO $wpdb->posts (post_author,post_date,post_content,post_title) VALUES ('$post_author_ID','$post_date','$post_content','$post_title')";
! $result = mysql_query($query) or die(mysql_error());
!
! if (!$result)
! die ("Error in posting...");
!
! $sql2 = "SELECT * FROM $wpdb->posts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
! $result2 = mysql_query($sql2);
! $myrow2 = mysql_fetch_array($result2);
! $post_ID=$myrow2[0];
!
! // Grab a default category.
! $post_category = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories LIMIT 1");
!
! // Update the post2cat table.
! $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_ID AND category_id = $post_category");
!
! if (!$exists) {
! $wpdb->query("
! INSERT INTO $wpdb->post2cat
! (post_id, category_id)
! VALUES
! ($post_ID, $post_category)
! ");
! }
!
! $c=count($entry);
! if ($c>4) {
! for ($j=4;$j<$c;$j++) {
! $entry[$j]=gm2autobr($entry[$j]);
! $commentinfo=explode("|",$entry[$j]);
! $comment_post_ID=$post_ID;
! $comment_author=addslashes($commentinfo[0]);
! $comment_author_email=addslashes($commentinfo[2]);
! $comment_author_url=addslashes($commentinfo[3]);
! $comment_author_IP=addslashes($commentinfo[1]);
!
! $commentyear=$commentinfo[7];
! $commentmonth=zeroise($commentinfo[5],2);
! $commentday=zeroise($commentinfo[6],2);
! $commenthour=zeroise($commentinfo[8],2);
! $commentminute=zeroise($commentinfo[9],2);
! $commentsecond=zeroise($commentinfo[10],2);
! if (($commentinfo[11]=="PM") && ($commenthour!="12"))
! $commenthour=$commenthour+12;
! $comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond";
!
! $comment_content=addslashes($commentinfo[12]);
!
! $sql3 = "INSERT INTO $wpdb->comments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content) VALUES ('$comment_post_ID','$comment_author','$comment_author_email','$comment_author_url','$comment_author_IP','$comment_date','$comment_content')";
! $result3 = mysql_query($sql3);
! if (!$result3)
! die ("There is an error with the database, it can't store your comment..");
! }
! $comments=$c-4;
! echo ": imported $comments comment";
! if ($comments>1)
! echo "s";
! }
! echo "... <b>Done</b></li>";
! }
! }
! upgrade_all();
! ?>
! </ul><b>Done</b></li></ul>
! <p> </p>
! <p>Completed GM 2 b2 import !</p>
! <p>Now you can go and <a href="wp-login.php">log in</a>, have fun !</p>
! <?php
! break;
!
!
!
!
!
!
! default:
!
! ?><html>
! <head>
! <title>GM 2 b2 importer utility</title>
! <link rel="stylesheet" href="wp-admin/b2.css" type="text/css">
! <style type="text/css">
! <!--
! <?php
! if (!preg_match("/Nav/",$HTTP_USER_AGENT)) {
! ?>
! textarea,input,select {
! background-color: #f0f0f0;
! border-width: 1px;
! border-color: #cccccc;
! border-style: solid;
! padding: 2px;
! margin: 1px;
! }
! <?php
! }
! ?>
! -->
! </style>
! </head>
! <body style="margin: 20px;">
! <p><font face="times new roman" style="font-size: 39px;">gm 2 <img src="../wp-images/wpminilogo.png" width="50" height="50" border="0" alt="WP" align="top" /></font></p>
! <p>This is a basic GreyMatter to WordPress import script.</p>
! <p>What it does:</p>
! <ul>
! <li>parses gm-authors.cgi to import authors: everyone is imported at level 1</li>
! <li>parses the entries cgi files to import posts, comments, and karma on posts (although karma is not used on WordPress yet)<br />if authors are found not to be in gm-authors.cgi, imports them at level 0</li>
! </ul>
! <p>What it does not:</p>
! <ul>
! <li>parse gm-counter.cgi (what's the use of that file ?), gm-banlist.cgi, gm-cplog.cgi (you can make a CP log hack if you really feel like it, but I question the need of a CP log)</li>
! <li>import gm-templates. you'll start with the basic template wp.php</li>
! <li>doesn't keep entries on top</li>
! </ul>
! <p> </p>
!
! <h3>First step: install WordPress</h3>
! <p>Install the WordPress blog as explained in the <a href="../readme.html" target="_blank">ReadMe</a>, then immediately come back here.</p>
!
! <form name="stepOne" method="get">
! <input type="hidden" name="action" value="step1" />
! <h3>Second step: GreyMatter details:</h3>
! <p><table cellpadding="0">
! <tr>
! <td>Path to GM files:</td>
! <td><input type="text" style="width:300px" name="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
! </tr>
! <tr>
! <td>Path to GM entries:</td>
! <td><input type="text" style="width:300px" name="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
! </tr>
! <tr>
! <td colspan="2"><br />This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)</td>
! </tr>
! <tr>
! <td>Last entry's number:</td>
! <td><input type="text" name="lastentry" value="00000001" /></td>
! </tr>
! </table>
! </p>
! <p>When you're ready, click OK to start importing: <input type="submit" name="submit" value="OK" class="search" /></p>
! </form>
!
! </body>
! </html>
! <?php
! break;
!
! }
!
?>
\ No newline at end of file
Index: install.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/install.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** install.php 11 Jun 2004 16:09:13 -0000 1.32
--- install.php 15 Jun 2004 23:24:35 -0000 1.33
***************
*** 1,764 ****
! <?php
! $_wp_installing = 1;
! if (!file_exists('../wp-config.php'))
! die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='wp-admin/setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.");
! require_once('../wp-config.php');
! require('upgrade-functions.php');
!
! if (isset($_GET['step']))
! $step = $_GET['step'];
! else
[...1501 lines suppressed...]
! // Do final updates
! upgrade_all();
! ?>
!
! <p>User setup successful!</p>
!
! <p>Now you can <a href="../wp-login.php">log in</a> with the <strong>login</strong>
! "<code>admin</code>" and <strong>password</strong> "<code><?php echo $random_password; ?></code>".</p>
! <p><strong><em>Note that password</em></strong> carefully! It is a <em>random</em>
! password that was generated just for you. If you lose it, you
! will have to delete the tables from the database yourself, and re-install WordPress.
! </p>
! <p>Were you expecting more steps? Sorry to disappoint. All done!</p>
! <?php
! break;
! }
! ?>
! </body>
</html>
\ No newline at end of file
Index: sidebar.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/sidebar.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** sidebar.php 11 Jun 2004 19:28:30 -0000 1.12
--- sidebar.php 15 Jun 2004 23:24:35 -0000 1.13
***************
*** 1,83 ****
! <?php
! $mode = 'sidebar';
!
! $standalone = 1;
! require_once('admin-header.php');
!
! get_currentuserinfo();
!
! if ($user_level == 0)
! die ("Cheatin' uh ?");
!
! if ('b' == $_GET['a']) {
!
! ?><!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">
! <head>
! <title>WordPress › Posted</title>
! <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
! <link rel="stylesheet" href="wp-admin.css" type="text/css" />
! </head>
! <body
! <p>Posted !</p>
! <p><a href="sidebar.php">Click here</a> to post again.</p>
! </body>
! </html><?php
!
! } else {
!
! ?><!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">
! <head>
! <title>WordPress › Sidebar</title>
! <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $blog_charset ?>" />
! <link rel="stylesheet" href="wp-admin.css" type="text/css" />
! <link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
! <style type="text/css" media="screen">
! form {
! padding: 3px;
! }
! .sidebar-categories {
! display: block;
! height: 6.6em;
! overflow: auto;
! background-color: #f4f4f4;
! }
! .sidebar-categories label {
! font-size: 10px;
! display: block;
! width: 90%;
! }
! </style>
! </head>
! <body id="sidebar">
! <h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
! <form name="post" action="post.php" method="POST">
! <div><input type="hidden" name="action" value="post" />
! <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
! <input type="hidden" name="mode" value="sidebar" />
! <p>Title:
! <input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" />
! </p>
! <p>Categories:
! <span class="sidebar-categories">
! <?php dropdown_categories(); ?>
! </span>
! </p>
! <p>
! Post:
! <textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea>
! </p>
! <p>
! <input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
! <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
!
! </p>
! </div>
! </form>
!
! </body>
! </html>
! <?php
! }
?>
\ No newline at end of file
--- 1,83 ----
! <?php
! $mode = 'sidebar';
!
! $standalone = 1;
! require_once('admin-header.php');
!
! get_currentuserinfo();
!
! if ($user_level == 0)
! die ("Cheatin' uh ?");
!
! if ('b' == $_GET['a']) {
!
! ?><!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">
! <head>
! <title>WordPress › Posted</title>
! <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
! <link rel="stylesheet" href="wp-admin.css" type="text/css" />
! </head>
! <body
! <p>Posted !</p>
! <p><a href="sidebar.php">Click here</a> to post again.</p>
! </body>
! </html><?php
!
! } else {
!
! ?><!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">
! <head>
! <title>WordPress › Sidebar</title>
! <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $blog_charset ?>" />
! <link rel="stylesheet" href="wp-admin.css" type="text/css" />
! <link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
! <style type="text/css" media="screen">
! form {
! padding: 3px;
! }
! .sidebar-categories {
! display: block;
! height: 6.6em;
! overflow: auto;
! background-color: #f4f4f4;
! }
! .sidebar-categories label {
! font-size: 10px;
! display: block;
! width: 90%;
! }
! </style>
! </head>
! <body id="sidebar">
! <h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
! <form name="post" action="post.php" method="POST">
! <div><input type="hidden" name="action" value="post" />
! <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
! <input type="hidden" name="mode" value="sidebar" />
! <p>Title:
! <input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" />
! </p>
! <p>Categories:
! <span class="sidebar-categories">
! <?php dropdown_categories(); ?>
! </span>
! </p>
! <p>
! Post:
! <textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea>
! </p>
! <p>
! <input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
! <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
!
! </p>
! </div>
! </form>
!
! </body>
! </html>
! <?php
! }
?>
\ No newline at end of file
Index: categories.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/categories.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** categories.php 11 Jun 2004 18:23:11 -0000 1.32
--- categories.php 15 Jun 2004 23:24:35 -0000 1.33
***************
*** 1,199 ****
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Categories');
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone','cat');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
! switch($action) {
!
! case 'addcat':
!
! $standalone = 1;
! require_once('admin-header.php');
!
! if ($user_level < 3)
! die (__('Cheatin’ uh?'));
!
! $cat_name= addslashes(stripslashes(stripslashes($_POST['cat_name'])));
! $category_nicename = sanitize_title($cat_name);
! $category_description = addslashes(stripslashes(stripslashes($_POST['category_description'])));
! $cat = intval($_POST['cat']);
!
! $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
!
! header('Location: categories.php?message=1#addcat');
!
! break;
!
! case 'Delete':
!
! $standalone = 1;
! require_once('admin-header.php');
!
! check_admin_referer();
!
! $cat_ID = intval($_GET["cat_ID"]);
! $cat_name = get_catname($cat_ID);
! $cat_name = addslashes($cat_name);
! $category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
! $cat_parent = $category->category_parent;
!
! if (1 == $cat_ID)
! die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name));
!
! if ($user_level < 3)
! die (__('Cheatin’ uh?'));
!
! $wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
! $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'");
! $wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'");
!
! header('Location: categories.php?message=2');
!
! break;
!
! case 'edit':
!
! require_once ('admin-header.php');
! $cat_ID = intval($_GET['cat_ID']);
! $category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
! $cat_name = stripslashes($category->cat_name);
! ?>
!
! <div class="wrap">
! <h2><?php _e('Edit Category') ?></h2>
! <form name="editcat" action="categories.php" method="post">
! <input type="hidden" name="action" value="editedcat" />
! <input type="hidden" name="cat_ID" value="<?php echo $_GET['cat_ID'] ?>" />
! <p><?php _e('Category name:') ?><br />
! <input type="text" name="cat_name" value="<?php echo $cat_name; ?>" /></p>
! <p><?php _e('Category parent:') ?><br />
! <select name='cat' class='postform'>
! <option value='0'<?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option>
! <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?>
! </select>
! </p>
!
! <p><?php _e('Description:') ?><br />
! <textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo htmlspecialchars($category->category_description, ENT_NOQUOTES); ?></textarea></p>
! <p class="submit"><input type="submit" name="submit" value="<?php _e('Edit category »') ?>" /></p>
! </form>
! </div>
!
! <?php
!
! break;
!
! case 'editedcat':
!
! $standalone = 1;
! require_once('admin-header.php');
!
! if ($user_level < 3)
! die (__('Cheatin’ uh?'));
!
! $cat_name = $wpdb->escape(stripslashes($_POST['cat_name']));
! $cat_ID = (int) $_POST['cat_ID'];
! $category_nicename = sanitize_title($cat_name);
! $category_description = $wpdb->escape(stripslashes($_POST['category_description']));
!
! $wpdb->query("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$cat' WHERE cat_ID = '$cat_ID'");
!
! header('Location: categories.php?message=3');
!
! break;
!
! default:
!
! $standalone = 0;
! require_once ('admin-header.php');
! if ($user_level < 3) {
! die(sprintf(__("You have no right to edit the categories for this blog.<br />Ask for a promotion to your <a href='mailto:%s'>blog admin</a>. :)"), get_settings('admin_email')));
! }
! $messages[1] = __('Category added.');
! $messages[2] = __('Category deleted.');
! $messages[3] = __('Category updated.');
! ?>
! <?php if (isset($_GET['message'])) : ?>
! <div class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
! <?php endif; ?>
!
! <div class="wrap">
! <h2><?php printf(__('Current Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2>
! <table width="100%" cellpadding="3" cellspacing="3">
! <tr>
! <th scope="col"><?php _e('ID') ?></th>
! <th scope="col"><?php _e('Name') ?></th>
! <th scope="col"><?php _e('Description') ?></th>
! <th scope="col"><?php _e('# Posts') ?></th>
! <th colspan="2"><?php _e('Action') ?></th>
! </tr>
! <?php
! cat_rows();
! ?>
! </table>
!
! </div>
!
! <div class="wrap">
! <p><?php printf(__('<strong>Note:</strong><br />
! Deleting a category does not delete posts from that category, it will just
! set them back to the default category <strong>%s</strong>.'), get_catname(1)) ?>
! </p>
! </div>
!
! <div class="wrap">
! <h2><?php _e('Add New Category') ?></h2>
! <form name="addcat" id="addcat" action="categories.php" method="post">
!
! <p><?php _e('Name:') ?><br />
! <input type="text" name="cat_name" value="" /></p>
! <p><?php _e('Category parent:') ?><br />
! <select name='cat' class='postform'>
! <option value='0'><?php _e('None') ?></option>
! <?php wp_dropdown_cats(0); ?>
! </select></p>
! <p><?php _e('Description: (optional)') ?> <br />
! <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
! <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php _e('Add Category »') ?>" /></p>
! </form>
! </div>
!
! <?php
! break;
! }
!
! include('admin-footer.php');
?>
\ No newline at end of file
--- 1,199 ----
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Categories');
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone','cat');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
! switch($action) {
!
! case 'addcat':
!
! $standalone = 1;
! require_once('admin-header.php');
!
! if ($user_level < 3)
! die (__('Cheatin’ uh?'));
!
! $cat_name= addslashes(stripslashes(stripslashes($_POST['cat_name'])));
! $category_nicename = sanitize_title($cat_name);
! $category_description = addslashes(stripslashes(stripslashes($_POST['category_description'])));
! $cat = intval($_POST['cat']);
!
! $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
!
! header('Location: categories.php?message=1#addcat');
!
! break;
!
! case 'Delete':
!
! $standalone = 1;
! require_once('admin-header.php');
!
! check_admin_referer();
!
! $cat_ID = intval($_GET["cat_ID"]);
! $cat_name = get_catname($cat_ID);
! $cat_name = addslashes($cat_name);
! $category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
! $cat_parent = $category->category_parent;
!
! if (1 == $cat_ID)
! die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name));
!
! if ($user_level < 3)
! die (__('Cheatin’ uh?'));
!
! $wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
! $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'");
! $wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'");
!
! header('Location: categories.php?message=2');
!
! break;
!
! case 'edit':
!
! require_once ('admin-header.php');
! $cat_ID = intval($_GET['cat_ID']);
! $category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
! $cat_name = stripslashes($category->cat_name);
! ?>
!
! <div class="wrap">
! <h2><?php _e('Edit Category') ?></h2>
! <form name="editcat" action="categories.php" method="post">
! <input type="hidden" name="action" value="editedcat" />
! <input type="hidden" name="cat_ID" value="<?php echo $_GET['cat_ID'] ?>" />
! <p><?php _e('Category name:') ?><br />
! <input type="text" name="cat_name" value="<?php echo $cat_name; ?>" /></p>
! <p><?php _e('Category parent:') ?><br />
! <select name='cat' class='postform'>
! <option value='0'<?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option>
! <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?>
! </select>
! </p>
!
! <p><?php _e('Description:') ?><br />
! <textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo htmlspecialchars($category->category_description, ENT_NOQUOTES); ?></textarea></p>
! <p class="submit"><input type="submit" name="submit" value="<?php _e('Edit category »') ?>" /></p>
! </form>
! </div>
!
! <?php
!
! break;
!
! case 'editedcat':
!
! $standalone = 1;
! require_once('admin-header.php');
!
! if ($user_level < 3)
! die (__('Cheatin’ uh?'));
!
! $cat_name = $wpdb->escape(stripslashes($_POST['cat_name']));
! $cat_ID = (int) $_POST['cat_ID'];
! $category_nicename = sanitize_title($cat_name);
! $category_description = $wpdb->escape(stripslashes($_POST['category_description']));
!
! $wpdb->query("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$cat' WHERE cat_ID = '$cat_ID'");
!
! header('Location: categories.php?message=3');
!
! break;
!
! default:
!
! $standalone = 0;
! require_once ('admin-header.php');
! if ($user_level < 3) {
! die(sprintf(__("You have no right to edit the categories for this blog.<br />Ask for a promotion to your <a href='mailto:%s'>blog admin</a>. :)"), get_settings('admin_email')));
! }
! $messages[1] = __('Category added.');
! $messages[2] = __('Category deleted.');
! $messages[3] = __('Category updated.');
! ?>
! <?php if (isset($_GET['message'])) : ?>
! <div class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
! <?php endif; ?>
!
! <div class="wrap">
! <h2><?php printf(__('Current Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2>
! <table width="100%" cellpadding="3" cellspacing="3">
! <tr>
! <th scope="col"><?php _e('ID') ?></th>
! <th scope="col"><?php _e('Name') ?></th>
! <th scope="col"><?php _e('Description') ?></th>
! <th scope="col"><?php _e('# Posts') ?></th>
! <th colspan="2"><?php _e('Action') ?></th>
! </tr>
! <?php
! cat_rows();
! ?>
! </table>
!
! </div>
!
! <div class="wrap">
! <p><?php printf(__('<strong>Note:</strong><br />
! Deleting a category does not delete posts from that category, it will just
! set them back to the default category <strong>%s</strong>.'), get_catname(1)) ?>
! </p>
! </div>
!
! <div class="wrap">
! <h2><?php _e('Add New Category') ?></h2>
! <form name="addcat" id="addcat" action="categories.php" method="post">
!
! <p><?php _e('Name:') ?><br />
! <input type="text" name="cat_name" value="" /></p>
! <p><?php _e('Category parent:') ?><br />
! <select name='cat' class='postform'>
! <option value='0'><?php _e('None') ?></option>
! <?php wp_dropdown_cats(0); ?>
! </select></p>
! <p><?php _e('Description: (optional)') ?> <br />
! <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
! <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php _e('Add Category »') ?>" /></p>
! </form>
! </div>
!
! <?php
! break;
! }
!
! include('admin-footer.php');
?>
\ No newline at end of file
Index: options-misc.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options-misc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** options-misc.php 13 Jun 2004 16:14:57 -0000 1.11
--- options-misc.php 15 Jun 2004 23:24:35 -0000 1.12
***************
*** 1,132 ****
! <?php
! require_once('../wp-includes/wp-l10n.php');
!
! $title = __('Miscellaneous Options');
! $parent_file = 'options-general.php';
!
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! if (is_array($v)) {
! $array[$k] = add_magic_quotes($v);
! } else {
! $array[$k] = addslashes($v);
! }
! }
! return $array;
! }
!
! if (!get_magic_quotes_gpc()) {
! $_GET = add_magic_quotes($_GET);
! $_POST = add_magic_quotes($_POST);
! $_COOKIE = add_magic_quotes($_COOKIE);
! }
!
! $wpvarstoreset = array('action','standalone', 'option_group_id');
! for ($i=0; $i<count($wpvarstoreset); $i += 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
!
! $standalone = 0;
! include_once('admin-header.php');
! include('options-head.php');
! ?>
!
! <div class="wrap">
! <h2><?php _e('Miscellaneous Options') ?></h2>
! <form name="form1" method="post" action="options.php">
! <input type="hidden" name="action" value="update" />
! <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','default_geourl_lat','default_geourl_lon','use_default_geourl'" />
! <fieldset class="options">
! <legend>
! <input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />
! <label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend>
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! <tr>
! <th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th>
! <td>
! <input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php echo get_settings('fileupload_realpath'); ?>" size="50" /><br />
! <?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?>
!
! </td>
!