"Warning: Division by zero in albums.php on line 61&quo

verrecke

Joined: 2002-11-15
Posts: 24
Posted: Thu, 2005-02-10 16:18

Once again: I've upgraded to pl6 and here he is again, our most beloved evergreen, the "Division by zero"-error.
See it in action under http://www.hymenoptera.de/html/modules/gallery/albums.php.
Maybe a PHP5 error?

Gallery version: v1.4.4-pl6
Apache version: Apache 2.0
PHP version: 5.0.3
Graphics Toolkit: NetPBM
Operating system: Linux dd7136 2.4.21

Thanks for your input

Mel

 
verrecke

Joined: 2002-11-15
Posts: 24
Posted: Thu, 2005-02-10 16:56

Whoever encounters this nicely "Division by zero" in albums.php may try this:
Open albums.php
Find line 61 saying $maxPages = max(ceil($numAlbums / $perPage), 1);
and change it (in this case, having 6 ambums per page) to
$maxPages = max(ceil($numAlbums / 6), 1);

I can`t tell why it doesn`t read the config.php - this parameter has been set according to the config file:
$gallery->app->default["albumsPerPage"] = "6";

Anyway, I still can't see any Albums...wow, this is complicated stuff...

Mel