bellringr Posted February 6, 2004 Posted February 6, 2004 Is there a tutorial or help page that addresses the jump menu on the advanced guestbook? If so, would someone point me to it pleae? I've looked but can't find one. I'd like to add things to the menu but am unsure how. Thanks! Quote
MikeJ Posted February 6, 2004 Posted February 6, 2004 This should do it for you (scroll down to the last post). Thumbs Up Copied here for your convience. Note, you will find gb.class.php in the "lib" directory of your guestbook, and header.php in the "templates" directory (but header.php is also editable through the guestbook admin interface). Also the example below just adds a link to your home page. Change that, and add additional links as needed in the same location in the menu_array list. 1.) Open gb.class.php and edit around line 73 >function generate_JumpMenu() { $menu_array[] = "<select name=\"entry\" onchange=\"urlJump('self',this)\" class=\"select\">"; $menu_array[] = "<option value=\"http://www.****/\" class=\"select\">Back To Home</option>"; $menu_array[] = "<option value=\"0\" selected>".$this->db->LANG["FormSelect"]."</option>"; if ($this->db->VARS["entries_per_page"] < $this->total) { $remain = $this->total % $this->db->VARS["entries_per_page"]; $i = $this->total-$remain; while ($i > 0) { $num_max = $i; $num_min = $num_max-$this->db->VARS["entries_per_page"]; $num_min++; $menu_array[] = "<option value=\"$remain\">$num_min-$num_max</option>"; $i = $num_min-1; $remain += $this->db->VARS["entries_per_page"]; } } $menu_array[] = "</select>"; $menu_array[] = "<input type=\"submit\" value=\"".$this->db->LANG["FormButton"]."\" class=\"input\">"; return $menu_array; } Replace *****/ with your homepage URL 2.) Now add a javascript function to the guestbook header. Search for the file header.php and add this: ><script language="javascript"> <!-- function urlJump(target,selObj) { var optionValue = selObj.options[selObj.selectedIndex].value; var isURL = /http:/; var regMatch = isURL.test(optionValue); if(regMatch == true) { eval(target+".location='"+selObj.options[selObj.selectedIndex].value+"'"); } } // --> </script> </head> <body bgcolor="$VARS[pbgcolor]" link="$VARS[link_color]" vlink="$VARS[link_color]"> Quote
bellringr Posted February 6, 2004 Author Posted February 6, 2004 Ahhh...I did not realize that the jump menu was for when you have multiple pages in a guestbook. I think I will leave it alone then. As I told Rick after he helped me delete my first one (I screwed up some script), I wasn't going to mess around with it anymore unless I knew what I was doing. Thanks Big G! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.