Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

599
 
612
 
612
 
product.php
_> 1717       global $osC_Database, $osC_Services, $osC_Language, $osC_Image;
  1818 
  1919       if (!empty($id)) {
<> 20 -        $Qproduct = $osC_Database->query('select p.products_id as id, p.products_quantity as quantity, p.products_price as price, p.products_tax_class_id as tax_class_id, p.products_date_added as date_added, p.products_date_available as date_available, p.manufacturers_id, pd.products_name as name, pd.products_description as description, pd.products_model as model, pd.products_keyword as keyword, pd.products_tags as tags, pd.products_url as url, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where');
   20+        $Qproduct = $osC_Database->query('select p.products_id as id, p.products_quantity as quantity, p.products_price as price, p.products_tax_class_id as tax_class_id, p.products_date_added as date_added, p.products_date_available as date_available, p.manufacturers_id, pd.products_name as name, pd.products_description as description, pd.products_model as model, pd.products_keyword as keyword, pd.products_tags as tags, pd.products_url as url from :table_products p, :table_products_description pd where');
2121         $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
<> 22 -        $Qproduct->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
2322         $Qproduct->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
  2423 
  2524         if (is_numeric($id) || ereg('[0-9]+[{[0-9]+}[0-9]+]*$', $id)) {
     
 !
3130         }
  3231 
  3332         $Qproduct->appendQuery('and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id');
<> 34 -        $Qproduct->bindInt(':default_flag', 1);
3533         $Qproduct->bindInt(':language_id', $osC_Language->getID());
  3634         $Qproduct->execute();
  3735 
  3836         if ($Qproduct->numberOfRows() === 1) {
  3937           $this->_data = $Qproduct->toArray();
  4038 
<>  39+          $this->_data['images'] = array();
   40+
   41+          $Qimages = $osC_Database->query('select id, image, default_flag from :table_products_images where products_id = :products_id order by sort_order');
   42+          $Qimages->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
   43+          $Qimages->bindInt(':products_id', $this->_data['id']);
   44+          $Qimages->execute();
   45+
   46+          while ($Qimages->next()) {
   47+            $this->_data['images'][] = $Qimages->toArray();
   48+          }
   49+
4150           $Qcategory = $osC_Database->query('select categories_id from :table_products_to_categories where products_id = :products_id limit 1');
  4251           $Qcategory->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
  4352           $Qcategory->bindInt(':products_id', $this->_data['id']);
     
 !
156165       return $this->_data['category_id'];
  157166     }
  158167 
<>  168+    function getImages() {
   169+      return $this->_data['images'];
   170+    }
   171+
159172     function hasImage() {
<> 160 -      return (isset($this->_data['image']) && !empty($this->_data['image']));
   173+      foreach ($this->_data['images'] as $image) {
   174+        if ($image['default_flag'] == '1') {
   175+          return true;
   176+        }
   177+      }
161178     }
  162179 
  163180     function getImage() {
<> 164 -      return $this->_data['image'];
   181+      foreach ($this->_data['images'] as $image) {
   182+        if ($image['default_flag'] == '1') {
   183+          return $image['image'];
   184+        }
   185+      }
165186     }
  166187 
  167188     function hasURL() {
     
 !
243264       $Qupdate->execute();
  244265     }
  245266 
<>  267+    function numberOfImages() {
   268+      return sizeof($this->_data['images']);
   269+    }
   270+
<_ 246271     function &getListingNew() {
  247272       global $osC_Database, $osC_Language, $osC_Image;
  248273