From 41a64bd78837db4783be6893ddd026fff8baca0c Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 9 May 2003 15:24:16 +0000 Subject: [PATCH] corrected image handling and debugged --- lib/dashboard/DashboardNews.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dashboard/DashboardNews.inc b/lib/dashboard/DashboardNews.inc index ddbe973..dc94b70 100644 --- a/lib/dashboard/DashboardNews.inc +++ b/lib/dashboard/DashboardNews.inc @@ -52,7 +52,7 @@ class DashboardNews { * @param string the body * @param integer the rank */ - function DashboardNews($sNewSynopsis, $sNewBody, $iNewRank, $mImage) { + function DashboardNews($sNewSynopsis, $sNewBody, $iNewRank, $mImage = "") { // primary key not set as document is not stored yet $this->iId = -1; $this->setSynopsis($sNewSynopsis); @@ -236,8 +236,8 @@ class DashboardNews { "body = '" . addslashes($this->sBody) . "', " . "rank = $this->iRank, " . "image = '" . addslashes($this->sImage) . "', " . - "image_size = $this->iImageSize, " . - "image_mime_type_id = $this->iImageMimeTypeID " . + "image_size = $this->iImageSize " . + ($this->iImageMimeTypeID ? ", image_mime_type_id = $this->iImageMimeTypeID " : "") . "WHERE id = $this->iId"; $result = $sql->query($sQuery); if ($result) { @@ -285,7 +285,7 @@ class DashboardNews { "mimetypeid" => $sql->f("image_mime_type_id") ); $oDashboardNews = & new DashboardNews(stripslashes($sql->f("synopsis")), stripslashes($sql->f("body")), $sql->f("rank"), $aImage); - $oDashboardNews->iId = $iDocumentID; + $oDashboardNews->iId = $iNewsID; return $oDashboardNews; } return false; -- libgit2 0.21.4