MyBB Community Forums

Full Version: Warning Division by zero
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm getting this when I click on the reputation link of some users, especially me. Smile


The following warnings occurred:
Warning [2] Division by zero - Line: 851 - File: inc/functions.php PHP 5.3.3-7+squeeze3 (Linux)
File	Line	Function
/inc/functions.php	851	errorHandler->error
/reputation.php	649	multipage

I went to line 851 and found this:
	$pages = ceil($count / $perpage);

I solved it by adding this code after removing line 851:

	if($perpage > 0)
	{
		$pages = ceil($count / $perpage);
	}
	else
	{
		return;
	}

But I was wondering why this occured and whether there was a more elegant solution. Wink
Link to your forum?
The site is not loading for me.
If you're from India, it could be a DNS issue. I had to change my DNS to get my site to load. Smile