Why have this function:
PHP Code:
function getbgclass()
{
global $bgcounter;
if ($bgcounter++%2 == '0')
{
return 'alt2';
}
else
{
return 'alt1';
}
}
There is already a global declared called $bgclass and a function in functions.php to toggle it between two background colors.
PHP Code:
// ###################### Start altbgclass #######################
// reads in $bgclass and returns the alternate table class
// $alternate allows us to have multiple classes on one page without them overwriting each other
function exec_switch_bg($alternate = 0)
...
Also instead of refererncing field names throughout the code, making it more likely that errors will creep in when those field numbers do not match in individual installs, you can assign those values to constant defines in "init.php" which allows you to access the information via these constants in the other codes edits. This lowers the chance of errors being introduced while the hack is being installed.