Hi,
After I uploade my site I got this division by zero error.
Here is the code
if ($color_index && isset($tab_colors[($tab_index)%count($tab_colors)])) {
$id .= $tab_colors[($tab_index)%count($tab_colors)];
$tab_index++;
}
ANybody know how do I can fix this?
Thanks!
Warning: Division by zero error
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
- Rogue4ngel
- Joomla! Enthusiast
- Posts: 199
- Joined: Sun Nov 26, 2006 10:46 pm
- Location: New York
Re: Warning: Division by zero error
Sounds more like an installation issue than it does a coding problem (you haven't done any custom coding to the site, have you?). What version of Joomla are you using?
If you're not a part of the solution, you're a part of the problem.
Re: Warning: Division by zero error
Division by zero errors indicate you are dividing by zero - the value of this is undefined.sweet160 wrote:Hi,
if ($color_index && isset($tab_colors[($tab_index)%count($tab_colors)])) {
$id .= $tab_colors[($tab_index)%count($tab_colors)];
$tab_index++;
}
The only thing you are dividing by in here is count($tab_colors).
Change if to:
if ($color_index && count($tab_colors) != 0 && isset($tab_colors[($tab_index)%count($tab_colors)])) {
Ian
Help test my Component XML Generator Tool!
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1997/Itemid,35/
All feedback appreciated!
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1997/Itemid,35/
All feedback appreciated!
Re: Warning: Division by zero error
Ian,
Your the man! Its ok now, the errors are gone, and my website looks great thanks to you!
I cannot thank you enough
CHeers dude
Your the man! Its ok now, the errors are gone, and my website looks great thanks to you!
I cannot thank you enough
CHeers dude
Re: Warning: Division by zero error
Hey guys,
I'm also getting a division by zero error - Warning: Division by zero in /home/paradise/public_html/home/templates/rt_modbusiness/rt_splitmenu.php on line 63
This is the chunk of code.. any ideas? Thanks a bunch
default: is the line 63
I'm also getting a division by zero error - Warning: Division by zero in /home/paradise/public_html/home/templates/rt_modbusiness/rt_splitmenu.php on line 63
This is the chunk of code.. any ideas? Thanks a bunch
Code: Select all
}
}
break;
case 'content_typed':
default:
$mitem->link .= '&Itemid='. $mitem->id;
break;
}
- Rogue4ngel
- Joomla! Enthusiast
- Posts: 199
- Joined: Sun Nov 26, 2006 10:46 pm
- Location: New York
Re: Warning: Division by zero error
I don't see a division problem there. Could be the item is null (doesn't exist)? I'm not sure.
If you're not a part of the solution, you're a part of the problem.