Example #1
0
 function __construct($max_pp = null, $count = null)
 {
     $posts = new Posts();
     $this->current_page = $posts->getCurrentPageNumber();
     $this->per_page = $posts->getMaxPostPerPage();
     $this->total_count = $posts->getPostsCount();
     if (isset($count)) {
         $this->total_count = $count;
     }
     if (isset($max_pp)) {
         $this->per_page = $max_pp;
     }
 }
Example #2
0
            echo $_SERVER['REQUEST_URI'] . '&page=' . $posts->previousPage;
            ?>
" class="btn">Back</a>
            <?php 
        }
        if ($posts->hasNextPage) {
            ?>
                <a href="<?php 
            echo $_SERVER['REQUEST_URI'] . '&page=' . $posts->nextPage;
            ?>
" class="btn">Next</a>
            <?php 
        }
        ?>
            <span style="float: left !important; margin-top: 7px;">Page <?php 
        echo $posts->getCurrentPageNumber();
        ?>
 of <?php 
        echo $posts->total_pages;
        ?>
</span>
        </div><br>
            <?php 
    }
    ?>
        <?php 
} else {
    ?>
        <br>
        <?php 
}