From 0b81ae900eeba815470f837877f11fef743a30c4 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 4 Apr 2003 12:07:37 +0000 Subject: [PATCH] =?UTF-8?q?Gestion=20d'une=20image=20par=20d=E9fault=20si?= =?UTF-8?q?=20l'image=20n'existe=20pas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/boutique/livre/livre.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/boutique/livre/livre.class.php b/htdocs/boutique/livre/livre.class.php index 56ab198dafd..a47d3fdcfb1 100644 --- a/htdocs/boutique/livre/livre.class.php +++ b/htdocs/boutique/livre/livre.class.php @@ -385,11 +385,18 @@ class Livre { $sql .= " WHERE products_id = " . $this->oscid; + $this->image = $this->ref.".jpg"; + + if(! file_exists(OSC_CATALOG_DIRECTORY."images/".$this->ref.".jpg")) + { + $this->image = OSC_IMAGE_DEFAULT; + } + if ( $this->db->query($sql) ) { $sql = "UPDATE ".DB_NAME_OSC.".products "; $sql .= "SET products_model = '".$this->ref."'"; - $sql .= ", products_image = '".strtolower($this->ref).".jpg'"; + $sql .= ", products_image = '".$this->image."'"; $sql .= ", products_price = ".$this->price.""; $sql .= " WHERE products_id = " . $this->oscid;