Commit 41a64bd78837db4783be6893ddd026fff8baca0c
1 parent
ca92bb9f
corrected image handling and debugged
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1781 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
4 additions
and
4 deletions
lib/dashboard/DashboardNews.inc
| @@ -52,7 +52,7 @@ class DashboardNews { | @@ -52,7 +52,7 @@ class DashboardNews { | ||
| 52 | * @param string the body | 52 | * @param string the body |
| 53 | * @param integer the rank | 53 | * @param integer the rank |
| 54 | */ | 54 | */ |
| 55 | - function DashboardNews($sNewSynopsis, $sNewBody, $iNewRank, $mImage) { | 55 | + function DashboardNews($sNewSynopsis, $sNewBody, $iNewRank, $mImage = "") { |
| 56 | // primary key not set as document is not stored yet | 56 | // primary key not set as document is not stored yet |
| 57 | $this->iId = -1; | 57 | $this->iId = -1; |
| 58 | $this->setSynopsis($sNewSynopsis); | 58 | $this->setSynopsis($sNewSynopsis); |
| @@ -236,8 +236,8 @@ class DashboardNews { | @@ -236,8 +236,8 @@ class DashboardNews { | ||
| 236 | "body = '" . addslashes($this->sBody) . "', " . | 236 | "body = '" . addslashes($this->sBody) . "', " . |
| 237 | "rank = $this->iRank, " . | 237 | "rank = $this->iRank, " . |
| 238 | "image = '" . addslashes($this->sImage) . "', " . | 238 | "image = '" . addslashes($this->sImage) . "', " . |
| 239 | - "image_size = $this->iImageSize, " . | ||
| 240 | - "image_mime_type_id = $this->iImageMimeTypeID " . | 239 | + "image_size = $this->iImageSize " . |
| 240 | + ($this->iImageMimeTypeID ? ", image_mime_type_id = $this->iImageMimeTypeID " : "") . | ||
| 241 | "WHERE id = $this->iId"; | 241 | "WHERE id = $this->iId"; |
| 242 | $result = $sql->query($sQuery); | 242 | $result = $sql->query($sQuery); |
| 243 | if ($result) { | 243 | if ($result) { |
| @@ -285,7 +285,7 @@ class DashboardNews { | @@ -285,7 +285,7 @@ class DashboardNews { | ||
| 285 | "mimetypeid" => $sql->f("image_mime_type_id") ); | 285 | "mimetypeid" => $sql->f("image_mime_type_id") ); |
| 286 | 286 | ||
| 287 | $oDashboardNews = & new DashboardNews(stripslashes($sql->f("synopsis")), stripslashes($sql->f("body")), $sql->f("rank"), $aImage); | 287 | $oDashboardNews = & new DashboardNews(stripslashes($sql->f("synopsis")), stripslashes($sql->f("body")), $sql->f("rank"), $aImage); |
| 288 | - $oDashboardNews->iId = $iDocumentID; | 288 | + $oDashboardNews->iId = $iNewsID; |
| 289 | return $oDashboardNews; | 289 | return $oDashboardNews; |
| 290 | } | 290 | } |
| 291 | return false; | 291 | return false; |