  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: reviews.php 215 2005-10-05 19:29:55Z hpdl $ |
| |
| 3 | + | $Id: reviews.php 246 2005-11-14 15:06:41Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
13 | 13 | | class osC_Reviews { |
| |
14 | 14 | | var $is_enabled = false, |
| |
15 | 15 | | $is_moderated = false; |
  |
16 | | - | |
| |
| 16 | + | |
|
17 | 17 | | // class constructor |
| |
18 | 18 | | function osC_Reviews() { |
  |
19 | | - | |
| |
| 19 | + | |
|
20 | 20 | | $this->enableReviews(); |
| |
21 | 21 | | $this->enableModeration(); |
| |
22 | 22 | | } |
| |
|
|
 |
… |
|
47 | 47 | | break; |
| |
48 | 48 | | } |
| |
49 | 49 | | } |
  |
50 | | - | |
| |
| 50 | + | |
|
51 | 51 | | function hasPurchased() { |
| |
52 | 52 | | global $osC_Database, $osC_Customer; |
  |
53 | | - | |
| |
| 53 | + | |
|
54 | 54 | | $Qhaspurchased = $osC_Database->query('select count(*) as total from :table_orders o, :table_orders_products op, :table_products p where o.customers_id = :customers_id and o.orders_id = op.orders_id and op.products_id = p.products_id and op.products_id = :products_id'); |
| |
55 | 55 | | $Qhaspurchased->bindRaw(':table_orders', TABLE_ORDERS); |
| |
56 | 56 | | $Qhaspurchased->bindRaw(':table_orders_products', TABLE_ORDERS_PRODUCTS); |
| |
|
|
 |
… |
|
65 | 65 | | return false; |
| |
66 | 66 | | } |
| |
67 | 67 | | } |
  |
68 | | - | |
| |
| 68 | + | |
|
69 | 69 | | function enableModeration() { |
| |
70 | 70 | | global $osC_Database, $osC_Customer; |
| |
71 | 71 | | |
| |
|
|
 |
… |
|
147 | 147 | | $Qreviews->bindInt(':products_id', $id); |
| |
148 | 148 | | $Qreviews->bindInt(':languages_id', $_SESSION['languages_id']); |
| |
149 | 149 | | } else { |
  |
150 | | - | $Qreviews = $osC_Database->query('select r.reviews_id, left(r.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name, p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from :table_reviews r, :table_products p, :table_products_description pd where r.reviews_status = 1 and r.languages_id = :languages_id and r.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by r.reviews_id desc'); |
| |
| 150 | + | $Qreviews = $osC_Database->query('select r.reviews_id, left(r.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name, p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_keyword from :table_reviews r, :table_products p, :table_products_description pd where r.reviews_status = 1 and r.languages_id = :languages_id and r.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by r.reviews_id desc'); |
|
151 | 151 | | $Qreviews->bindTable(':table_products', TABLE_PRODUCTS); |
| |
152 | 152 | | $Qreviews->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); |
| |
153 | 153 | | $Qreviews->bindInt(':languages_id', $_SESSION['languages_id']); |
| |
|
|
 |
… |
|
186 | 186 | | $Qreview->bindInt(':reviews_status', $data['status']); |
| |
187 | 187 | | $Qreview->execute(); |
| |
188 | 188 | | } |
  |
189 | | - | } |
| |
| 189 | + | } |
  |
190 | 190 | | ?> |