Quote:
Originally Posted by Photon
I've read this whole thread but I can't find the solution for my problem..
Warning: Division by zero in /usr/home/elimina/public_html/drive/forums/album.php on line 142
Warning: Division by zero in /usr/home/elimina/public_html/drive/forums/includes/functions.php on line 1707
can someone help me??
|
the problem is caused by LIMIT=0 in SQL.
In fact the SQL syntax in album.php is:
PHP Code:
// Query: fetch profile pictures
////////////////////////////////////
$images = $DB_site->query("
SELECT user.userid, dateline,
comment, user.username, user.usertitle,
user.joindate, user.usergroupid, user.notescount
FROM ".TABLE_PREFIX."customprofilepic
LEFT JOIN ".TABLE_PREFIX."user USING (userid)
WHERE visible=1
$condition
ORDER BY $sort $order
LIMIT " . ($minlimit-1) . ", $perpage
");
LIMIT is determined by the variable $minlimit in album.php that shouldn't give 0.
$minlimit is determined so:
PHP Code:
// Build page scope
///////////////////////
$pagenumber = $page > 0 ? $page : 1;
$rows = $result['count'];
$pages = ceil($rows / $perpage);
if ($pagenumber < 1)
{
$pagenumber = 1;
}
else if ($pagenumber > $rows)
{
$pagenumber = $rows;
}
$minlimit = ($pagenumber - 1) * $perpage+1;
$maxlimit = ($pagenumber) * $perpage;
if ($maxlimit > $rows)
{
$maxlimit = $rows;
$minlimit = $minlimit > $rows ? $rows-$perpage : $minlimit;
}
$minlimit = $minlimit <= 0 ? 1 : $minlimit;
$pagenav = construct_page_nav(
$rows,
"album.php?$session[sessionurl]type=$_REQUEST[type]",
"&pp=$perpage<r=$ltr&sort=$sort&order=$order"
);
maybe you need to change the setting perpage and rows?
Or better reinstalling the whole hack?
:-D