Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Drop Down Menu Help


agiftcodotcom

Recommended Posts

I used the Fancy split_page_results Navigation V1 contribution, which gives me a button for [Next>>] and [<<Previous] and a drop down menu for number of pages. For some reason, my pages always show 5, regardless of how many there actually are. Here is an example of one of my pages. There should only be 3 pages, but it shows 5.

 

 

I'm guessing it would be in the following code, but I'm not sure where...

 

  // display split-page-number-links
   function display_links($max_page_links, $parameters = '', $count_text) {
     global $PHP_SELF, $request_type;
     $display_links_string = '';
     $class = 'class="pageResults"';
     if (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';

// previous button - not displayed on first page
if ($this->current_page_number > 1) $display_links_string .= '<a href="'. tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . tep_image_button('button_previous.gif', IMAGE_BUTTON_PREVIOUS) . '</u></a>  ';
 // calculate number of pages needing links
    	 $num_pages = intval($query_numrows / $max_page_links);
?>
	 <td class="smallText"  valign="center" > 
     <form name="jump_to" method="get" action="<?php echo tep_href_link(basename($PHP_SELF)); ?>">
	 <?php
	 $pairs = explode("&", $parameters);
	 foreach($pairs as $pair)
	 {
   list($key,$value) = explode("=", $pair);
   echo tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));
	 }
	 echo TEXT_RESULT_PAGE;
	 ?>
 <select name="page" onChange="submit();"> 
	 <?php
       for ($jump_to_page = 1; ($jump_to_page <= $max_page_links); $jump_to_page++) {
        if ($jump_to_page == $count_text) {
       echo $max_page_links;
         echo '<option value='. $jump_to_page .' SELECTED>' . $jump_to_page . '</option>';
          }
        else
        {
       echo $max_page_links;
         echo '<option value='. $jump_to_page . '>' . $jump_to_page . '</option>';
        }
       }
     ?>
     </select></form>

     </td>
    <?php 
  	 echo '<td align="right" class="smallText"  valign="center" >';
// next window of pages
     if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a> ';
     
  if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . tep_image_button('button_next.gif', IMAGE_BUTTON_NEXT) . '</u></a> ';
     
  return $display_links_string;
   }

Contributions I used : Updated 06-13-04 23:42

----------------

Vote on My Graphis Poll

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...