git-svn-id: http://svn.automattic.com/wordpress/trunk@2481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-28 02:34:16 +00:00
parent 8da6700ea7
commit dbeb92f23b
4 changed files with 91 additions and 63 deletions

View File

@ -66,12 +66,21 @@ if ($drafts || $other_drafts) {
<div class="wrap">
<h2>
<?php
if ( $_GET['m'] ) {
echo $month[substr( $_GET['m'], 4, 2 )] . ' ' . substr( $_GET['m'], 0, 4 );
} elseif ( isset( $_GET['s'] ) ) {
$what_to_show = 'posts';
$posts_per_page = 15;
$posts_per_archive_page = -1;
include(ABSPATH.'wp-blog-header.php');
if ( is_month() ) {
single_month_title(' ');
} elseif ( is_search() ) {
printf(__('Search for &#8220;%s&#8221;'), wp_specialchars($_GET['s']) );
} else {
if ( ! is_paged() || get_query_var('paged') == 1 )
_e('Last 15 Posts');
else
_e('Previous Posts');
}
?>
</h2>
@ -140,15 +149,6 @@ $posts_columns['control_delete'] = '';
</tr>
<?php
$what_to_show = 'posts';
if ( empty($_GET['m']) || 0 == $_GET['m'] && empty($_GET['s']) ) {
$showposts = 15;
} else {
$nopaging = true;
}
include(ABSPATH.'wp-blog-header.php');
if ($posts) {
$bgcolor = '';
foreach ($posts as $post) { start_wp();
@ -238,6 +238,12 @@ foreach($posts_columns as $column_name=>$column_display_name) {
} // end if ($posts)
?>
</table>
<div class="navigation">
<div class="alignleft"><?php next_posts_link(__('&laquo; Previous Entries')) ?></div>
<div class="alignright"><?php previous_posts_link(__('Next Entries &raquo;')) ?></div>
</div>
<?php
if ( 1 == count($posts) ) {

View File

@ -141,6 +141,14 @@ textarea, input, select {
padding: 3px;
}
.alignleft {
float: left
}
.alignright {
float: right;
}
.alternate {
background: #eee;
}
@ -173,6 +181,13 @@ textarea, input, select {
display: none;
}
.navigation {
display: block;
text-align: center;
margin-top: 10px;
margin-bottom: 30px;
}
.post-categories {
display: inline;
margin: 0;

View File

@ -1395,6 +1395,12 @@ function is_trackback () {
return $wp_query->is_trackback;
}
function is_admin () {
global $wp_query;
return $wp_query->is_admin;
}
function is_home () {
global $wp_query;

View File

@ -377,7 +377,8 @@ function get_pagenum_link($pagenum = 1){
$page_modstring = "page/";
$page_modregex = "page/?";
$permalink = 0;
$index = 'index.php';
//$index = 'index.php';
$index = $_SERVER['SCRIPT_NAME'];
$home_root = parse_url(get_settings('home'));
$home_root = $home_root['path'];
@ -398,14 +399,14 @@ function get_pagenum_link($pagenum = 1){
// lets see what sort of URL we have...
} else {
// we need to know the way queries are being written
// if there's a querystring_start (a "?" usually), it's deffinitely not mod_rewritten
// if there's a querystring_start (a "?" usually), it's definitely not mod_rewritten
if ( stristr( $qstr, '?' ) ){
// so append the query string (using &, since we already have ?)
$qstr .= '&amp;' . $page_querystring . '=' . $pagenum;
// otherwise, it could be rewritten, OR just the default index ...
} elseif( '' != get_settings('permalink_structure')) {
} elseif( '' != get_settings('permalink_structure') && ! is_admin()) {
$permalink = 1;
$index = $wp_rewrite->index;
// If it's not a path info permalink structure, trim the index.
if (! $wp_rewrite->using_index_permalinks()) {
$qstr = preg_replace("#/*" . $index . "/*#", '/', $qstr);