Changeset 168
- Timestamp:
- 04/28/08 09:53:09 (9 months ago)
- Location:
- themes/charcoal
- Files:
-
- 5 modified
-
home.php (modified) (2 diffs)
-
multiple.php (modified) (1 diff)
-
search.php (modified) (1 diff)
-
tag.php (modified) (1 diff)
-
theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
themes/charcoal/home.php
r161 r168 21 21 <a href="<?php echo $post->permalink.'#comment-form'; ?>" title="Comments on this post"><?php $theme->post_comments_link( $post, 'No Comments', '%s Comment', '%s Comments' ); ?></a> 22 22 </span> 23 <br class="clear"> </span>23 <br class="clear"> 24 24 </div> 25 25 <div class="post-entry"> … … 62 62 <?php endwhile; ?> 63 63 </div> 64 <?php $theme->prevnext($page, Utils::archive_pages($posts->count_all())); ?> 64 <div id="prev-posts-footer"> 65 <span class="nav-next"><?php $theme->prev_page_link('Newer Posts'); ?></span> 66 <span class="nav-prev"><?php $theme->next_page_link('Older Posts'); ?></span> 67 <br class="clear"> 68 </div> 69 <?php //$theme->prevnext($page, Utils::archive_pages($posts->count_all())); ?> 65 70 <?php $theme->display_archives() ;?> 66 71 -
themes/charcoal/multiple.php
r161 r168 37 37 <div id="wrapper-bottom"> 38 38 <div id="bottom-primary"> 39 <?php $theme->prevnext($page, Utils::archive_pages($posts->count_all())); ?> 39 <div id="prev-posts-footer"> 40 <span class="nav-next"><?php $theme->prev_page_link('Newer Posts'); ?></span> 41 <span class="nav-prev"><?php $theme->next_page_link('Older Posts'); ?></span> 42 <br class="clear"> 43 </div> 40 44 <?php $theme->display_archives() ;?> 41 45 -
themes/charcoal/search.php
r161 r168 41 41 <div id="wrapper-bottom"> 42 42 <div id="bottom-primary"> 43 <?php $theme->prevnext($page, Utils::archive_pages($posts->count_all())); ?> 43 <div id="prev-posts-footer"> 44 <span class="nav-next"><?php $theme->prev_page_link('Newer Posts'); ?></span> 45 <span class="nav-prev"><?php $theme->next_page_link('Older Posts'); ?></span> 46 <br class="clear"> 47 </div> 44 48 <?php $theme->display_archives() ;?> 45 49 -
themes/charcoal/tag.php
r161 r168 36 36 <div id="wrapper-bottom"> 37 37 <div id="bottom-primary"> 38 <?php $theme->prevnext($page, Utils::archive_pages($posts->count_all())); ?> 38 <div id="prev-posts-footer"> 39 <span class="nav-next"><?php $theme->prev_page_link('Newer Posts'); ?></span> 40 <span class="nav-prev"><?php $theme->next_page_link('Older Posts'); ?></span> 41 <br class="clear"> 42 </div> 39 43 <?php $theme->display_archives() ;?> 40 44 -
themes/charcoal/theme.php
r163 r168 70 70 parent::add_template_vars(); 71 71 } 72 /** 73 * returns the previous and/or next page links based on the current matched rule 74 */ 75 public function theme_prevnext($theme,$currentpage, $totalpages) 76 { 77 //Retreive the current matched rule 78 $rr= URL::get_matched_rule(); 79 // Retrieve arguments name the RewriteRule can use to build a URL. 80 $rr_named_args= $rr->named_args; 81 $rr_args= array_merge( $rr_named_args['required'], $rr_named_args['optional'] ); 82 // For each argument, check if the handler_vars array has that argument and if it does, use it. 83 $rr_args_values= array(); 84 foreach ( $rr_args as $rr_arg ) { 85 if ( !isset( $settings[$rr_arg] ) ) { 86 $rr_arg_value= Controller::get_var( $rr_arg ); 87 if ( $rr_arg_value != '' ) { 88 $settings[$rr_arg]= $rr_arg_value; 89 } 90 } 91 } 92 if ( !empty( $settings) ) { 93 $suffix= $rr->build($settings); 94 if (preg_match( "/\bpage\/\d+$/", $suffix) ) { 95 $url= Site::get_url( 'habari', true ) . preg_replace("/\bpage\/\d+$/", "page/", $suffix ); 96 } 97 else { 98 $url= Site::get_url( 'habari', true ) . $suffix . '/page/'; 99 } 100 } 101 else { 102 $url=Site::get_url( 'habari', true ).'page/'; 103 } 104 105 if ( $currentpage > $totalpages ) { 106 $currentpage= $totalpages; 107 } 108 else if ( $currentpage < 1 ) { 109 $currentpage= 1; 110 } 111 if ( $totalpages > 1 ) { 112 $out='<div id="prev-posts-footer">'."\n"; 113 if ($currentpage < $totalpages) { 114 $out.='<span class="nav-prev"><a href="' . $url .($currentpage+1).'">Older Posts</a></span>'; 115 } 116 if ($currentpage > 1) { 117 $out.='<span class="nav-next"><a href="' . $url .($currentpage-1).'">Newer Posts</a></span>'; 118 } 119 $out.= "\n".'<br class="clear" />'."\n</div>\n"; 120 echo $out; 121 } 122 } 123 72 124 73 /** 125 74 * Convert a post's tags array into a usable list of links
