News:

Wondering if this will always be free?  See why free is better.

Main Menu

SSI Boardnews PAGES

Started by KumlaOnline, February 24, 2012, 04:26:12 PM

Previous topic - Next topic

KumlaOnline

Hello!

I'm coding my new site using smf´s forum and using SSI.php

But atm i have;

      <?php ssi_boardNews($board = 29.0, $limit = 7, $start = null, $length = null, $output_method = 'echo') ?>

But i want it to display all post on board = 29.0 but on diffrent pages like it shows 5 post then if you scroll down to the bottom it says "12..789" and you can choose wich page you want to display and the newest post should be on the top of page 1.

If you didnt understand what i ment please post and ill try to explain better.

Suki

Hi, welcome to SMF.


I've coded a pagination class that uses an array of values instead of direct data from the DB, it shouldl be easy to implement for SSI, since it's basically an array too.

I will make some test and see if it will fit or not.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

OK, this is a very raw script just to give you an idea on how this could work, you still need to define some parameters, the class accepts the following parameters:

function __construct($array, $page = 1, $link_prefix = false, $link_suffix = false, $limit_page = 20, $limit_number = 10)

$array  the actual array that will be used, in this case it uses the array that generates ssi_boardNews()

$link_prefix  something that will be appended to the url where the pagination is set, you need to actually use the action where you are

$link_suflix  the same as the previous, just this time it will be appended at the end of the current url

$limit_page  the number of results per page

$limit_number the number of pages to show in the pagination numbers.


the class returns several resources but the important ones are:

OutputArray();   displays the results

OutputPanel();  displays the pagination numbers.


hope this helps.

this will only work on php5
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

KumlaOnline

Quote from: Suki on February 25, 2012, 10:29:22 AM
OK, this is a very raw script just to give you an idea on how this could work, you still need to define some parameters, the class accepts the following parameters:

function __construct($array, $page = 1, $link_prefix = false, $link_suffix = false, $limit_page = 20, $limit_number = 10)

$array  the actual array that will be used, in this case it uses the array that generates ssi_boardNews()

$link_prefix  something that will be appended to the url where the pagination is set, you need to actually use the action where you are

$link_suflix  the same as the previous, just this time it will be appended at the end of the current url

$limit_page  the number of results per page

$limit_number the number of pages to show in the pagination numbers.


the class returns several resources but the important ones are:

OutputArray();   displays the results

OutputPanel();  displays the pagination numbers.


hope this helps.

this will only work on php5

Where should i put the files you have attached? :)

do i need to do some call function like for ssi.php? EDIT, saw in the test pagination.

Suki

The files are just for demonstration, you only need Breeze_Pagination.php, it must be in the same folder of the file where you will call the ssi function and yes, you must call SSI.php in order to use any ssi function:

SSI Readme
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: