Author Topic: Change the paging, only display page numbers  (Read 3322 times)

0 Members and 1 Guest are viewing this topic.

Offline kevspar

  • Pre-Newbie
  • Posts: 5
    • View Profile
Change the paging, only display page numbers
« on: August 26, 2009, 06:16:44 AM »
I'd like to change the paging to only display the page numbers.

By default, it looks like this:

« First page  «  1  2  3  4  5  6  7  8  9  10  »  Last page »

I'd like it to look like this:

1  2  3  4  5  6  7  8  9  10

I tried editing the language file main.php and took everything out between the "" in the paging section,
but that didn't work, the pages would not display at all. Then I put in non breaking spaces in the lang file
between the "" and that sort of worked, except when it adds the spaces, the paging line moves a little side
to side when the spaces get added to the left or right.

I opened up includes/paging.php, and I see where the html gets displayed. I think that this is the file to take
out everything except the page numbers, but I can't seem to get it right as I remove lines and { }'s.

I searched and thought for sure I'd find a change for this, but no luck. Can anybody please post a paging.php
file which would do this trick?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Change the paging, only display page numbers
« Reply #1 on: August 26, 2009, 06:50:39 AM »
comment out or delete these two blocks from includes/paging.php
      $page_back $this->page 1;
      
$page_next $this->page 1;

      if (
$page_back 0) {
        
$html .= "<a href=\"".$this->link_args."page=1\" class=\"paging\">".$this->paging_firstpage."</a>&nbsp;&nbsp;";
        
$html .= "<a href=\"".$this->link_args."page=$page_back\" class=\"paging\">".$this->paging_back."</a>&nbsp;&nbsp;";
      }


and
      if ($page_next <= $this->total_pages) {
        
$html .= "<a href=\"".$this->link_args."page=$page_next\" class=\"paging\">".$this->paging_next."</a>&nbsp;&nbsp;";
        
$html .= "<a href=\"".$this->link_args."page=$this->total_pages\" class=\"paging\">".$this->paging_lastpage."</a>";
      }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kevspar

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: Change the paging, only display page numbers
« Reply #2 on: August 26, 2009, 07:42:59 AM »
Perfect! Thank you very much.