Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [MINI-MOD] Paginator on TOP in function center  (Read 3782 times)

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MINI-MOD] Paginator on TOP in function center
« on: June 27, 2007, 03:26:45 pm »

Ok, the credit that is 'not needed' goes to Bob-man, as he solved it in a matter of minutes. For me it would have taken hours if not days, if I even solved it at all, hehe...

The idea is mine howeverm how often isn't that a fact, eh... one comes up with something and then when it comes to making it happen, the crapper's full, and there's no way out of the toilet... Ok, end of disturbing anecdotes. Here goes how to set up a TOP PAGINATOR for function center()

And backetyup ze snews.php, pleas...e

First locate the first occurence of the following inside function center():
Quote
$link = '<a href="'.db('website');
and just before that line you post this:
Quote
if (!empty($currentPage) && ($numrows_articles > $article_limit) && s('display_pagination') == 'on') {
paginator($categorySEF, $currentPage, $totalPages, '', l('paginator'));
}
Now it's there... but if you're, like me, troubled by the fact that the center content has dropped a tad now that the TOP PAG is there, just go watch a category that haven't enough articles in it and you'll notice that the bugger of a function pops right back up into position, hehe... Quite irritating, I thought.

So, atleast in my design (or try thereof, I'm making a testsite, betasite, under construction site or whatever) this was the case, and I did not want that, which lead me to... First, add a couple of
's above the original paginator (the one at the bottom), and that is done like this:
(the 4-6 line from the end of the function center() is the paginator )
Quote
echo '

';

         if (!empty($currentPage) && ($numrows_articles > $article_limit) && s('display_pagination') == 'on') {
            paginator($categorySEF, $currentPage, $totalPages, '', l('paginator'));
         }
Just add those two line breaks, and then we need to adjust the vertical positioning of the paginator CSS code, and of course make it floatable... Mine is looking like this:
Quote
.paginator{float:right;text-align:right;margin:-1em 2.5em 0.5em 0;}
The red settings are what is added or changed in order to place it exactly where I wanted it, which was on the right hand side of the upper H2 title.

And it looks a little bit like this:
« Last Edit: August 28, 2007, 02:51:55 am by Phil Martin (Philmoz) »
Logged
"It's only dead fish that goes with the flow... "
Updated

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MINI-MOD] Paginator on TOP in function center
« Reply #1 on: June 27, 2007, 03:53:08 pm »

Hehe, I took two of them mentioning's away  :D
Logged
"It's only dead fish that goes with the flow... "
Updated

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
[MINI-MOD] Paginator on TOP in function center
« Reply #2 on: June 28, 2007, 01:12:11 am »

rofl.. I'll give this a whirl and see what I think ;)
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Joost

  • Guest
[MINI-MOD] Paginator on TOP in function center
« Reply #3 on: June 28, 2007, 02:22:21 am »

Does it mean there are two paginators in the page, a top Paginator  and a bottom paginator?
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
[MINI-MOD] Paginator on TOP in function center
« Reply #4 on: June 28, 2007, 08:59:42 am »

For long pages two of them makes sense ;)
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MINI-MOD] Paginator on TOP in function center
« Reply #5 on: June 28, 2007, 09:30:54 am »

Quote from: Joost
Does it mean there are two paginators in the page, a top Paginator  and a bottom paginator?
Yupp, it does... As Code twist says, for loooong pages it makes sense. But you can always remove the bottom one if the top one is to prefer.

I've integrated it to my son's soccer site, if somebody would like to view it in action: http://rodslebk96.com
Logged
"It's only dead fish that goes with the flow... "
Updated