E_ALL fixes and cleanups.

git-svn-id: https://develop.svn.wordpress.org/trunk@1239 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2004-05-07 23:56:33 +00:00
parent 2d8c664856
commit 3fedfb5746
16 changed files with 73 additions and 93 deletions
+1 -3
View File
@@ -2,7 +2,6 @@
require_once('../wp-includes/wp-l10n.php');
$title = __('Categories');
/* <Categories> */
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
@@ -144,7 +143,7 @@ $messages[1] = __('Category added.');
$messages[2] = __('Category deleted.');
$messages[3] = __('Category updated.');
?>
<?php if ($_GET['message']) : ?>
<?php if (isset($_GET['message'])) : ?>
<div class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>
@@ -193,6 +192,5 @@ set them back to the default category <strong>%s</strong>.'), get_catname(1)) ?>
break;
}
/* </Categories> */
include('admin-footer.php');
?>
+1 -1
View File
@@ -31,7 +31,7 @@ function checkAll(form)
<form name="searchform" action="" method="get">
<fieldset>
<legend><?php _e('Show Comments That Contain...') ?></legend>
<input type="text" name="s" value="<?php echo $s; ?>" size="17" />
<input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
<?php _e('(Searches within comment text, email, URI, and IP address.)') ?>
+1 -10
View File
@@ -18,14 +18,6 @@ if (get_settings('use_pingback')) {
if (get_settings('use_trackback')) {
$form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') .
'<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>';
if ('' != $pinged) {
$form_trackback .= '<p>' . __('Already pinged:') . '</p><ul>';
$already_pinged = explode("\n", trim($pinged));
foreach ($already_pinged as $pinged_url) {
$form_trackback .= "\n\t<li>$pinged_url</li>";
}
$form_trackback .= '</ul>';
}
} else {
$form_trackback = '';
}
@@ -38,7 +30,7 @@ $saveasdraft = '';
<form name="post" action="post.php" method="post" id="post">
<?php
if ('bookmarklet' == $mode) {
if (isset($mode) && 'bookmarklet' == $mode) {
echo '<input type="hidden" name="mode" value="bookmarklet" />';
}
?>
@@ -98,7 +90,6 @@ edCanvas = document.getElementById('content');
</script>
<?php echo $form_pingback ?>
<?php echo $form_prevstatus ?>
<?php echo $form_trackback; ?>
<p><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
+1 -1
View File
@@ -70,7 +70,7 @@ if( isset( $_GET['m'] ) )
<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 echo $s; ?>" size="17" />
<input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
</fieldset>
</form>
+1 -4
View File
@@ -103,11 +103,8 @@ default:
<li class="last"><a href="moderation.php" class="current"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<?php
$ignored = $_GET['ignored'];
$deleted = $_GET['deleted'];
$approved = $_GET['approved'];
if (($deleted) || ($approved) || ($ignored)) {
if (isset($deleted) || isset($approved) || isset($ignored)) {
echo "<div class='updated'>\n<p>";
if ($approved) {
if ('1' == $approved) {
+9 -7
View File
@@ -1,10 +1,11 @@
<?php
if ($user_level <= 6) {
die(__("You have do not have sufficient permissions to edit the options for this blog."));
die( __('You have do not have sufficient permissions to edit the options for this blog.') );
}
//we need to iterate through the available option groups.
$groups = '';
$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) {
if ($option_group->group_id == $option_group_id) {
@@ -28,11 +29,12 @@ $submenu = '
$sublines = split("\n", $submenu);
$_SERVER['REQUEST_URI'] = str_replace('?updated=true', '', $_SERVER['REQUEST_URI']);
foreach ($sublines as $subline) {
preg_match('/href="([^"]+)"/', $subline, $url);
if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) {
$subline = str_replace('a hr', 'a class="current" hr', $subline);
if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) {
$subline = preg_replace('|href=".*?"|', '', $subline);
if (preg_match('/href="([^"]+)"/', $subline, $url)) {
if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) {
$subline = str_replace('a hr', 'a class="current" hr', $subline);
if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) {
$subline = preg_replace('|href=".*?"|', '', $subline);
}
}
}
echo $subline."\n";
@@ -44,6 +46,6 @@ echo $groups .
<br clear="all" />
<?php if ($updated) : ?>
<?php if (isset($updated)) : ?>
<div class="updated"><p><strong><?php _e('Options saved.') ?></strong></p></div>
<?php endif; ?>
+13 -9
View File
@@ -46,11 +46,11 @@ foreach ($check_plugins as $check_plugin) {
?>
<?php if ($_GET['activate']) : ?>
<?php if (isset($_GET['activate'])) : ?>
<div class="updated"><p><?php _e('Plugin <strong>activated</strong>.') ?></p>
</div>
<?php endif; ?>
<?php if ($_GET['deactivate']) : ?>
<?php if (isset($_GET['deactivate'])) : ?>
<div class="updated"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p>
</div>
<?php endif; ?>
@@ -86,6 +86,7 @@ if (!$plugins_dir || !$plugin_files) {
</tr>
<?php
sort($plugin_files); // Alphabetize by filename. Better way?
$style = '';
foreach($plugin_files as $plugin_file) {
$plugin_data = implode('', file(ABSPATH . '/wp-content/plugins/' . $plugin_file));
preg_match("|Plugin Name:(.*)|i", $plugin_data, $plugin_name);
@@ -93,19 +94,23 @@ if (!$plugins_dir || !$plugin_files) {
preg_match("|Description:(.*)|i", $plugin_data, $description);
preg_match("|Author:(.*)|i", $plugin_data, $author_name);
preg_match("|Author URI:(.*)|i", $plugin_data, $author_uri);
preg_match("|Version:(.*)|i", $plugin_data, $version);
$description = wptexturize(wp_filter_kses($description[1]));
if ( preg_match("|Version:(.*)|i", $plugin_data, $version) )
$version = $version[1];
else
$version ='';
$description = wptexturize($description[1]);
if ('' == $plugin_uri) {
$plugin = $plugin_name[1];
} else {
$plugin = wp_filter_kses( __("<a href='{$plugin_uri[1]}' title='Visit plugin homepage'>{$plugin_name[1]}</a>") );
$plugin = __("<a href='{$plugin_uri[1]}' title='Visit plugin homepage'>{$plugin_name[1]}</a>");
}
if ('' == $author_uri) {
$author = $author_name[1];
} else {
$author = wp_filter_kses( __("<a href='{$author_uri[1]}' title='Visit author homepage'>{$author_name[1]}</a>") );
$author = __("<a href='{$author_uri[1]}' title='Visit author homepage'>{$author_name[1]}</a>");
}
@@ -121,7 +126,7 @@ if (!$plugins_dir || !$plugin_files) {
echo "
<tr $style>
<td>$plugin</td>
<td>{$version[1]}</td>
<td>$version</td>
<td>$author</td>
<td>$description</td>
<td>$action</td>
@@ -136,6 +141,5 @@ if (!$plugins_dir || !$plugin_files) {
</div>
<?php
include('admin-footer.php');
?>
?>
+32 -35
View File
@@ -695,42 +695,39 @@ default:
require_once ('./admin-header.php');
if ($user_level > 0) {
if ((!$withcomments) && (!$single)) {
$action = 'post';
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
}
//set defaults
$post_status = get_settings('default_post_status');
$comment_status = get_settings('default_comment_status');
$ping_status = get_settings('default_ping_status');
$post_pingback = get_settings('default_pingback_flag');
$default_post_cat = get_settings('default_post_category');
$action = 'post';
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
}
//set defaults
$post_status = get_settings('default_post_status');
$comment_status = get_settings('default_comment_status');
$ping_status = get_settings('default_ping_status');
$post_pingback = get_settings('default_pingback_flag');
$default_post_cat = get_settings('default_post_category');
if (get_settings('advanced_edit')) {
include('edit-form-advanced.php');
} else {
include('edit-form.php');
}
if (get_settings('advanced_edit')) {
include('edit-form-advanced.php');
} else {
include('edit-form.php');
}
?>
<div class="wrap">
+1 -1
View File
@@ -224,7 +224,7 @@ default:
$bookmarklet_height= (get_settings('use_trackback')) ? 480 : 440;
?>
<?php if ($updated) { ?>
<?php if (isset($updated)) { ?>
<div class="updated">
<p><strong><?php _e('Profile updated.') ?></strong></p>
</div>
+1 -1
View File
@@ -113,7 +113,7 @@ default:
}
?>
<?php if ('te' == $_GET['a']) : ?>
<?php if (isset($_GET['a'])) : ?>
<div class="updated"><p><?php _e('File edited successfully.') ?></p></div>
<?php endif; ?>
<div class="wrap">
+2 -1
View File
@@ -164,7 +164,7 @@ default:
$standalone = 0;
include ('admin-header.php');
?>
<?php if ($_GET['deleted']) : ?>
<?php if (isset($_GET['deleted'])) : ?>
<div class="updated"><p><?php _e('User deleted.') ?></p></div>
<?php endif; ?>
<div class="wrap">
@@ -181,6 +181,7 @@ default:
</tr>
<?php
$users = $wpdb->get_results("SELECT ID FROM $tableusers WHERE user_level > 0 ORDER BY ID");
$style = '';
foreach ($users as $user) {
$user_data = get_userdata($user->ID);
$email = $user_data->user_email;