From c1ba1f019dc1992fb749941512acc13a35ea68e9 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Wed, 10 Dec 2003 19:06:28 +0000 Subject: [PATCH] Fixed more and multiple page code to use new permalink system. git-svn-id: https://develop.svn.wordpress.org/trunk@600 602fd350-edb4-49c9-b593-d223f7449a82 --- b2-include/b2template.functions.php | 41 +++++++++++++++++------------ wp-admin/wp-options-permalink.php | 15 +++++++---- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/b2-include/b2template.functions.php b/b2-include/b2template.functions.php index bf86ded3cf..678ce8911b 100644 --- a/b2-include/b2template.functions.php +++ b/b2-include/b2template.functions.php @@ -872,9 +872,9 @@ function get_the_content($more_link_text='(more...)', $stripteaser=0, $more_file $output .= $teaser; if (count($content)>1) { if ($more) { - $output .= ''.$content[1]; + $output .= ''.$content[1]; } else { - $output .= ' '.$more_link_text.''; + $output .= " $more_link_text"; } } if ($preview) { // preview fix for javascript bug with foreign languages @@ -985,16 +985,19 @@ function link_pages($before='
', $after='
', $next_or_number='number', } else { $file = $pagenow; } - if (($multipage)) { // && ($more)) { + if (($multipage)) { if ($next_or_number=='number') { echo $before; for ($i = 1; $i < ($numpages+1); $i = $i + 1) { $j=str_replace('%',"$i",$pagelink); echo " "; - if (($i != $page) || ((!$more) && ($page==1))) - echo ''; + if (($i != $page) || ((!$more) && ($page==1))) { + if ('' == get_settings('permalink_structure')) { + echo ''; + } else { + echo ''; + } + } echo $j; if (($i != $page) || ((!$more) && ($page==1))) echo ''; @@ -1004,17 +1007,21 @@ function link_pages($before='
', $after='
', $next_or_number='number', if ($more) { echo $before; $i=$page-1; - if ($i && $more) - echo ' '. - $previouspagelink.''; + if ($i && $more) { + if ('' == get_settings('permalink_structure')) { + echo ''; + } else { + echo ''; + } + } $i=$page+1; - if ($i<=$numpages && $more) - echo ' '. - $nextpagelink.''; + if ($i<=$numpages && $more) { + if ('' == get_settings('permalink_structure')) { + echo ''; + } else { + echo ''; + } + } echo $after; } } diff --git a/wp-admin/wp-options-permalink.php b/wp-admin/wp-options-permalink.php index cbc2277ed0..a53c60045c 100644 --- a/wp-admin/wp-options-permalink.php +++ b/wp-admin/wp-options-permalink.php @@ -132,8 +132,11 @@ $query = 'index.php?'; for ($i = 0; $i < count($tokens[0]); ++$i) { if (0 < $i) $query .= '&'; $query .= str_replace($rewritecode, $queryreplace, $tokens[0][$i]) . '$'. ($i + 1); - } +++$i; +// Add post paged stuff +$match .= '([0-9]+)?/?'; +$query .= "&page=$$i"; // Code for nice categories, currently not very flexible $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); @@ -141,10 +144,12 @@ $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); $catmatch = preg_replace('|^/+|', '', $catmatch); ?> -

RewriteEngine On
- RewriteBase
- RewriteRule ^ [QSA]
- RewriteRule ^(.*) index.php?category_name=$1 [QSA]

+
+ +