Author Topic: Number of "previous" and "next" pages displayed in site  (Read 23358 times)

0 Members and 1 Guest are viewing this topic.

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
Number of "previous" and "next" pages displayed in site
« on: October 20, 2002, 07:18:14 AM »
where I can change the code to show 5 pages, no metter what page is currently opened.
for ex. right now if I have 20 pages and my settings set to show only 5 pages. I open page number 7, it will show numbers from 2 to 12, witch r actualy 11 pages showed.
so, I want set 5 numbers to show, it would be showed from number 5 to 9.
where do I change it? (and what :wink: )
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 Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Number of "previous" and "next" pages di
« Reply #1 on: October 21, 2002, 08:56:19 AM »
Settings: "Number of "previous" and "next" pages displayed in site navigation"

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

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
Number of "previous" and "next" pages di
« Reply #2 on: October 22, 2002, 12:37:15 AM »
yes, Jan, they r there, but u as I said, when u set it to 5 and u open page number 7 it will show u 5 page numbers on left side (previous) and 5 numbers on right side, so all together it will show u 11 pages
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 Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Number of "previous" and "next" pages di
« Reply #3 on: October 22, 2002, 07:54:18 AM »
Ok, whats the problem? Set it to 2.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

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
Number of "previous" and "next" pages di
« Reply #4 on: October 23, 2002, 12:05:34 AM »
hehe.
well, actualy, all I wanted is to see 5 numbers all the time if pages count more then 5, if I just set right now to 2, on first page I'll see 2 numbers.
well, it's not really important, I thought its easy to fix. but nm then.
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 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
Number of "previous" and "next" pages di
« Reply #5 on: December 30, 2002, 05:21:39 AM »
here is an example what I was talking about:
http://haunter.student.utwente.nl/Terrarevolution/galleries/search.php?search_user=*
Sry, Vraxor, I use your site for the example...
now, change "pictures per page" to 4 and go to page over 16.
At the gallery settings Vraxor set to show 16 pages,
but actualy it shows twice more when u r on page over 16.
so, is ther a way keep exact amount of pages, no metter on witch page u r at?
thx.
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 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
Number of "previous" and "next" pages di
« Reply #6 on: December 30, 2002, 11:23:17 AM »
It took me whole night to figure this out...gonna nee go to work in 30 min...
Probably there is an easier way to do so, but...
if someone need it here is the modified function from /includes/paging.php:
Code: [Select]
 function get_paging() {
    $html = "";
    if ($this->total_pages > 1) {
      $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;";
      }
      $page_num2 = $this->range / 2;
      $page_num3 = $this->range;
      $page_left = 1;
      for ($page_num = 1; $page_num <= $this->total_pages; $page_num++){
      if ($page_num3) {
      if ($page_left) {
      if (($page_num >= $this->page - ($this->range - $page_num2)) || ($page_num > $this->total_pages - $this->range && $this->page > $this->total_pages - $this->range )) {
     
          if ($this->page == $page_num) {
          $page_left--;
          $page_num2--;
          $page_num3--;
            $html .= "<b class=\"pagingon\">$page_num</b>&nbsp;&nbsp;";
          }
          else {
          $page_num2--;
          $page_num3--;
            $html .= "<a href=\"".$this->link_args."page=$page_num\" class=\"paging\">$page_num</a>&nbsp;&nbsp;";
          }
        }
      }else{
      if ($page_num <= $this->page + ($this->range - $page_num2)) {
   
          if ($this->page == $page_num) {
            $html .= "<b class=\"pagingon\">$page_num</b>&nbsp;&nbsp;";
          }
          else {
          $page_num2--;
          $page_num3--;
            $html .= "<a href=\"".$this->link_args."page=$page_num\" class=\"paging\">$page_num</a>&nbsp;&nbsp;";
          }
        }
}
}
}
      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>";
      }
    }
    return $html;
  }
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 ashfaq

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: Number of "previous" and "next" pages displayed in site
« Reply #7 on: November 07, 2009, 04:46:13 AM »
I want to show Next and Previous buttons with page numbers at home page new added wallpapers, plz help me how to do this ?

Offline david.kissinger3

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Number of "previous" and "next" pages di
« Reply #8 on: December 27, 2009, 11:24:00 AM »
HELLO , I WANT TO SHOW THE NEW PREVIOUS &THE NEW PAGES, AT THE HOMEPAGE, PLEASE HELP ME HOW TO DO THIS.

 Fitness Plan

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: Number of "previous" and "next" pages displayed in site
« Reply #9 on: February 22, 2010, 04:52:39 AM »
hmmm.. i have a tut which was published by sir kurt
that works pertty fine ;)

http://www.4homepages.de/forum/index.php?topic=7294.msg124362#msg124362

chk this out !  :wink:
I'm Back :)