I use Jetbox CMS. I know bad choice. But for now I would like to correct some errors in the code, but don't know enough about php to correct them. I think Jetbox CMS was designed to work with php3 but wasn't released until php5 was widely used. I hacked some fixes suggested by other users using php5. But now I get these errors in my web log everytime someone visits the website (index.php). Not to mention it slows the load time of the site, about 8secs! Which is an improvement, it used to be 35secs! I would greatly appreciate any help or suggestions. Thanks so much in advance.
Fedora Core 6
Mysql 5.0.22
Php 5.1.6
Php 5.0.4 - fastcgi
Apache 2.2.3
Code:
# tail /var/www/log/error.log
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 9 in /var/www/index.php on line 80
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 8 in /var/www/index.php on line 81
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 9 in /var/www/index.php on line 82
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 10 in /var/www/index.php on line 80
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 11 in /var/www/index.php on line 80
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 10 in /var/www/index.php on line 81
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined offset: 11 in /var/www/index.php on line 82
[Fri Nov 10 12:41:34 2006] [error] [client] PHP Notice: Undefined variable: error_message in /var/www/index.php on line 92
[Fri Nov 10 12:41:39 2006] [error] [client] PHP Notice: Undefined index: frontsession in /var/www/index.php on line 112
[Fri Nov 10 12:41:39 2006] [error] [client] PHP Notice: Undefined offset: 0 in /var/www/includes/template.inc on line 320
/var/www/index.php, Lines 78-83:
Code:
for($split=0;$split<5;$split++){
$install_dir_count+=2;
$_URL[$url[$install_dir_count]]=$url[$install_dir_count+1];
$url[$install_dir_count]=urldecode($url[$install_dir_count]);
$$url[$install_dir_count]=urldecode($url[$install_dir_count+1]);
}
/var/www/index.php, Lines 92-94:
Code:
if ($install_jetbox==true || $error_message<>'') {
include("includes/f_error_handling.php");
}
/var/www/index.php, Lines 97-121:
Code:
else{
// Statistics
// Can be configured in general_settings.inc.php
if ($phpOpenTracker_enabled==true) {
// prepend phpOpenTracker for statistics
require_once 'phpOpenTracker.php';
phpOpenTracker::log();
}
// Someone may be logged-in
// Login and registration is handeled by webuser.php
// All login & registration function can be found in /includes/f_jetstream_core_one.inc.php
// Check out webuser.php for more info if something goes wrong
// Check for front-end session
if ($_COOKIE[session_name()]) {
session_start();
if ($_SESSION["uid"] && $_SESSION["type"]=="frontend") {
$uresult=mysql_prefix_query("SELECT * FROM webuser WHERE uid='".$_SESSION["uid"]."'") or die(mysql_error());
if (mysql_num_rows($uresult)>0) {
$uarray=mysql_fetch_array($uresult);
}
}
}
}
/var/www/includes/template.inc, Lines 304-323 :
Code:
function set_block($parent, $varname, $name = "") {
if ($this->debug & 4) {
echo "<p><b>set_block:</b> parent = $parent, varname = $varname, name = $name</p>\n";
}
if (!$this->loadfile($parent)) {
$this->halt("set_block: unable to load $parent.");
return false;
}
if ($name == "") {
$name = $varname;
}
$str = $this->get_var($parent);
$reg = "/[ \t]*<!--\s+BEGIN $varname\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $varname\s+-->\s*?\n?/sm";
preg_match_all($reg, $str, $m);
$str = preg_replace($reg, "{" . "$name}", $str);
$this->set_var($varname, $m[1][0]);
$this->set_var($parent, $str);
return true;
}