for ($d=1; $d<=$endDate; $d++) {
if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 0) { echo "<tr>\n"; }
$result = dbquery("SELECT * FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'");
$data = dbarray($result);
$id = $data['post_id'];
$title = $data['post_title'];
$evday = strtotime($data['post_date']); /*THIS LINE IS CAUSING THE ERROR*/
if (date("d", $evday) == $d) {
for ($d=1; $d<=$endDate; $d++) {
if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 0) { echo "<tr>\n"; }
$result = dbquery("SELECT post_id, post_title, post_date FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'");
$data = dbarray($result);
if($data['post_id'] == false || is_null($data['post_id'])) {
$id = ''; } else { $id = $data['post_id']; }
if($data['post_title'] == false || is_null($data['post_title'])) {
$title = ''; } else { $title = $data['post_title']; }
if(strtotime($data['post_date']) == false || is_null(strtotime($data['post_date']))) {
$evday = ''; } else { $evday = strtotime($data['post_date']); }
if (date("d", $evday) == $d) {
echo "<td height='35' class='event' align='center' valign='middle'>\n";
} elseif ($d == $day && $cMonth == date('m')) {
echo "<td height='35' class='today' align='center' valign='middle'>\n";
} else {
echo "<td height='35' class='cal-norm' align='center' valign='middle'>\n";
}
if ($d == $day && $cMonth == date('m') && $d <> $evday) {
echo "<a class='cal2' href='#' title='".$locale['gb_513']."'><b>$d</b></a>\n";
} elseif ($d == $day && $cMonth == date('m') && $d == $evday) {
echo "<a class='cal2' href='#' title='".$locale['gb_513']." - $title'><b>$d</b></a>\n";
} elseif ($evday) {
echo "<a class='ecal' href='".BASEDIR."grims_blog/filtered.php?post_id=$id' title='$title'><b>$d</b></a>\n";
} else {
echo "<span class='noevt'><b>$d</b></span>\n";
}
$result = dbquery("SELECT post_id, post_title, post_date FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'");
$data = dbarray($result);
if($data['post_id'] == false || is_null($data['post_id'])) {
$id = $data['post_id'] ? $data['post_id'] : 'default value';
$id = ''; } else { $id = $data['post_id']; }
if($data['post_title'] == false || is_null($data['post_title'])) {
$title = $data['post_title'] ? $data['post_title'] : 'default value';
$title = ''; } else { $title = $data['post_title']; }
if(strtotime($data['post_date']) == false || is_null(strtotime($data['post_date']))) {
$evday = $data['post_date'] ? $data['post_date'] : 'default value';
$evday = ''; } else { $evday = strtotime($data['post_date']); }
for ($d=1; $d<=$endDate; $d++) {
if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 0) { echo "<tr>\n"; }
$result = dbquery("SELECT post_id, post_title, post_date FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'");
$data = dbarray($result);
$stuff1 = $data['post_id'] ? $data['post_id'] : ''; /* ERROR LINE */
$id = $stuff1;
$stuff2 = $data['post_title'] ? $data['post_title'] : ''; /* ERROR LINE */
$title = $stuff2;
$stuff3 = strtotime($data['post_date']) ? strtotime($data['post_date']) : ''; /* ERROR LINE */
$evday = $stuff3;
if (date("d", intval($evday)) == $d) {
echo "<td height='35' class='event' align='center' valign='middle'>\n";
} elseif ($d == $day && $cMonth == date('m') && $cYear == date('Y')) {
echo "<td height='35' class='today' align='center' valign='middle'>\n";
} else {
echo "<td height='35' class='cal-norm' align='center' valign='middle'>\n";
}
if ($d == $day && $cMonth == date('m') && $d <> $evday) {
echo "<a class='cal2' href='#' title='".$locale['gb_513']."'><b>$d</b></a>\n";
} elseif ($d == $day && $cMonth == date('m') && $d == $evday) {
echo "<a class='cal2' href='#' title='".$locale['gb_513']." - $title'><b>$d</b></a>\n";
} elseif ($evday) {
echo "<a class='ecal' href='".BASEDIR."grims_blog/filtered.php?post_id=$id' title='$title'><b>$d</b></a>\n";
} else {
echo "<span class='noevt'><b>$d</b></span>\n";
}
echo "</td>\n";
if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 6) { echo "</tr>\n"; }
}
dbrows($result)
? These errors obviously occur when you loading something that does not exist.$result = dbquery("SELECT post_id, post_title, post_date FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'");
if (dbrows($result) > 0) {
$data = dbarray($result);
$id = $data['post_id'];
$title = $data['post_title'];
$evday = strtotime($data['post_date']);
}
$data = dbarray($result);
if (empty($data['post_id'])) {
$id = null;
} else { $id = $data['post_id']; }
if (empty($data['post_title'])) {
$title = null;
} else { $title = $data['post_title']; }
if (empty($data['post_date'])) {
$evday = null;
} else { $evday = strtotime($data['post_date']); }
$data = dbarray($result);
if (!$data) {
$id = null; $title = null; $evday = null;
} else {
$id = $data['post_id'];
$title = $data['post_title'];
$evday = strtotime($data['post_date']);
}
for ($d=1; $d<=$endDate; $d++) {
// begin added code
$padd = $d;
$padd = str_pad($padd, 2, '0', STR_PAD_LEFT);
echo $padd;
// end of added code
if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 0) { echo "<tr>\n"; }
$result = dbquery("SELECT post_id, post_title, post_date FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'");
$data = dbarray($result);
if (!$data) {
$id = null; $title = null; $evday = null;
} else {
$id = $data['post_id'];
$title = $data['post_title'];
$evday = strtotime($data['post_date']);
}
if (date("d", intval($evday)) == $d) {
echo "<td height='35' width='35' class='event' align='center' valign='middle'>\n";
} elseif ($d == $day && $cMonth == date('m') && $cYear == date('Y')) {
echo "<td height='35' width='35' class='today' align='center' valign='middle'>\n";
} else {
echo "<td height='35' width='35' class='cal-norm' align='center' valign='middle'>\n";
}
if ($d == $day && $cMonth == date('m') && $d <> $evday) {
echo "<a class='cal2' href='#' title='".$locale['gb_513']."'><b>$d</b></a>\n";
} elseif ($d == $day && $cMonth == date('m') && $d == $evday) {
echo "<a class='cal2' href='".BASEDIR."grims_blog/filtered.php?post_id=$id' title='$title'><b>$d</b></a>\n";
} elseif ($evday) {
echo "<a class='ecal' href='".BASEDIR."grims_blog/filtered.php?post_id=$id' title='$title'><b>$d</b></a>\n";
} else {
echo "<span class='noevt'><b>$d</b></span>\n";
}
echo "</td>\n";
if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 6) { echo "</tr>\n"; }
}
for ($d=1; $d<=$endDate; $d++) {
if ($d < 10) {
$d = str_pad($d, 2, "0", STR_PAD_LEFT);
};
Category Forum
Modifications and Requests - 9Labels
Statistics
5 participants
Notifications
You are not receiving notifications from this thread.
Related Questions