Commit 41a64bd78837db4783be6893ddd026fff8baca0c

Authored by michael
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
lib/dashboard/DashboardNews.inc
... ... @@ -52,7 +52,7 @@ class DashboardNews {
52 52 * @param string the body
53 53 * @param integer the rank
54 54 */
55   - function DashboardNews($sNewSynopsis, $sNewBody, $iNewRank, $mImage) {
  55 + function DashboardNews($sNewSynopsis, $sNewBody, $iNewRank, $mImage = "") {
56 56 // primary key not set as document is not stored yet
57 57 $this->iId = -1;
58 58 $this->setSynopsis($sNewSynopsis);
... ... @@ -236,8 +236,8 @@ class DashboardNews {
236 236 "body = '" . addslashes($this->sBody) . "', " .
237 237 "rank = $this->iRank, " .
238 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 241 "WHERE id = $this->iId";
242 242 $result = $sql->query($sQuery);
243 243 if ($result) {
... ... @@ -285,7 +285,7 @@ class DashboardNews {
285 285 "mimetypeid" => $sql->f("image_mime_type_id") );
286 286  
287 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 289 return $oDashboardNews;
290 290 }
291 291 return false;
... ...