[wp-cvs] wordpress/wp-admin bookmarklet.php, 1.9.4.1, 1.9.4.2 categories.php, 1.28.4.1, 1.28.4.2 edit.php, 1.21.4.1, 1.21.4.2 options.php, 1.20.4.1, 1.20.4.2 post.php, 1.59.4.3, 1.59.4.4

Mike Little mikelittle at users.sourceforge.net
Tue Oct 12 21:11:38 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7014/wp-admin

Modified Files:
      Tag: WordPress-Ver-1_2-Branch
	bookmarklet.php categories.php edit.php options.php post.php 
Log Message:
Fixed DOS line endings

Index: categories.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/categories.php,v
retrieving revision 1.28.4.1
retrieving revision 1.28.4.2
diff -C2 -d -r1.28.4.1 -r1.28.4.2
*** categories.php	6 Oct 2004 00:01:45 -0000	1.28.4.1
--- categories.php	12 Oct 2004 21:11:34 -0000	1.28.4.2
***************
*** 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&#8217; 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 $tablecategories (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 $tablecategories 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&#8217; uh?'));
! 
!     $wpdb->query("DELETE FROM $tablecategories WHERE cat_ID = '$cat_ID'");
!     $wpdb->query("UPDATE $tablecategories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'");
!     $wpdb->query("UPDATE $tablepost2cat 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 $tablecategories 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 $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'"; ?>>None</option>
!         <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?></p>
!         </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 &raquo;') ?>" /></p>
!     </form>
! </div>
! 
!     <?php
! 
! break;
! 
! case 'editedcat':
! 
!     $standalone = 1;
!     require_once('admin-header.php');
! 
!     if ($user_level < 3)
!         die (__('Cheatin&#8217; 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 $tablecategories 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(); ?></p>
!         </select>
!         <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 &raquo;') ?>" /></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&#8217; 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 $tablecategories (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 $tablecategories 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&#8217; uh?'));
! 
!     $wpdb->query("DELETE FROM $tablecategories WHERE cat_ID = '$cat_ID'");
!     $wpdb->query("UPDATE $tablecategories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'");
!     $wpdb->query("UPDATE $tablepost2cat 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 $tablecategories 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 $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'"; ?>>None</option>
!         <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?></p>
!         </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 &raquo;') ?>" /></p>
!     </form>
! </div>
! 
!     <?php
! 
! break;
! 
! case 'editedcat':
! 
!     $standalone = 1;
!     require_once('admin-header.php');
! 
!     if ($user_level < 3)
!         die (__('Cheatin&#8217; 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 $tablecategories 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(); ?></p>
!         </select>
!         <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 &raquo;') ?>" /></p>
!     </form>
! </div>
! 
!     <?php
! break;
! }
! 
! include('admin-footer.php');
  ?>
\ No newline at end of file

Index: options.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options.php,v
retrieving revision 1.20.4.1
retrieving revision 1.20.4.2
diff -C2 -d -r1.20.4.1 -r1.20.4.2
*** options.php	6 Oct 2004 00:01:45 -0000	1.20.4.1
--- options.php	12 Oct 2004 21:11:34 -0000	1.20.4.2
***************
*** 1,198 ****
! <?php
! $title = 'Options';
! $this_file = 'options.php';
! $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"];
! 		}
! 	}
! }
! if (isset($_GET['option_group_id'])) $option_group_id = (int) $_GET['option_group_id'];
! require_once('./optionhandler.php');
! $non_was_selected = 0;
! if ('' == $_GET['option_group_id']) {
!     $option_group_id = 1;
!     $non_was_selected = 1;
! }
! 
! switch($action) {
! 
! case 'update':
! 	$standalone = 1;
! 	include_once('./admin-header.php');
!     $any_changed = 0;
!     
!     // iterate through the list of options in this group
!     // pull the vars from the post
!     // validate ranges etc.
!     // update the values
! 	if (!$_POST['page_options']) {
! 		foreach ($_POST as $key => $value) {
! 			$option_names[] = "'$key'";
! 		}
! 		$option_names = implode(',', $option_names);
! 	} else {
! 		$option_names = stripslashes($_POST['page_options']);
! 	}
! 
!     $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)");
! //	die(var_dump($options));
! 
! // HACK
! // Options that if not there have 0 value but need to be something like "closed"
! $nonbools = array('default_ping_status', 'default_comment_status');
!     if ($options) {
!         foreach ($options as $option) {
!             // should we even bother checking?
!             if ($user_level >= $option->option_admin_level) {
!                 $old_val = stripslashes($option->option_value);
!                 $new_val = $_POST[$option->option_name];
! 				if (!$new_val) {
! 					if (3 == $option->option_type)
! 						$new_val = '';
! 					else
! 						$new_val = 0;
! 				}
! 				if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
!                 if ($new_val !== $old_val) {
! 					$query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_name = '$option->option_name'";
! 					$result = $wpdb->query($query);
! 					//if( in_array($option->option_name, $nonbools)) die('boo'.$query);
! 					if (!$result) {
! 						$db_errors .= sprintf(__(" SQL error while saving %s. "), $this_name);
! 					} else {
! 						++$any_changed;
! 					}
!                 }
!             }
!         } // end foreach
!         unset($cache_settings); // so they will be re-read
!         get_settings('siteurl'); // make it happen now
!     } // end if options
!     
!     if ($any_changed) {
!         $message = sprintf(__('%d setting(s) saved... '), $any_changed);
!     }
!     
!     if (($dB_errors != '') || ($validation_message != '')) {
!         if ($message != '') {
!             $message .= '<br />';
!         }
!         $message .= $dB_errors . '<br />' . $validation_message;
!     }
! 
! 	$referred = str_replace(array('&updated=true', '?updated=true') , '', $_SERVER['HTTP_REFERER']);
! 	 if (strstr($referred, '?')) $goback = $referred . '&updated=true';
! 	else $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
! 	$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
!     header('Location: ' . $goback);
!     break;
! 
! default:
! 	$standalone = 0;
! 	include_once("./admin-header.php");
! 	if ($user_level <= 6) {
! 		die(__("You have do not have sufficient permissions to edit the options for this blog."));
! 	}
! ?>
! 
! <?php
! if ($non_was_selected) { // no group pre-selected, display opening page
! ?>
! <div class="wrap">
! <dl>
! <?php
!     //iterate through the available option groups. output them as a definition list.
!     $option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $tableoptiongroups ORDER BY group_id");
!     foreach ($option_groups as $option_group) {
!         echo("  <dt><a href=\"$this_file?option_group_id={$option_group->group_id}\" title=\"{$option_group->group_desc}\">{$option_group->group_name}</a></dt>\n");
!         $current_long_desc = $option_group->group_longdesc;
!         if ($current_long_desc == '') {
!             $current_long_desc = __('No help for this group of options.');
!         }
!         echo("  <dd>{$option_group->group_desc}: $current_long_desc</dd>\n");
!     } // end for each group
! ?>
!   <dt><a href="options-permalink.php"><?php _e('Permalinks') ?></a></dt>
!   <dd><?php _e('Permanent link configuration') ?></dd>
! </dl>
! </div>
! <?php    
! 
! } else { //there was a group selected.
! include('options-head.php');
! ?>
! 
! <div class="wrap">
!   <h2><?php echo $current_desc; ?></h2>
!   <form name="form" action="<?php echo $this_file; ?>" method="post">
!   <input type="hidden" name="action" value="update" />
!   <input type="hidden" name="option_group_id" value="<?php echo $option_group_id; ?>" />
!   <table width="90%" cellpadding="2" cellspacing="2" border="0">
! <?php
! //Now display all the options for the selected group.
! if ('all' == $_GET['option_group_id']) :
! $options = $wpdb->get_results("SELECT * FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id ORDER BY option_name");
! else :
! $options = $wpdb->get_results("
! SELECT 
! $tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level 
! FROM $tableoptions  LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id
! WHERE group_id = $option_group_id
! ORDER BY seq
! ");
! endif;
! 
! foreach ($options as $option) :
! 	if ('all' == $_GET['option_group_id']) $option->option_type = 3;
! 	echo "\t<tr><td width='10%' valign='top'>" . get_option_widget($option, ($user_level >= $option->option_admin_level), '</td><td width="15%" valign="top" style="border: 1px solid #ccc">');
! 	echo "\t</td><td  valign='top' class='helptext'>$option->option_description</td></tr>\n";
! endforeach;
! ?>
!   </table>
! <p class="submit"><input type="submit" name="Update" value="<?php _e('Update Settings &raquo;') ?>" /></p>
!   </form>
! </div>
! 
! <div class="wrap">
! <?php
! if ($current_long_desc != '') {
! 	echo $current_long_desc;
! }
! ?>
! </div>
! <?php
! } // end else a group was selected
! break;
! } // end switch
! 
! include('admin-footer.php');
! ?>
--- 1,198 ----
! <?php
! $title = 'Options';
! $this_file = 'options.php';
! $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"];
! 		}
! 	}
! }
! if (isset($_GET['option_group_id'])) $option_group_id = (int) $_GET['option_group_id'];
! require_once('./optionhandler.php');
! $non_was_selected = 0;
! if ('' == $_GET['option_group_id']) {
!     $option_group_id = 1;
!     $non_was_selected = 1;
! }
! 
! switch($action) {
! 
! case 'update':
! 	$standalone = 1;
! 	include_once('./admin-header.php');
!     $any_changed = 0;
!     
!     // iterate through the list of options in this group
!     // pull the vars from the post
!     // validate ranges etc.
!     // update the values
! 	if (!$_POST['page_options']) {
! 		foreach ($_POST as $key => $value) {
! 			$option_names[] = "'$key'";
! 		}
! 		$option_names = implode(',', $option_names);
! 	} else {
! 		$option_names = stripslashes($_POST['page_options']);
! 	}
! 
!     $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)");
! //	die(var_dump($options));
! 
! // HACK
! // Options that if not there have 0 value but need to be something like "closed"
! $nonbools = array('default_ping_status', 'default_comment_status');
!     if ($options) {
!         foreach ($options as $option) {
!             // should we even bother checking?
!             if ($user_level >= $option->option_admin_level) {
!                 $old_val = stripslashes($option->option_value);
!                 $new_val = $_POST[$option->option_name];
! 				if (!$new_val) {
! 					if (3 == $option->option_type)
! 						$new_val = '';
! 					else
! 						$new_val = 0;
! 				}
! 				if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
!                 if ($new_val !== $old_val) {
! 					$query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_name = '$option->option_name'";
! 					$result = $wpdb->query($query);
! 					//if( in_array($option->option_name, $nonbools)) die('boo'.$query);
! 					if (!$result) {
! 						$db_errors .= sprintf(__(" SQL error while saving %s. "), $this_name);
! 					} else {
! 						++$any_changed;
! 					}
!                 }
!             }
!         } // end foreach
!         unset($cache_settings); // so they will be re-read
!         get_settings('siteurl'); // make it happen now
!     } // end if options
!     
!     if ($any_changed) {
!         $message = sprintf(__('%d setting(s) saved... '), $any_changed);
!     }
!     
!     if (($dB_errors != '') || ($validation_message != '')) {
!         if ($message != '') {
!             $message .= '<br />';
!         }
!         $message .= $dB_errors . '<br />' . $validation_message;
!     }
! 
! 	$referred = str_replace(array('&updated=true', '?updated=true') , '', $_SERVER['HTTP_REFERER']);
! 	 if (strstr($referred, '?')) $goback = $referred . '&updated=true';
! 	else $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
! 	$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
!     header('Location: ' . $goback);
!     break;
! 
! default:
! 	$standalone = 0;
! 	include_once("./admin-header.php");
! 	if ($user_level <= 6) {
! 		die(__("You have do not have sufficient permissions to edit the options for this blog."));
! 	}
! ?>
! 
! <?php
! if ($non_was_selected) { // no group pre-selected, display opening page
! ?>
! <div class="wrap">
! <dl>
! <?php
!     //iterate through the available option groups. output them as a definition list.
!     $option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $tableoptiongroups ORDER BY group_id");
!     foreach ($option_groups as $option_group) {
!         echo("  <dt><a href=\"$this_file?option_group_id={$option_group->group_id}\" title=\"{$option_group->group_desc}\">{$option_group->group_name}</a></dt>\n");
!         $current_long_desc = $option_group->group_longdesc;
!         if ($current_long_desc == '') {
!             $current_long_desc = __('No help for this group of options.');
!         }
!         echo("  <dd>{$option_group->group_desc}: $current_long_desc</dd>\n");
!     } // end for each group
! ?>
!   <dt><a href="options-permalink.php"><?php _e('Permalinks') ?></a></dt>
!   <dd><?php _e('Permanent link configuration') ?></dd>
! </dl>
! </div>
! <?php    
! 
! } else { //there was a group selected.
! include('options-head.php');
! ?>
! 
! <div class="wrap">
!   <h2><?php echo $current_desc; ?></h2>
!   <form name="form" action="<?php echo $this_file; ?>" method="post">
!   <input type="hidden" name="action" value="update" />
!   <input type="hidden" name="option_group_id" value="<?php echo $option_group_id; ?>" />
!   <table width="90%" cellpadding="2" cellspacing="2" border="0">
! <?php
! //Now display all the options for the selected group.
! if ('all' == $_GET['option_group_id']) :
! $options = $wpdb->get_results("SELECT * FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id ORDER BY option_name");
! else :
! $options = $wpdb->get_results("
! SELECT 
! $tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level 
! FROM $tableoptions  LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id
! WHERE group_id = $option_group_id
! ORDER BY seq
! ");
! endif;
! 
! foreach ($options as $option) :
! 	if ('all' == $_GET['option_group_id']) $option->option_type = 3;
! 	echo "\t<tr><td width='10%' valign='top'>" . get_option_widget($option, ($user_level >= $option->option_admin_level), '</td><td width="15%" valign="top" style="border: 1px solid #ccc">');
! 	echo "\t</td><td  valign='top' class='helptext'>$option->option_description</td></tr>\n";
! endforeach;
! ?>
!   </table>
! <p class="submit"><input type="submit" name="Update" value="<?php _e('Update Settings &raquo;') ?>" /></p>
!   </form>
! </div>
! 
! <div class="wrap">
! <?php
! if ($current_long_desc != '') {
! 	echo $current_long_desc;
! }
! ?>
! </div>
! <?php
! } // end else a group was selected
! break;
! } // end switch
! 
! include('admin-footer.php');
! ?>

