PHP error on Joomla Site

Greetings,

Im new to the site so I would greatly appreciate the help. I dont know php well so I may ask some noob questions.

I am getting the following error on my Joomla site. It has totally messed up the configuration of the site especially in IE.

http://www.alqaeminstitute.com

Warning: Division by zero in /home/alqaemin/public_html/templates/ja_bellatrix/index.php on line 40

Just let me know what info you need to help me out.

Thanks in advance.

It’s a math error. Division by 0 is illegal. I don’t know Joomla that well but posting that line of code being reported may get some more responses. Could be some configuration parameter set to 0 by mistake?

Thanks for the reply.

I have put below the first 70 or so lines of the index.php file. Help would greatly be appreciated.

[code]<?php
/*------------------------------------------------------------------------

JA Pollux 1.0 - Nov, 2006

------------------------------------------------------------------------

Copyright © 2004-2006 J.O.O.M Solutions Co., Ltd. All Rights Reserved.

@license - Copyrighted Commercial Software

Author: J.O.O.M Solutions Co., Ltd

Websites: http://www.joomlart.com - http://www.joomlancers.com

-------------------------------------------------------------------------*/

defined( ‘_VALID_MOS’ ) or die( ‘Restricted access’ );
$iso = split( ‘=’, _ISO );
/echo “<?xml version=“1.0” encoding=”’. $iso[1] .’"?’ .’>";/
global $ja_color_themes, $ja_header_images, $ja_width_default, $ja_color_default, $ja_font_size_default, $ja_tool, $ja_menutype, $ja_template_path, $ja_template_absolute_path, $ja_headerimg, $ja_color, $ja_width, $ja_font_size, $ja_template_name;

$ja_template_name = ‘ja_bellatrix’;

TEMPLATE CONFIGURATIONS

####################################
#support extra color themes
$ja_color_themes = array(‘default’, ‘brick’, ‘green’); // You can add more color array if needed
####################################

Change the width of the template

$ja_width_default = ‘narrow’; // ‘narrow’: 800x600; ‘wide’: 1024x768; ‘auto’: fluid width

default color

$ja_color_default = ‘default’; //blank for default, else pick one of in extra color themes $ja_color_themes
#font size default
$ja_font_size_default = 5;

Enable users option

$ja_tool = 0; // 0: disable all; 1: disable color, enable font; 2: enable color, disable font; 3: enable all.

Choose your prefer Menu Type

$ja_menutype = 2; // 1: Split Menu; 2: Son of Suckerfish Dropdown Menu; 3: Transmenu; 4: Script Dropline Menu;

END: TEMPLATE CONFIGURATIONS

Define the template path

$ja_template_path = $mosConfig_live_site.’/templates/’.$ja_template_name;
$ja_template_absolute_path = $mosConfig_absolute_path.’/templates/’.$ja_template_name;
include ($ja_template_absolute_path."/ja_templatetools.php");

$ja_headerimg = $ja_header_images [getCurrentMenuIndex() % count($ja_header_images)];
if (!is_file("$ja_template_absolute_path/images/$ja_color/$ja_headerimg")) $ja_headerimg = $ja_header_images [0];

$topnav = “”;
$subnav = “”;
if ($ja_menutype == 1) {
require($ja_template_absolute_path."/ja_splitmenu.php");
$topnav = ja_topNav(‘mainmenu’, array(‘default’));
$subnav = ja_subNav(‘mainmenu’);
} else if ($ja_menutype == 4) {
require($ja_template_absolute_path."/ja_scriptdlmenu.php");
$topnav = $jamenu->menuObj->main;
$subnav = $jamenu->menuObj->sub;
}

Auto Collapse Divs Functions

$ja_left = mosCountModules( ‘left’ );
$ja_right = mosCountModules( ‘right’ );

if ( $ja_left && $ja_right ) {
$divid = ‘’;
} elseif ( $ja_left ) {
$divid = ‘-fr’;
} elseif ( $ja_right ) {
$divid = ‘-fl’;
} else {
$divid = ‘-f’;
}

Top Spotlight

$topmodule = 0;
if( mosCountModules(‘user7’) ) $topmodule++;
if( mosCountModules(‘user8’) ) $topmodule++;
if( mosCountModules(‘user9’) ) $topmodule++;

if ( $topmodule == 3 ) {
$divtopwidth = ‘33.3%’;
} else if ($topmodule == 2) {
$divtopwidth = ‘50%’;
} else if ($topmodule == 1) {
$divtopwidth = ‘100%’;
}[/code]

Well, line 40 of what you posted is this

$ja_headerimg = $ja_header_images [getCurrentMenuIndex() % count($ja_header_images)];

And there is no division operater. Just the modulus operator, which is % which gives the remainder of two numbers being divided. I don’t get that warining if 0 is used with the modulus operator using php 5.1.1. Previous versions of PHP may give that warning? Find out what $ja_header_images is and if the count of that array is 0 then maybe that is what is giving the warning.

Sponsor our Newsletter | Privacy Policy | Terms of Service