Coding Problem

g4m3rof1337

Active Member
I'm trying to install a Joomla template, and I keep getting this error code on top of the page when I default it, I googled the error code and came up with this, http://forum.joomla.org/viewtopic.php?f=42&t=267227&p=1209293, I downloaded Notepad++ and edited the .php file, then tried it again, same problem..

I'm just copying that solution, and pasting it in front of the 64th line.



Edit: I have to edit the file while it's in a .rar file, so I can upload it, and I'm trying to edit it while it's in the .rar file, and it doesn't appear to be saving.. I went to check it, in the .rar file, and the edit isn't there.



Any ideas?



Thanks.
 
Last edited:
Edit: I have to edit the file while it's in a .rar file, so I can upload it, and I'm trying to edit it while it's in the .rar file, and it doesn't appear to be saving.. I went to check it, in the .rar file, and the edit isn't there.

Try this. Drag the particular file from the .rar to your desktop. Open that file in Notepad++, edit it, and Save. Now drag it back into the .rar file. It should say "File already exists. Overwrite existing file?" and hit Yes.

Or, if you are on a VPS, you can enter the admin panel through WHM (Web Host Manager), and you can configure the PHP.ini file. Find the Error Reporting settings, and set Show Warnings to off.

It's being caused because the line 64 of that file is diving by 0, and in math when you divide by 0, the answer is undefined. The solution he presents is an indirect fix. Instead of fixing the problem, he hides the warning message.

Code:
[B]error_reporting(0);[/B] $id .= $tab_colors[($tab_index)%count($tab_colors)];
What he should have done is skipped the dividing procedure if the number is being divided by zero.

Code:
// [B]error_reporting(0); delete this line[/B]
if (count($tab_colors) < 1) {
    $id .= $tab_colors[0];
} else {
    $id .= $tab_colors[($tab_index)%count($tab_colors)];
}
 
Last edited:
Back
Top