Quick Search:

View

Revision:

Diff

Diff from 895 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/hpdl/oscommerce/includes/modules/content/recently_visited.php

Annotated File View

hpdl
228
1 <?php
2 /*
hpdl
331
3   $Id: $
hpdl
895
4
hpdl
228
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
hpdl
396
8   Copyright (c) 2006 osCommerce
hpdl
228
9
10   Released under the GNU General Public License
11 */
12
hpdl
333
13   class osC_Content_recently_visited extends osC_Modules {
hpdl
396
14     var $_title,
hpdl
331
15         $_code = 'recently_visited',
16         $_author_name = 'osCommerce',
hpdl
333
17         $_author_www = 'http://www.oscommerce.com',
18         $_group = 'content';
hpdl
228
19
20 /* Class constructor */
21
hpdl
331
22     function osC_Content_recently_visited() {
hpdl
396
23       global $osC_Language;
24
25       $this->_title = $osC_Language->get('recently_visited_title');
hpdl
290
26     }
hpdl
228
27
hpdl
331
28     function initialize() {
hpdl
895
29       global $osC_Services, $osC_RecentlyVisited, $osC_Language, $osC_Image;
hpdl
685
30
hpdl
895
31       if ($osC_Services->isStarted('recently_visited') && $osC_RecentlyVisited->hasHistory()) {
hpdl
685
32         $this->_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' .
33                           '  <tr>';
34
35         if ($osC_RecentlyVisited->hasProducts()) {
36           $this->_content .= '    <td valign="top">' .
37                              '      <h6>' . $osC_Language->get('recently_visited_products_title') . '</h6>' .
38                              '      <ol style="list-style: none; margin: 0; padding: 0;">';
39
40           foreach ($osC_RecentlyVisited->getProducts() as $product) {
41             $this->_content .= '<li style="padding-bottom: 15px;">';
42
43             if (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_IMAGES == '1') {
hpdl
686
44               $this->_content .= '<span style="float: left; width: ' . ($osC_Image->getWidth('mini') + 10) . 'px; text-align: center;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $osC_Image->show($product['image'], $product['name'], null, 'mini')) . '</span>';
hpdl
685
45             }
46
hpdl
815
47             $this->_content .= '<div style="float: left;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $product['name']) . '<br />';
hpdl
685
48
49             if (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_PRICES == '1') {
50               $this->_content .= $product['price'] . '&nbsp;';
51             }
52
hpdl
815
53             $this->_content .= '<i>(' . sprintf($osC_Language->get('recently_visited_item_in_category'), osc_link_object(osc_href_link(FILENAME_DEFAULT, 'cPath=' . $product['category_path']), $product['category_name'])) . ')</i></div>' .
54                                '<div style="clear: both;"></div>' .
55                                '</li>';
hpdl
685
56           }
57
58           $this->_content .= '      </ol>' .
59                              '    </td>';
60         }
61
62         if ($osC_RecentlyVisited->hasCategories()) {
63           $this->_content .= '      <td valign="top">' .
64                              '        <h6>' . $osC_Language->get('recently_visited_categories_title') . '</h6>' .
65                              '        <ol style="list-style: none; margin: 0; padding: 0;">';
66
67           foreach ($osC_RecentlyVisited->getCategories() as $category) {
hpdl
686
68             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['path']), $category['name']);
hpdl
685
69
70             if (!empty($category['parent_id'])) {
hpdl
686
71               $this->_content .= '&nbsp;<i>(' . sprintf($osC_Language->get('recently_visited_item_in_category'), osc_link_object(osc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['parent_id']), $category['parent_name'])) . ')</i>';
hpdl
685
72             }
73
74             $this->_content .= '</li>';
75           }
76
77           $this->_content .= '      </ol>' .
78                              '    </td>';
79         }
80
81         if ($osC_RecentlyVisited->hasSearches()) {
82           $this->_content .= '      <td valign="top">' .
83                              '        <h6>' . $osC_Language->get('recently_visited_searches_title') . '</h6>' .
84                              '        <ol style="list-style: none; margin: 0; padding: 0;">';
85
86           foreach ($osC_RecentlyVisited->getSearches() as $searchphrase) {
hpdl
725
87             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_SEARCH, 'keywords=' . $searchphrase['keywords']), osc_output_string_protected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></li>';
hpdl
685
88           }
89
90           $this->_content .= '      </ol>' .
91                              '    </td>';
92         }
93
94         $this->_content .= '  </tr>' .
95                            '</table>';
96       }
hpdl
290
97     }
hpdl
298
98   }
hpdl
297
99 ?>