Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Issue with Complete Reviews System Contribution


benelson

Recommended Posts

Hi all this is my first of many posts here I hope!

 

I just installed the contribution Complete Reviews System, the "Complete Reviews System with Star Rating System" package. It works great. I then attempted to install the extremely simple "Complete Reviews System (Admin) V1.5.txt" package.

The contribution can be found at: http://addons.oscommerce.com/info/4397

 

After installing the new admin addon I get the following error in the "Reviews" page in the admin area:

 

Warning: Division by zero in /home/lightzom/public_html/teststore/admin/includes/classes/split_page_results.php on line 33
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, MAX_SEARCH_RESULTS_ADMIN' at line 1

select reviews_id, products_id, last_modified, reviews_rating, approved, date_added from reviews order by date_added DESC limit -0, MAX_SEARCH_RESULTS_ADMIN

 

I tried to find what is causing the error in the admin/reviews.php file that is completely replaced and in the modified file admin/includes/functions/html_output.php . Neither of which look like they would produce this error. I'm sorry if this is an overly simple fix but I can't seem to figure it out and didn't see a topic already created for this contribution.

 

Thanks!

Link to comment
Share on other sites

Sounds like you're on an unpatched version of osCommerce. There is a fix for split_page_results.php, both the catalog and the admin version, specifically for this error.

 

In both files, change this:

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

to this:

$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

 

You should strongly consider applying the current patches.

 

-jared

Link to comment
Share on other sites

Hey Jared thanks for the reply!

I just went into both files and they were both already updated with the line you said to change.

The admin page reads:

      $offset = ($max_rows_per_page * ($current_page_number - 1));
     $sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

The catalog one reads:

      $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

     $this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;

Link to comment
Share on other sites

Hi All - have any of you located a way to fix the issue with the Complete Reviews System as stated above? I too have the same problem and have spent the past two hours searching the forums for an answer, but to no avail! Your help or guidance would be greatly apprciated!

 

James

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...