Changeset 168

Show
Ignore:
Timestamp:
04/28/08 09:53:09 (9 months ago)
Author:
dmondark
Message:

theme:charcoal Swticed to using the new navigation links.

Location:
themes/charcoal
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • themes/charcoal/home.php

    r161 r168  
    2121                            <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> 
    2222                        </span> 
    23                         <br class="clear"></span> 
     23                        <br class="clear"> 
    2424                    </div> 
    2525                    <div class="post-entry"> 
     
    6262            <?php endwhile; ?> 
    6363            </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())); ?> 
    6570            <?php $theme->display_archives() ;?> 
    6671             
  • themes/charcoal/multiple.php

    r161 r168  
    3737    <div id="wrapper-bottom"> 
    3838        <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> 
    4044            <?php $theme->display_archives() ;?> 
    4145 
  • themes/charcoal/search.php

    r161 r168  
    4141    <div id="wrapper-bottom"> 
    4242        <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> 
    4448            <?php $theme->display_archives() ;?> 
    4549 
  • themes/charcoal/tag.php

    r161 r168  
    3636    <div id="wrapper-bottom"> 
    3737        <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> 
    3943            <?php $theme->display_archives() ;?> 
    4044 
  • themes/charcoal/theme.php

    r163 r168  
    7070        parent::add_template_vars(); 
    7171    } 
    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         
    12473    /** 
    12574     * Convert a post's tags array into a usable list of links