Birthday List error - Division By Zero

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Gast

Birthday List error - Division By Zero

Beitrag von Gast »

Your phpBB Version: 2.0.15
Your phpBB Type: Standard phpBB (also called Vanilla)
MODs: No
Your knowledge: Advanced Knowledge
Boardlink: http://www.covenantofdeath.org

PHP Version:
MySQL Version:


What have you done before the problem was there?
Applied the Birthday List mod with CalPro 2.0.39.


What have you already tryed to solve the problem?




Description and Message

Getting an error when enabling the birthday list mod and trying to list the birthdays:

Warning: Division by zero in /usr/local/psa/home/vhosts/covenantofdeath.org/httpdocs/includes/functions.php on line 560

Warning: Division by zero in /usr/local/psa/home/vhosts/covenantofdeath.org/httpdocs/includes/functions.php on line 567

Warning: Division by zero in /usr/local/psa/home/vhosts/covenantofdeath.org/httpdocs/cal_birthday_list.php on line 129

Warning: Division by zero in /usr/local/psa/home/vhosts/covenantofdeath.org/httpdocs/cal_birthday_list.php on line 129


Any idea why this error might be occurring? CalPro ver. 2.0.39 by Snailsource.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

CalPro 2.0.39? A new release :(

Which is the line 560 on your functions.php?
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Gast

Beitrag von Gast »

[quote="oxpus - Tue 24.May, 2005 12:12";p="33052"]CalPro 2.0.39? A new release :(

Which is the line 560 on your functions.php?[/quote]

(560) $total_pages = ceil($num_items/$per_page);

if ( $total_pages == 1 )
{
return '';
}

(567) $on_page = floor($start_item / $per_page) + 1;
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Okay. Replace "$per_page" with "$board_config['topics_per_page']" and retry.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Gast

Beitrag von Gast »

Thankyou for the reply :) I've tried your suggestion and got the exact same error/No change.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Okay, so try this:

Code: Alles auswählen

#
#-----[ FIND ]-----
#
 $total_pages = ceil($num_items/$per_page); 

#
#-----[ REPLACE WITH ]-----
#
 $total_pages = (intval($num_items) != 0) ? ceil($num_items/$board_config['topics_per_page']) : 0; 
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Gast

Beitrag von Gast »

Exact same errors.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

???
Then this line is not the real reason for this error...
Change

Code: Alles auswählen

$on_page = floor($start_item / $per_page) + 1;
into

Code: Alles auswählen

$on_page = ($start_item) ? floor($start_item / $per_page) + 1 : 0;
too, and retry.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Antworten