Advertisement:

Author Topic: SSI Boardnews PAGES  (Read 2321 times)

Offline KumlaOnline

  • Newbie
  • *
  • Posts: 3
SSI Boardnews PAGES
« on: February 24, 2012, 04:26:12 PM »
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.

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 12,954
  • Kaizoku Jotei
    • Free SMF mods
Re: SSI Boardnews PAGES
« Reply #1 on: February 24, 2012, 04:37:07 PM »
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.
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 12,954
  • Kaizoku Jotei
    • Free SMF mods
Re: SSI Boardnews PAGES
« Reply #2 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
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care

Offline KumlaOnline

  • Newbie
  • *
  • Posts: 3
Re: SSI Boardnews PAGES
« Reply #3 on: February 25, 2012, 02:03:50 PM »
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.

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 12,954
  • Kaizoku Jotei
    • Free SMF mods
Re: SSI Boardnews PAGES
« Reply #4 on: February 25, 2012, 04:46:08 PM »
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
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care