Find out more about the “Show Off Your Avatar Campaign
RocketTheme  |  General  |  The Water Cooler  |  Topic: Warning: Division by zero in rt_splitmenu.php « previous next »
Pages: [1] 2 3 Go Down Print
Author Topic: Warning: Division by zero in rt_splitmenu.php  (Read 24191 times)
J.M. Sanders
Newbie
*
Offline Offline

Posts: 10

Warning: Division by zero in rt_splitmenu.php
« on: November 20, 2006, 04:22:02 PM »

Hello All,

I use the ModernBusiness template and since a few days my page doesn't load right anymore and I get this messages:

Warning: Division by zero in D:\www\...\rt_splitmenu.php on line 63

My host did an update of php to 5.2.

Does anyone knows how to get rid of the error?

Much appreciated!

(I don't know if this is the right forum for this but because the ModernBusiness forum doesn't appear for me, I post this here.)
Logged
Andy Miller
RocketTheme
Hero Rocketteer
*
Offline Offline

Posts: 5974


RTTC Kahuna

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #1 on: November 20, 2006, 04:53:48 PM »

do you any items in the menu used by splitmenu?  probably main menu?
Logged
J.M. Sanders
Newbie
*
Offline Offline

Posts: 10

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #2 on: November 20, 2006, 05:28:09 PM »

Thank you for replying! Yes I use the main menu. Don't know excactly what you mean.
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #3 on: November 21, 2006, 02:47:34 AM »

I also suddenly got the warning:
Quote
Warning: Division by zero in /home/mysite/public_html/templates/rt_modbusiness/rt_splitmenu.php on line 63

Warning: Division by zero in /home/mysite/public_html/templates/rt_modbusiness/rt_splitmenu.php on line 63

Warning: Division by zero in /home/mysite/public_html/templates/rt_modbusiness/rt_splitmenu.php on line 63

Warning: Division by zero in /home/mysite/public_html/templates/rt_modbusiness/rt_splitmenu.php on line 63

I see it in both FireFox and IE7

It "suddenly" appeared, and I am pretty sure I didn't see it last time I updated my site.

If I chose "module" in stead of "splitmenu" in the config for template it (the warning) doesn't show (of cource).

It doesn't matter wether if I put a "sub-menu item" into the main menu or not.


How can this be? - What do you believe is the case?
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #4 on: November 21, 2006, 08:38:09 AM »

Now it's all gone - without me changing anything. It might be a server problem(!) Huh
Logged
J.M. Sanders
Newbie
*
Offline Offline

Posts: 10

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #5 on: November 21, 2006, 11:37:33 AM »

I still have this problem. My site is 'down' because of this error. No solutions?
Thx in advance.
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #6 on: November 22, 2006, 09:38:34 AM »

Sorry, the problem remains...
It looked it did work due to a DNS that showed the old site...

The problems still remains...
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #7 on: November 22, 2006, 10:05:08 AM »

Line 63 says:

Code:
if ($color_index && isset($tab_colors[($tab_index)%count($tab_colors)])) {
$id .= $tab_colors[($tab_index)%count($tab_colors)];
$tab_index++;
Logged
Andy Miller
RocketTheme
Hero Rocketteer
*
Offline Offline

Posts: 5974


RTTC Kahuna

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #8 on: November 22, 2006, 10:06:50 AM »

what value do you have for $tab_colors at the top of the file?
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #9 on: November 22, 2006, 10:27:19 AM »

Code:
$tab_color = 'white';
Line 20

Is this the one?
Logged
Andy Miller
RocketTheme
Hero Rocketteer
*
Offline Offline

Posts: 5974


RTTC Kahuna

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #10 on: November 22, 2006, 10:28:24 AM »

actually, probalby best to send me your whole rt_splitmenu.php file to support(a)rockettheme.com
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #11 on: November 22, 2006, 11:43:08 AM »

Email sent... :-)

I guess it's the original file (can't remember that I have modded this one...)
Logged
Andy Miller
RocketTheme
Hero Rocketteer
*
Offline Offline

Posts: 5974


RTTC Kahuna

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #12 on: November 22, 2006, 12:24:05 PM »

the file looks fine.. the only place i can see that a division by zero error would occur is with the modulus operator (%), and that means $tab_color would have to be zero which makes no sense as tab_color is a global here.  Only thing i can think of is on line 62 put:

$tab_color = 'white';
Logged
Preben Olsen Sangvik
Newbie
*
Offline Offline

Posts: 14

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #13 on: November 22, 2006, 03:01:12 PM »

Do you mean like this:  (?)
Code:
$tab_color = 'white';
if ($color_index && isset($tab_colors[($tab_index)%count($tab_colors)])) {
$id .= $tab_colors[($tab_index)%count($tab_colors)];
$tab_index++;

$tab_color = 'white';   / on line 62 ...

Didn't work. See www.sangvik.com
Logged
Andy Miller
RocketTheme
Hero Rocketteer
*
Offline Offline

Posts: 5974


RTTC Kahuna

Re: Warning: Division by zero in rt_splitmenu.php
« Reply #14 on: November 22, 2006, 08:35:02 PM »

quick fix, replace that line 62 you just added with:

error_reporting(0);
Logged
Pages: [1] 2 3 Go Up Print 
RocketTheme  |  General  |  The Water Cooler  |  Topic: Warning: Division by zero in rt_splitmenu.php « previous next »
Jump to: