If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Create diferent next, prev links (number format)  XML
Forum Index » Advanced Guestbook Forum
Author Message
linuxmen
Newbie

Joined: 27/04/2006 00:17:22
Messages: 1
Offline

Hello All.

Im check the code of Gb.class.php

  1. function show_entries($entry=0) {  
  2.     global $GB_PG;  
  3.     $entry = intval($entry);  
  4.     $LANG = &$this->db->LANG;  
  5.     $VARS = &$this->db->VARS;  
  6.     $this->db->fetch_array($this->db->query("select count(*) as total from ".$this->db->table['data']));  
  7.     $this->total = $this->db->record["total"];  
  8.     $TPL = $this->get_entries($entry,$this->db->VARS["entries_per_page"]);  
  9.     $TPL['GB_TOTAL'] = $this->total;  
  10.     $TPL['GB_JUMPMENU'] = implode("\n",$this->generate_JumpMenu());  
  11.     $TPL['GB_TIME'] = $this->db->DateFormat(time());  
  12.     $TPL['GB_NAVIGATION'] = $this->get_nav($entry);  
  13.     $TPL['GB_HTML_CODE'] = ($this->db->VARS["allow_html"] == 1) ? $this->db->LANG["BookMess2"] : $this->db->LANG["BookMess1"];  
  14.     $guestbook_html = "";  
  15.     eval("\$guestbook_html = \"".$this->template->get_template($this->db->GB_TPL['header'])."\";");  
  16.     eval("\$guestbook_html .= \"".$this->template->get_template($this->db->GB_TPL['body'])."\";");  
  17.     eval("\$guestbook_html .= \"".$this->template->get_template($this->db->GB_TPL['footer'])."\";");  
  18.     return $guestbook_html;  
  19. }  
  20.   
  21.   
  22.   
  23.   
  24. tion get_nav($entry=0) {  
  25.     global $_SERVER, $GB_PG;  
  26.     $entry = intval($entry);  
  27.     $self = (IS_MODULE && eregi("\?",$GB_PG["index"])) ? "$GB_PG[index]&entry=" : basename(  $_SERVER['PHP_SELF'])."?entry=";  
  28.     $next_page = $entry+$this->db->VARS['entries_per_page'];  
  29.     $prev_page = $entry-$this->db->VARS['entries_per_page'];  
  30.     $navigation = '';  
  31.     if ($prev_page >= 0) {  
  32.         $navigation = "   <img src=\"$GB_PG[base_url]/img/back.gif\" width=\"16\" height=\"14\"><a href=\"$self$prev_page\">".          $this->db->LANG["NavPrev"]."</a>\n";  
  33.     }  
  34.     if ($next_page < $this->total) {  
  35.         $navigation = $navigation."   &nbsp;&nbsp;<a href=\"$self$next_page\">".$this->db->LANG["NavNext"]."</a><img src=\"$GB_PG[base_url]/img/next.gif\" width=\"16\" height=\"14\">\n";  
  36.     }  
  37.     return $navigation;  
  38. }  


this function generates the next page and previous page, but How Im create a new navigation bar

for example in this format

< 1 - 2 - 3 - 4 >

Do you have an Idea?

Thanks

A. Acosta[/code]

HellBoy
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

You could have a look at how I do it in Lazarus.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
 
Forum Index » Advanced Guestbook Forum
Go to:   
Based on the open source JForum