Topic: Page footer

Hi, I would like to know if there is the possibility to change footer in order to show  page number instead of newer and older link. I mean a footer like google but the page 2 is like  nibbleblog older.
Thank you

regards

Re: Page footer

Hello,
you can play with this variables.

$amount_of_posts = $_DB_POST->get_count();

$amount_of_post_by_page = $settings['items_page'];

3 (edited by eaturmusicx 29-12-2015 08:57:10)

Re: Page footer

below is how i do it and works perfectly. In pager.bit enter code as per below:

<section id="pager">
    <ul class="pagination nobottommargin">
        <?php 
        
        $total_page = $settings['items_page'];
        echo Pager::next_link2(); 
        
        for($i=0; $i < $total_page ; $i++) {
            $o = $i+1;
            echo '<li><a href="'.BLOG_URL.'page-'.$i.'">'.$o.'</a></li>';
        }
        
        echo Pager::prev_link2(); 
        
        ?>
    </ul>
</section>

Add new function in pager.class.php, just copy/paste next_link() and prev_link() as per below:

    public static function next_link2($text=NULL)
    {
        $text='<li class="disabled"><a>&laquo;</a></li>';
        global $pager;
        global $Language;

        if(!$pager['show_newer'])
            return $text;

        $text = isset($text)?$text:$Language->get('NEWER_POSTS').' →';

        $html = '<li><a href="'.$pager['href_newer'].'">&laquo;</a></li>';

        return $html;
    }

        public static function prev_link2($text=NULL)
    {
        $text='<li class="disabled"><a >&raquo;</a></li>';
        global $pager;
        global $Language;

        if(!$pager['show_older'])
            return $text;

        $text = isset($text)?$text:'← '.$Language->get('OLDER_POSTS');

        $html = '<li><a href="'.$pager['href_older'].'">&raquo;</a></li>';

        return $html;
    }

Then add styling or follow your css theme. Done!

Re: Page footer

Correction in pager.bit as per below:

<section id="pager">
    <ul class="pagination nobottommargin">
        <?php 
        
        $total_post = $_DB_POST->get_count();
        $total_page = $settings['items_page'];
        $pagiation_post = $total_post/$total_page;
        
        echo Pager::next_link2(); 
        
        for($i=0; $i < $pagiation_post ; $i++) {
            $o = $i+1;
            echo '<li><a href="'.BLOG_URL.'page-'.$i.'">'.$o.'</a></li>';
        }
        
        echo Pager::prev_link2(); 
        
        ?>
    </ul>
</section>

Re: Page footer

thank you very much for your work following you can see some modification on pager.bit file

<section id="pager">
    <ul class="pagination nobottommargin">
        <?php
       
        $total_post = $_DB_POST->get_count();
        $total_page = $settings['items_page'];
        $pagiation_post = $total_post/$total_page;
        $pagiation_post_int = floor($pagiation_post);
       
        echo '<li> <a href="'.HTML_PATH_ROOT.'">Home</a></li>';
        echo Pager::prev_link2();
       
        for($i=0; $i < $pagiation_post ; $i++) {
            $o = $i+1;

         echo '<a href="'.BLOG_URL.'index.php?controller=blog&action=view&number='.$i.'">  '.$o.'   </a>';
        }
       
       
        echo Pager::next_link2();
       
     
       
    echo '<li> <a href="'.BLOG_URL.'index.php?controller=blog&action=view&number='.$pagiation_post_int.'"> End </a></li>';
   
        ?>
    </ul>
</section>

and some modification on pager.class.php

public static function next_link2($text=NULL)
    {
        //$text='<li class="disabled"><a>&laquo;</a></li>';
        //$text='<class="disabled"><a>&laquo;</a>';
        global $pager;
        global $Language;

        if(!$pager['show_older'])
            return $text;

        $text = isset($text)?$text:$Language->get('NEWER_POSTS').' →';

     //   $html = '<a href="'.$pager['href_newer'].'">&laquo;</a>';
$html = '<a href="'.$pager['href_newer'].'"> Next  </a>';
        return $html;
    }

        public static function prev_link2($text=NULL)
    {
       // $text='<li class="disabled"><a >&raquo;</a></li>';
      //   $text='<class="disabled"><a >&raquo;</a>';
        global $pager;
        global $Language;

        if(!$pager['show_newer'])
            return $text;

        $text = isset($text)?$text:'← '.$Language->get('OLDER_POSTS');

      //  $html = '<a href="'.$pager['href_older'].'">&raquo;</a>';
$html = '<a href="'.$pager['href_older'].'"> Prev </a>';
        return $html;
    }