Quick Search:

View

Revision:

Diff

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