Subdomain Posts
PHP | 2 hours ago
PHP | 2 hours ago
PHP | 6 hours ago
PHP | 9 hours ago
PHP | 9 hours ago
PHP | 10 hours ago
PHP | 10 hours ago
PHP | 12 hours ago
PHP | 17 hours ago
PHP | 17 hours ago
Recent Posts
None | 8 sec ago
None | 52 sec ago
None | 1 min ago
None | 1 min ago
Java | 1 min ago
MySQL | 2 min ago
Linden Scripting | 2 min ago
Diff | 2 min ago
PHP | 2 min ago
HTML | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Master on the 13th of Jul 2009 06:39:27 AM Download | Raw | Embed | Report
  1. function page_link(page_id){return '<a href="/list'+section+'/'+(page_id > 1 ? 'p'+page_id+'/' : '')+page_suffix+'">'+page_id+'</a>';}
  2. function pages(page_id, total_pages){
  3.         t1=3;
  4.         t2=3;
  5.         if (page_id > total_pages) page_id = total_pages;
  6.         if (page_id < 1) page_id =1;
  7.         strx = '<u><b>'+page_id+'</b></u>';
  8.        
  9.         if (page_id <= t1) t1 = page_id - 1;
  10.         if (total_pages - page_id < t2) t2 = total_pages - page_id;
  11.         if (page_id > 1)        {
  12.                 for (i = page_id - 1; i >= page_id-t1; i--) strx = page_link(i)+strx;
  13.                 i++;
  14.                 if (i > 2) strx = '..'+strx;
  15.                 if (i > 1) strx = page_link(1)+strx;
  16.         }
  17.         if (page_id < total_pages) {
  18.                 for (i = page_id + 1; i <= page_id+t2; i++)     strx = strx+page_link(i);
  19.                 i--;
  20.                 if (i < total_pages-1) strx = strx+'..';
  21.                 if (i < total_pages) strx = strx+page_link(total_pages);
  22.         }
  23.         return strx;
  24. }
Submit a correction or amendment below. [ previous version ] | [ difference ] | Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: