Various fixes and cleanups, inspired and pointed out by Joseph Scott.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4915acfefd
commit
cdc9a55ad9
|
@ -55,8 +55,8 @@ if (!empty($delete_comments)) {
|
|||
echo "<div class='wrap'><p>" . sprintf(__('%s comments deleted.'), $i) . "</p></div>";
|
||||
}
|
||||
|
||||
if ($s) {
|
||||
$s = $wpdb->escape($s);
|
||||
if (isset($_GET['s'])) {
|
||||
$s = $wpdb->escape($_GET['s']);
|
||||
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE
|
||||
comment_author LIKE '%$s%' OR
|
||||
comment_author_email LIKE '%$s%' OR
|
||||
|
|
|
@ -97,7 +97,7 @@ edCanvas = document.getElementById('content');
|
|||
<?php if ('bookmarklet' != $mode) {
|
||||
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing »') . '" />';
|
||||
} ?>
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo $_SERVER['HTTP_REFERER']; ?>" />
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -45,25 +45,24 @@ if( isset( $_GET['m'] ) )
|
|||
<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
|
||||
echo "<select name=\"m\" style=\"width:120px;\">";
|
||||
$arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date) FROM $tableposts ORDER BY post_date DESC",ARRAY_A);
|
||||
$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["YEAR(post_date)"];
|
||||
$arc_month = $arc_row["MONTH(post_date)"];
|
||||
$arc_year = $arc_row->yyear;
|
||||
$arc_month = $arc_row->mmonth;
|
||||
|
||||
if( $arc_year.zeroise($arc_month,2) == $_GET['m'] )
|
||||
$default = "selected";
|
||||
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 $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">';
|
||||
echo $month[zeroise($arc_month, 2)] . " $arc_year";
|
||||
echo "</option>\n";
|
||||
}
|
||||
echo "</select>";
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" name="submit" value="<?php _e('Show Month') ?>" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@ -92,13 +91,14 @@ if( isset( $_GET['m'] ) )
|
|||
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 permalink_link(); ?>" rel="permalink">
|
||||
<td><a href="<?php the_permalink(); ?>" rel="permalink">
|
||||
<?php the_title() ?>
|
||||
</a>
|
||||
<?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
|
||||
|
@ -122,7 +122,7 @@ $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
|
|||
?>
|
||||
</table>
|
||||
<?php
|
||||
if (($withcomments) or ($single)) {
|
||||
if ( 1 == count($posts) ) {
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
|
||||
if ($comments) {
|
||||
|
@ -171,7 +171,6 @@ $comment_status = wp_get_comment_status($comment->comment_ID);
|
|||
echo '</ol>';
|
||||
}//end if comments
|
||||
?>
|
||||
<p><a href="edit.php"><?php _e('Back to posts') ?></a></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<?php
|
||||
$_wp_installing = 1;
|
||||
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. You must create one (<a href='install-config.php'>attempt automatically</a>) before moving on.");
|
||||
if (!file_exists('../wp-config.php')) die(__("There doesn't seem to be a wp-config.php file. You must create one (<a href='install-config.php'>attempt automatically</a>) before moving on."));
|
||||
require_once('../wp-config.php');
|
||||
require('upgrade-functions.php');
|
||||
|
||||
$step = $_GET['step'];
|
||||
if (!$step) $step = 0;
|
||||
if (isset($_GET['step']))
|
||||
$step = $_GET['step'];
|
||||
else
|
||||
$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">
|
||||
|
@ -48,7 +50,7 @@ if (!$step) $step = 0;
|
|||
|
||||
$wpdb->hide_errors();
|
||||
$installed = $wpdb->get_results("SELECT * FROM $tableusers");
|
||||
if ($installed) die('<p>You appear to already have WordPress installed. If you would like to reinstall please clear your old database files first.</p></body></html>');
|
||||
if ($installed) die(__('<p>You appear to already have WordPress installed. If you would like to reinstall please clear your old database files first.</p></body></html>'));
|
||||
$wpdb->show_errors();
|
||||
switch($step) {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|||
|
||||
require_once('./optionhandler.php');
|
||||
|
||||
if ($_POST['submit']) {
|
||||
if (isset($_POST['submit'])) {
|
||||
update_option('permalink_structure', $_POST['permalink_structure']);
|
||||
$permalink_structure = $_POST['permalink_structure'];
|
||||
|
||||
|
@ -41,7 +41,7 @@ if ($_POST['submit']) {
|
|||
}
|
||||
require('./options-head.php');
|
||||
?>
|
||||
<?php if ($_POST['submit']) : ?>
|
||||
<?php if (isset($_POST['submit'])) : ?>
|
||||
<div class="updated"><p><?php _e('Permalink structure updated.'); ?></p></div>
|
||||
<?php endif; ?>
|
||||
<div class="wrap">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
if ($_GET['action']) {
|
||||
if (isset($_GET['action'])) {
|
||||
$standalone = 1;
|
||||
require_once('admin-header.php');
|
||||
if ('activate' == $_GET['action']) {
|
||||
|
|
|
@ -516,6 +516,7 @@ if ($posts) {
|
|||
$single = 1;
|
||||
}
|
||||
if ($s && empty($paged)) { // If they were doing a search and got one result
|
||||
if (!strstr($_SERVER['PHP_SELF'], 'wp-admin')) // And not in admin section
|
||||
header('Location: ' . get_permalink($posts[0]->ID));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,6 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_
|
|||
$optiondates = 0, $optioncount = 0, $hide_empty = 1, $optionnone=FALSE,
|
||||
$selected=0, $hide=0) {
|
||||
global $tablecategories, $tableposts, $tablepost2cat, $wpdb;
|
||||
global $pagenow;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
if (($file == 'blah') || ($file == '')) $file = get_settings('home') . '/' . get_settings('blogfilename');
|
||||
if (!$selected) $selected=$cat;
|
||||
|
@ -260,7 +259,6 @@ function wp_list_cats($args = '') {
|
|||
|
||||
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '') {
|
||||
global $tablecategories, $tableposts, $tablepost2cat, $wpdb, $category_posts;
|
||||
global $pagenow;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
// Optiondates now works
|
||||
if ('' == $file) {
|
||||
|
@ -383,7 +381,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
|
|||
} else {
|
||||
$thelist .= "\t$link<br />\n";
|
||||
}
|
||||
if ($children) $thelist .= list_cats($optionall, $all, $sort_column, $sort_order, $file, $list, $optiondates, $optioncount, $hide_empty, $use_desc_for_title, $children, $category->cat_ID, $categories, 1);
|
||||
if ($children) $thelist .= list_cats($optionall, $all, $sort_column, $sort_order, $file, $list, $optiondates, $optioncount, $hide_empty, $use_desc_for_title, $children, $category->cat_ID, $categories, 1, $feed, $feed_image, $exclude);
|
||||
if ($list) $thelist .= "</li>\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -280,10 +280,10 @@ function trackback_rdf($timezone = 0) {
|
|||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
|
||||
<rdf:Description rdf:about="';
|
||||
permalink_single();
|
||||
the_permalink();
|
||||
echo '"'."\n";
|
||||
echo ' dc:identifier="';
|
||||
permalink_single();
|
||||
the_permalink();
|
||||
echo '"'."\n";
|
||||
echo ' dc:title="'.str_replace('--', '--', wptexturize(strip_tags(get_the_title()))).'"'."\n";
|
||||
echo ' trackback:ping="'.trackback_url(0).'"'." />\n";
|
||||
|
|
|
@ -18,26 +18,6 @@ function permalink_anchor($mode = 'id') {
|
|||
}
|
||||
}
|
||||
|
||||
function permalink_link($file='', $mode = 'id') {
|
||||
global $post, $pagenow, $cacheweekly, $wpdb;
|
||||
$file = ($file=='') ? $pagenow : $file;
|
||||
switch(strtolower($mode)) {
|
||||
case 'title':
|
||||
$title = sanitize_title($post->post_title) . '-' . $post->ID;
|
||||
$anchor = $title;
|
||||
break;
|
||||
case 'id':
|
||||
default:
|
||||
$anchor = $id;
|
||||
break;
|
||||
}
|
||||
echo get_permalink();
|
||||
}
|
||||
|
||||
function permalink_single($file = '') {
|
||||
echo get_permalink();
|
||||
}
|
||||
|
||||
function permalink_single_rss($file = '') {
|
||||
echo get_permalink();
|
||||
}
|
||||
|
@ -165,7 +145,7 @@ function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
|
|||
}
|
||||
|
||||
$location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
|
||||
echo "$before <a href=\"$location\">$link</a> $after";
|
||||
echo "$before <a href='$location'>$link</a> $after";
|
||||
}
|
||||
|
||||
?>
|
2
wp.php
2
wp.php
|
@ -23,7 +23,7 @@ require_once("wp-blog-header.php");
|
|||
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
|
||||
|
||||
<?php the_content(); ?><?php link_pages("<br />Pages: ","<br />","number") ?>
|
||||
<p><em>posted by <strong><?php the_author() ?></strong> @ <a href="<?php permalink_link() ?>"><?php the_time() ?></a></em></p>
|
||||
<p><em>posted by <strong><?php the_author() ?></strong> @ <a href="<?php the_permalink() ?>"><?php the_time() ?></a></em></p>
|
||||
<p>Filed under: <?php the_category() ?></p>
|
||||
<?php comments_popup_link("comments ?", "1 comment", "% comments") ?>
|
||||
|
||||
|
|
Loading…
Reference in New Issue