Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Illegal division by zero : site_html_templates.pl

Quote Reply
Illegal division by zero : site_html_templates.pl
Please help me out with this one
Illegal division by zero at site_html_templates.pl line 1058.
Here's my line 1058

$totalpages = int($reviews/$reviews_per_page);
if ($totalpages < $reviews/$reviews_per_page) { $totalpages++; }
if ($page > $totalpages) { $page = 1; }

I am running review.cgi mod. I rechecked all my links.cfg and chmoded everything right what else can be wrong. Also, when there are no reviews, the page loads fine but when i add a review and validate it and then go back to it, I get this error.

Quote Reply
Re: Illegal division by zero : site_html_templates.pl In reply to
You need to have more than one review in your review.db for the link you are viewing.

Regards,

Eliot Lee

Quote Reply
Re: Illegal division by zero : site_html_templates.pl In reply to
I did that but it didn't work. I noticed one thing though. When i rate something and don't review. The page updates fine and i don't get the error. But when i try adding or viewing the page with a review i get this error. So i tried adding two reviews to a link but i still got it. As long as u don't review a link and u just rate it (1-10) the error doesn't come. What should i do?
One more thing
$totalpages = int($reviews/$reviews_per_page);
if ($totalpages < $reviews/$reviews_per_page) { $totalpages++; }
if ($page > $totalpages) { $page = 1; }

this is line 1058
in site_html_templates.pl, $reviews is defined as the reviews(duh) so it's not numbers but letters. But the script is dividing this variable. That doesn't make sense at least to me.
Thank for the quick reply.
Quote Reply
Re: Illegal division by zero : site_html_templates.pl In reply to
Make the Ratings field required.

Regards,

Eliot Lee

Quote Reply
Re: Illegal division by zero : site_html_templates.pl In reply to
how do i do that?
Thank for the quick reply.