Index: post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
retrieving revision 1.59.4.3
retrieving revision 1.59.4.4
diff -C2 -d -r1.59.4.3 -r1.59.4.4
*** post.php	6 Oct 2004 00:01:46 -0000	1.59.4.3
--- post.php	12 Oct 2004 21:11:34 -0000	1.59.4.4
***************
*** 1,812 ****
! <?php
! /* <Edit> */
! 
! require_once('../wp-includes/wp-l10n.php');
! 
! function add_magic_quotes($array) {
! foreach ($array as $k => $v) {
! 	if (is_array($v)) {
! 		$array[$k] = add_magic_quotes($v);
! 	} else {
[...1595 lines suppressed...]
! </div>
! <?php
! 	} else {
! 
! 
! ?>
! <div class="wrap">
! 	  <?php printf(__('<p>Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post blog items.<br />
! You can also <a href="mailto:%s?subject=Blog posting permission">e-mail the admin</a> to ask for a promotion.<br />
! When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)</p>'), get_settings('admin_email')); ?>
! </div>
! <?php
! 
! 	}
! 
! 	break;
! } // end switch
! /* </Edit> */
! include('admin-footer.php');
! ?>

Index: bookmarklet.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/bookmarklet.php,v
retrieving revision 1.9.4.1
retrieving revision 1.9.4.2
diff -C2 -d -r1.9.4.1 -r1.9.4.2
*** bookmarklet.php	6 Oct 2004 00:01:45 -0000	1.9.4.1
--- bookmarklet.php	12 Oct 2004 21:11:34 -0000	1.9.4.2
***************
*** 1,131 ****
! <?php
! /* <Bookmarklet> */
! 
! // accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King
! 
! $mode = 'bookmarklet';
! 
! $standalone = 1;
! require_once('admin-header.php');
! 
! if ($user_level == 0)
! 	die ("Cheatin' uh?");
! 
! if ('b' == $a) {
! 
! ?><html>
! <head>
! <script language="javascript" type="text/javascript">
! <!--
! window.close()
! -->
! </script>
! </head>
! <body></body>
! </html><?php
! 
! } else {
! 
!     $popuptitle = htmlspecialchars(stripslashes($popuptitle));
!     $text = htmlspecialchars(stripslashes($text));
!     
!     /* big funky fixes for browsers' javascript bugs */
!     
!     if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
!         $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle);
!         $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text);
!     }
!     
!     if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
!         $popuptitle =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
!         $text =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $text);
!     }
!     
!     if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
!         $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle);
!         $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text);
!     }
!     
!     $post_title = $_REQUEST['post_title'];
!     if (!empty($post_title)) {
!         $post_title =  stripslashes($post_title);
!     } else {
!         $post_title = $popuptitle;
!     }
! // I'm not sure why we're using $edited_post_title in the edit-form.php, but we are
! // and that is what is being included below. For this reason, I am just duplicating
! // the var instead of changing the assignment on the lines above. 
! // -- Alex King 2004-01-07
!     $edited_post_title = htmlspecialchars($post_title);
!     
!     $content = $_REQUEST['content'];
!     if (!empty($content)) {
!         $content =  stripslashes($content);
!     } else {
!         $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
!     }
!     
!     /* /big funky fixes */
! 
! ?><!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 > Bookmarklet</title>
! <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
! <link rel="stylesheet" href="wp-admin.css" type="text/css" />
! <link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
! <script type="text/javascript" language="javascript">
! <!--
! function launchupload() {
! 	window.open ("upload.php", "wpupload", "width=380,height=360,location=0,menubar=0,resizable=1,scrollbars=yes,status=1,toolbar=0");
! }
! 
! //-->
! </script>
! <style type="text/css">
! <!--
! 
! #wpbookmarklet textarea,input,select {
! 	border-width: 1px;
! 	border-color: #cccccc;
! 	border-style: solid;
! 	padding: 2px;
! 	margin: 1px;
! }
! 
! #wpbookmarklet .checkbox {
! 	background-color: #ffffff;
! 	border-width: 0px;
! 	padding: 0px;
! 	margin: 0px;
! }
! 
! #wpbookmarklet textarea {
! 	font-family: Verdana, Geneva, Arial, Helvetica;
! 	font-size: 0.9em;
! }
! 
! #wpbookmarklet .wrap {
!     border: 0px;
! }
! 
! #wpbookmarklet #postdiv {
!     margin-bottom: 0.5em;
! }
! 
! #wpbookmarklet #titlediv {
!     margin-bottom: 1em;
! }
! 
! -->
! </style>
! </head>
! <body id="wpbookmarklet">
! <h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
! 
! <?php require('edit-form.php'); ?>
! 
! </body>
! </html><?php
! }
! ?>
--- 1,131 ----
! <?php
! /* <Bookmarklet> */
! 
! // accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King
! 
! $mode = 'bookmarklet';
! 
! $standalone = 1;
! require_once('admin-header.php');
! 
! if ($user_level == 0)
! 	die ("Cheatin' uh?");
! 
! if ('b' == $a) {
! 
! ?><html>
! <head>
! <script language="javascript" type="text/javascript">
! <!--
! window.close()
! -->
! </script>
! </head>
! <body></body>
! </html><?php
! 
! } else {
! 
!     $popuptitle = htmlspecialchars(stripslashes($popuptitle));
!     $text = htmlspecialchars(stripslashes($text));
!     
!     /* big funky fixes for browsers' javascript bugs */
!     
!     if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
!         $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle);
!         $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text);
!     }
!     
!     if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
!         $popuptitle =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
!         $text =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $text);
!     }
!     
!     if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
!         $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle);
!         $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text);
!     }
!     
!     $post_title = $_REQUEST['post_title'];
!     if (!empty($post_title)) {
!         $post_title =  stripslashes($post_title);
!     } else {
!         $post_title = $popuptitle;
!     }
! // I'm not sure why we're using $edited_post_title in the edit-form.php, but we are
! // and that is what is being included below. For this reason, I am just duplicating
! // the var instead of changing the assignment on the lines above. 
! // -- Alex King 2004-01-07
!     $edited_post_title = htmlspecialchars($post_title);
!     
!     $content = $_REQUEST['content'];
!     if (!empty($content)) {
!         $content =  stripslashes($content);
!     } else {
!         $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
!     }
!     
!     /* /big funky fixes */
! 
! ?><!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 > Bookmarklet</title>
! <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
! <link rel="stylesheet" href="wp-admin.css" type="text/css" />
! <link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
! <script type="text/javascript" language="javascript">
! <!--
! function launchupload() {
! 	window.open ("upload.php", "wpupload", "width=380,height=360,location=0,menubar=0,resizable=1,scrollbars=yes,status=1,toolbar=0");
! }
! 
! //-->
! </script>
! <style type="text/css">
! <!--
! 
! #wpbookmarklet textarea,input,select {
! 	border-width: 1px;
! 	border-color: #cccccc;
! 	border-style: solid;
! 	padding: 2px;
! 	margin: 1px;
! }
! 
! #wpbookmarklet .checkbox {
! 	background-color: #ffffff;
! 	border-width: 0px;
! 	padding: 0px;
! 	margin: 0px;
! }
! 
! #wpbookmarklet textarea {
! 	font-family: Verdana, Geneva, Arial, Helvetica;
! 	font-size: 0.9em;
! }
! 
! #wpbookmarklet .wrap {
!     border: 0px;
! }
! 
! #wpbookmarklet #postdiv {
!     margin-bottom: 0.5em;
! }
! 
! #wpbookmarklet #titlediv {
!     margin-bottom: 1em;
! }
! 
! -->
! </style>
! </head>
! <body id="wpbookmarklet">
! <h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
! 
! <?php require('edit-form.php'); ?>
! 
! </body>
! </html><?php
! }
! ?>

