Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need help with next and previous links on page


Liska23

Recommended Posts

Hi, I am new to this, don't know PHP that well, but was aksed to fix some problems on the this site, particularty with the next and previous links on the page. Here is the link to the page I am having a problem with: http://solomonframe.com/index.php?cPath=3

The next and previous links add an extra "index.php" to the link, resulting in the wrong link.

I know that 'split_page_results.php' is the file that handles that, and from what I figured it is the ' $parameters = '' ' that builds that part of the link and add the extra "index.php" to it.

However, I have no idea how to modify it. :huh:

 

Here is the section of the code, that I think i need to be modifying:

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

// display split-page-number-links

function display_links($max_page_links, $parameters = '', $arrows = false) {

if (PHP_VERSION < 4.1) {

global $_SERVER;

}

 

global $request_type;

 

$display_links_string = '';

 

$class = 'class="pageResults"';

 

if (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';

 

if ($arrows) {

// previous button - not displayed on first page

if ($this->current_page_number > 1) {

$display_links_string .= '<a href="' . tep_href_link(basename($_SERVER['PHP_SELF']), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . tep_image(DIR_WS_IMAGES . 'arrow-grn-lt.gif') . '</a>  ';

} else {

$display_links_string .= tep_image(DIR_WS_IMAGES . 'arrow-grn-lt-off.gif') . '  ';

}

 

// next button

if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) {

$display_links_string .= ' <a href="' . tep_href_link(basename($_SERVER['PHP_SELF']), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . tep_image(DIR_WS_IMAGES . 'arrow-grn-rt.gif') . '</a> ';

} else {

$display_links_string .= tep_image(DIR_WS_IMAGES . 'arrow-grn-rt-off.gif') . '  ';

}

...

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

and the rest of the elses repeat the link coding...

 

Please help. I don't know how to fix this problem.

 

Thank you.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...