hpdl
|
555
|
1
|
<?php
|
|
2
|
/*
|
|
3
|
$Id: $
|
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
|
8
|
Copyright (c) 2006 osCommerce
|
|
9
|
|
|
10
|
Released under the GNU General Public License
|
|
11
|
*/
|
|
12
|
|
|
13
|
class osC_Image {
|
|
14
|
var $_data;
|
|
15
|
|
|
16
|
function osC_Image() {
|
|
17
|
global $osC_Database;
|
|
18
|
|
hpdl
|
556
|
19
|
$Qgroups = $osC_Database->query('select distinct id, code, size_height as height, size_width as width from :table_products_images_groups');
|
|
20
|
$Qgroups->bindTable(':table_products_images_groups', TABLE_PRODUCTS_IMAGES_GROUPS);
|
hpdl
|
555
|
21
|
$Qgroups->setCache('images_groups');
|
|
22
|
$Qgroups->execute();
|
|
23
|
|
|
24
|
while ($Qgroups->next()) {
|
|
25
|
$this->_data[$Qgroups->value('code')] = $Qgroups->toArray();
|
|
26
|
}
|
|
27
|
|
|
28
|
$Qgroups->freeResult();
|
|
29
|
}
|
|
30
|
|
|
31
|
function getID($code) {
|
|
32
|
return $this->_data[$code]['id'];
|
|
33
|
}
|
|
34
|
|
|
35
|
function getWidth($code) {
|
|
36
|
return $this->_data[$code]['width'];
|
|
37
|
}
|
|
38
|
|
|
39
|
function getHeight($code) {
|
|
40
|
return $this->_data[$code]['height'];
|
|
41
|
}
|
|
42
|
|
hpdl
|
559
|
43
|
function show(&$image, &$title, $parameters = '', $group = 'default') {
|
hpdl
|
555
|
44
|
if (isset($this->_data[$group]) === false) {
|
|
45
|
$group = 'default';
|
|
46
|
}
|
|
47
|
|
|
48
|
return tep_image(DIR_WS_IMAGES . $image, $title, $this->_data[$group]['width'], $this->_data[$group]['height'], $parameters);
|
|
49
|
}
|
|
50
|
}
|
|
51
|
?>
|