After successfully installing Zen Cart on my Fedora 12 Linux Box, I immediately got a blank screen when I tried either the main page or the admin page. After using the information found in the tutorial, "I am getting a blank page (or blank part of a page)", I realized that Zen Cart was defining the function
date_diff in both includes/functions/functions_general.php and in admin/includes/functions/general.php.
I fixed this problem by enclosing both definitions in a
if(!function_defined("date_diff")){
function date_diff($date1, $date2) {
//$date1 today, or any other day
//$date2 date to check against
$d1 = explode("-", $date1);
$y1 = $d1[0];
$m1 = $d1[1];
$d1 = $d1[2];
$d2 = explode("-", $date2);
$y2 = $d2[0];
$m2 = $d2[1];
$d2 = $d2[2];
$date1_set = mktime(0,0,0, $m1, $d1, $y1);
$date2_set = mktime(0,0,0, $m2, $d2, $y2);
return(round(($date2_set-$date1_set)/(60*60*24)));
}
}
Bookmarks