Warning: Division by zero in rt_splitmenu.php

Everything and Anything not covered by other forums.
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.)
J.M. Sanders
Newbie
Newbie
 
Posts: 10

do you any items in the menu used by splitmenu?  probably main menu?
Andy Miller
RocketTheme.com
User avatar
Andy Miller
Team RocketTheme
Team RocketTheme
 
Posts: 6878
Location: Golden, CO

Thank you for replying! Yes I use the main menu. Don't know excactly what you mean.
J.M. Sanders
Newbie
Newbie
 
Posts: 10

I also suddenly got the warning:
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?
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

Now it's all gone - without me changing anything. It might be a server problem(!) ???
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

I still have this problem. My site is 'down' because of this error. No solutions?
Thx in advance.
J.M. Sanders
Newbie
Newbie
 
Posts: 10

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

The problems still remains...
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

Line 63 says:

  1. if ($color_index && isset($tab_colors[($tab_index)%count($tab_colors)])) {
  2.             $id .= $tab_colors[($tab_index)%count($tab_colors)];
  3.             $tab_index++;
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

what value do you have for $tab_colors at the top of the file?
Andy Miller
RocketTheme.com
User avatar
Andy Miller
Team RocketTheme
Team RocketTheme
 
Posts: 6878
Location: Golden, CO

  1.     $tab_color = 'white';

Line 20

Is this the one?
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

actually, probalby best to send me your whole rt_splitmenu.php file to support(a)rockettheme.com
Andy Miller
RocketTheme.com
User avatar
Andy Miller
Team RocketTheme
Team RocketTheme
 
Posts: 6878
Location: Golden, CO

Email sent... :-)

I guess it's the original file (can't remember that I have modded this one...)
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

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';
Andy Miller
RocketTheme.com
User avatar
Andy Miller
Team RocketTheme
Team RocketTheme
 
Posts: 6878
Location: Golden, CO

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


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

Didn't work. See www.sangvik.com
Preben Olsen Sangvik
Newbie
Newbie
 
Posts: 14

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

error_reporting(0);
Andy Miller
RocketTheme.com
User avatar
Andy Miller
Team RocketTheme
Team RocketTheme
 
Posts: 6878
Location: Golden, CO

Next

Return to The Water Cooler

Who is online

Users browsing this forum: Google [Bot] and 0 guests