Quick Search:

View

Revision:

Diff

Diff from 555 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/includes/classes/image.php

Annotated File View

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
19       $Qgroups = $osC_Database->query('select distinct id, code, size_height as height, size_width as width from :table_images_groups');
20       $Qgroups->bindTable(':table_images_groups', TABLE_IMAGES_GROUPS);
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
43     function showImage(&$image, &$title = '', $parameters = '', $group = 'default') {
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 ?>