Index: edit.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit.php,v
retrieving revision 1.21.4.1
retrieving revision 1.21.4.2
diff -C2 -d -r1.21.4.1 -r1.21.4.2
*** edit.php	6 Oct 2004 00:01:45 -0000	1.21.4.1
--- edit.php	12 Oct 2004 21:11:34 -0000	1.21.4.2
***************
*** 1,179 ****
! <?php
! require_once('../wp-includes/wp-l10n.php');
! 
! $title = __('Posts');
! require_once('admin-header.php');
! 
! ?>
!  <ul id="adminmenu2"> 
!   <li><a href="edit.php" class="current"><?php _e('Posts') ?></a></li> 
!   <li><a href="edit-comments.php"><?php _e('Comments') ?></a></li> 
!   <li class="last"><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li> 
! </ul> 
! <?php
! get_currentuserinfo();
! $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
! if ($drafts) {
! 	?> 
! <div class="wrap"> 
!     <p><strong><?php _e('Your Drafts:') ?></strong> 
!     <?php
! 	$i = 0;
! 	foreach ($drafts as $draft) {
! 		if (0 != $i)
! 			echo ', ';
! 		$draft->post_title = stripslashes($draft->post_title);
! 		if ($draft->post_title == '')
! 			$draft->post_title = sprintf(__('Post #%s'), $draft->ID);
! 		echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
! 		++$i;
! 		}
! 	?> 
!     .</p> 
! </div> 
! <?php
! }
! ?> 
! <div class="wrap"> 
! <?php
! if( isset( $_GET['m'] ) )
! {
! 	echo '<h2>' . $month[substr( $_GET['m'], 4, 2 )]." ".substr( $_GET['m'], 0, 4 )."</h2>";
! }
! ?>
! 
! <form name="viewarc" action="" method="get" style="float: left; width: 20em;">
! 	<fieldset>
! 	<legend><?php _e('Show Posts From Month of...') ?></legend>
!     <select name='m'>
! 	<?php
! 		$arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $tableposts ORDER BY post_date DESC");
! 		foreach ($arc_result as $arc_row) {			
! 			$arc_year  = $arc_row->yyear;
! 			$arc_month = $arc_row->mmonth;
! 			
! 			if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == $_GET['m'] )
! 				$default = 'selected="selected"';
! 			else
! 				$default = null;
! 			
! 			echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">';
! 			echo $month[zeroise($arc_month, 2)] . " $arc_year";
! 			echo "</option>\n";
! 		}
! 	?>
! 	</select>
! 		<input type="submit" name="submit" value="<?php _e('Show Month') ?>"  /> 
! 	</fieldset>
! </form>
! <form name="searchform" action="" method="get" style="float: left; width: 20em; margin-left: 3em;"> 
!   <fieldset> 
!   <legend><?php _e('Show Posts That Contain...') ?></legend> 
!   <input type="text" name="s" value="<?php if (isset($s)) echo htmlspecialchars($s); ?>" size="17" /> 
!   <input type="submit" name="submit" value="<?php _e('Search') ?>"  /> 
!   </fieldset>
! </form>
! 
! <br style="clear:both;" />
! 
! <table width="100%" cellpadding="3" cellspacing="3"> 
!   <tr> 
!     <th scope="col"><?php _e('ID') ?></th> 
!     <th scope="col"><?php _e('When') ?></th> 
!     <th scope="col"><?php _e('Title') ?></th> 
!     <th scope="col"><?php _e('Categories') ?></th> 
!     <th scope="col"><?php _e('Comments') ?></th> 
!     <th scope="col"><?php _e('Author') ?></th> 
!     <th scope="col"><?php _e('Edit') ?></th> 
!     <th scope="col"><?php _e('Delete') ?></th> 
!   </tr> 
! <?php
! if (empty($m)) $showposts = 15;
! include(ABSPATH.'wp-blog-header.php');
! 
! if ($posts) {
! $bgcolor = '';
! foreach ($posts as $post) { start_wp();
! $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
! ?> 
!   <tr style='background-color: <?php echo $bgcolor; ?>'> 
!     <th scope="row"><?php echo $id ?></th> 
!     <td><?php the_time('Y-m-d \<\b\r \/\> g:i:s a'); ?></td> 
!     <td><a href="<?php the_permalink(); ?>" rel="permalink"> 
!       <?php the_title() ?> 
!       </a> 
!     <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td> 
!     <td><?php the_category(','); ?></td> 
!     <td><a href="edit.php?p=<?php echo $id ?>&c=1"> 
!       <?php comments_number(__('no comments'), __('1 comment'), __("% comments")) ?> 
!       </a></td> 
!     <td><?php the_author() ?></td> 
!     <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 
!     <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td> 
!   </tr> 
! <?php
! }
! } else {
! ?>
!   <tr style='background-color: <?php echo $bgcolor; ?>'> 
!     <td colspan="8"><?php _e('No posts found.') ?></td> 
!   </tr> 
! <?php
! } // end if ($posts)
! ?> 
! </table> 
! <?php
! if ( 1 == count($posts) ) {
! 
! 	$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
! 	if ($comments) {
! 	?> 
! <h3><?php _e('Comments') ?></h3> 
! <ol id="comments"> 
! <?php
! foreach ($comments as $comment) {
! $comment_status = wp_get_comment_status($comment->comment_ID);
! ?> 
! 
! <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
!   <?php comment_date('Y-n-j') ?> 
!   @
!   <?php comment_time('g:m:s a') ?> 
!   <?php 
! 			if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) {
! 				echo "[ <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" .  __('Edit') . "</a>";
! 				echo " - <a href=\"post.php?action=deletecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> ";
! 				if ( ('none' != $comment_status) && ($user_level >= 3) ) {
! 					if ('approved' == wp_get_comment_status($comment->comment_ID)) {
! 						echo " - <a href=\"post.php?action=unapprovecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> ";
! 					} else {
! 						echo " - <a href=\"post.php?action=approvecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Approve') . "</a> ";
! 					}
! 				}
! 				echo "]";
! 			} // end if any comments to show
! 			?> 
!   <br /> 
!   <strong> 
!   <?php comment_author() ?> 
!   (
!   <?php comment_author_email_link() ?> 
!   /
!   <?php comment_author_url_link() ?> 
!   )</strong> (IP:
!   <?php comment_author_IP() ?> 
!   )
!   <?php comment_text() ?> 
! 
! </li> 
! <!-- /comment --> 
! <?php //end of the loop, don't delete
! 		} // end foreach
! 	echo '</ol>';
! 	}//end if comments
! 	?>
! <?php } ?> 
! </div> 
! <?php 
!  include('admin-footer.php');
! ?> 
--- 1,179 ----
! <?php
! require_once('../wp-includes/wp-l10n.php');
! 
! $title = __('Posts');
! require_once('admin-header.php');
! 
! ?>
!  <ul id="adminmenu2"> 
!   <li><a href="edit.php" class="current"><?php _e('Posts') ?></a></li> 
!   <li><a href="edit-comments.php"><?php _e('Comments') ?></a></li> 
!   <li class="last"><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li> 
! </ul> 
! <?php
! get_currentuserinfo();
! $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
! if ($drafts) {
! 	?> 
! <div class="wrap"> 
!     <p><strong><?php _e('Your Drafts:') ?></strong> 
!     <?php
! 	$i = 0;
! 	foreach ($drafts as $draft) {
! 		if (0 != $i)
! 			echo ', ';
! 		$draft->post_title = stripslashes($draft->post_title);
! 		if ($draft->post_title == '')
! 			$draft->post_title = sprintf(__('Post #%s'), $draft->ID);
! 		echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
! 		++$i;
! 		}
! 	?> 
!     .</p> 
! </div> 
! <?php
! }
! ?> 
! <div class="wrap"> 
! <?php
! if( isset( $_GET['m'] ) )
! {
! 	echo '<h2>' . $month[substr( $_GET['m'], 4, 2 )]." ".substr( $_GET['m'], 0, 4 )."</h2>";
! }
! ?>
! 
! <form name="viewarc" action="" method="get" style="float: left; width: 20em;">
! 	<fieldset>
! 	<legend><?php _e('Show Posts From Month of...') ?></legend>
!     <select name='m'>
! 	<?php
! 		$arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $tableposts ORDER BY post_date DESC");
! 		foreach ($arc_result as $arc_row) {			
! 			$arc_year  = $arc_row->yyear;
! 			$arc_month = $arc_row->mmonth;
! 			
! 			if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == $_GET['m'] )
! 				$default = 'selected="selected"';
! 			else
! 				$default = null;
! 			
! 			echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">';
! 			echo $month[zeroise($arc_month, 2)] . " $arc_year";
! 			echo "</option>\n";
! 		}
! 	?>
! 	</select>
! 		<input type="submit" name="submit" value="<?php _e('Show Month') ?>"  /> 
! 	</fieldset>
! </form>
! <form name="searchform" action="" method="get" style="float: left; width: 20em; margin-left: 3em;"> 
!   <fieldset> 
!   <legend><?php _e('Show Posts That Contain...') ?></legend> 
!   <input type="text" name="s" value="<?php if (isset($s)) echo htmlspecialchars($s); ?>" size="17" /> 
!   <input type="submit" name="submit" value="<?php _e('Search') ?>"  /> 
!   </fieldset>
! </form>
! 
! <br style="clear:both;" />
! 
! <table width="100%" cellpadding="3" cellspacing="3"> 
!   <tr> 
!     <th scope="col"><?php _e('ID') ?></th> 
!     <th scope="col"><?php _e('When') ?></th> 
!     <th scope="col"><?php _e('Title') ?></th> 
!     <th scope="col"><?php _e('Categories') ?></th> 
!     <th scope="col"><?php _e('Comments') ?></th> 
!     <th scope="col"><?php _e('Author') ?></th> 
!     <th scope="col"><?php _e('Edit') ?></th> 
!     <th scope="col"><?php _e('Delete') ?></th> 
!   </tr> 
! <?php
! if (empty($m)) $showposts = 15;
! include(ABSPATH.'wp-blog-header.php');
! 
! if ($posts) {
! $bgcolor = '';
! foreach ($posts as $post) { start_wp();
! $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
! ?> 
!   <tr style='background-color: <?php echo $bgcolor; ?>'> 
!     <th scope="row"><?php echo $id ?></th> 
!     <td><?php the_time('Y-m-d \<\b\r \/\> g:i:s a'); ?></td> 
!     <td><a href="<?php the_permalink(); ?>" rel="permalink"> 
!       <?php the_title() ?> 
!       </a> 
!     <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td> 
!     <td><?php the_category(','); ?></td> 
!     <td><a href="edit.php?p=<?php echo $id ?>&c=1"> 
!       <?php comments_number(__('no comments'), __('1 comment'), __("% comments")) ?> 
!       </a></td> 
!     <td><?php the_author() ?></td> 
!     <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 
!     <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td> 
!   </tr> 
! <?php
! }
! } else {
! ?>
!   <tr style='background-color: <?php echo $bgcolor; ?>'> 
!     <td colspan="8"><?php _e('No posts found.') ?></td> 
!   </tr> 
! <?php
! } // end if ($posts)
! ?> 
! </table> 
! <?php
! if ( 1 == count($posts) ) {
! 
! 	$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
! 	if ($comments) {
! 	?> 
! <h3><?php _e('Comments') ?></h3> 
! <ol id="comments"> 
! <?php
! foreach ($comments as $comment) {
! $comment_status = wp_get_comment_status($comment->comment_ID);
! ?> 
! 
! <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
!   <?php comment_date('Y-n-j') ?> 
!   @
!   <?php comment_time('g:m:s a') ?> 
!   <?php 
! 			if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) {
! 				echo "[ <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" .  __('Edit') . "</a>";
! 				echo " - <a href=\"post.php?action=deletecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> ";
! 				if ( ('none' != $comment_status) && ($user_level >= 3) ) {
! 					if ('approved' == wp_get_comment_status($comment->comment_ID)) {
! 						echo " - <a href=\"post.php?action=unapprovecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> ";
! 					} else {
! 						echo " - <a href=\"post.php?action=approvecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Approve') . "</a> ";
! 					}
! 				}
! 				echo "]";
! 			} // end if any comments to show
! 			?> 
!   <br /> 
!   <strong> 
!   <?php comment_author() ?> 
!   (
!   <?php comment_author_email_link() ?> 
!   /
!   <?php comment_author_url_link() ?> 
!   )</strong> (IP:
!   <?php comment_author_IP() ?> 
!   )
!   <?php comment_text() ?> 
! 
! </li> 
! <!-- /comment --> 
! <?php //end of the loop, don't delete
! 		} // end foreach
! 	echo '</ol>';
! 	}//end if comments
! 	?>
! <?php } ?> 
! </div> 
! <?php 
!  include('admin-footer.php');
! ?> 




More information about the cvs mailing list