Quick Search:

View

Revision:

Diff

Diff from 686 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
686
46             $this->_content .= '<div style="padding-left: ' . ($osC_Image->getWidth('mini') + 10) . 'px;">' . 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
686
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></li>';
hpdl
685
53           }
54
55           $this->_content .= '      </ol>' .
56                              '    </td>';
57         }
58
59         if ($osC_RecentlyVisited->hasCategories()) {
60           $this->_content .= '      <td valign="top">' .
61                              '        <h6>' . $osC_Language->get('recently_visited_categories_title') . '</h6>' .
62                              '        <ol style="list-style: none; margin: 0; padding: 0;">';
63
64           foreach ($osC_RecentlyVisited->getCategories() as $category) {
hpdl
686
65             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['path']), $category['name']);
hpdl
685
66
67             if (!empty($category['parent_id'])) {
hpdl
686
68               $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
69             }
70
71             $this->_content .= '</li>';
72           }
73
74           $this->_content .= '      </ol>' .
75                              '    </td>';
76         }
77
78         if ($osC_RecentlyVisited->hasSearches()) {
79           $this->_content .= '      <td valign="top">' .
80                              '        <h6>' . $osC_Language->get('recently_visited_searches_title') . '</h6>' .
81                              '        <ol style="list-style: none; margin: 0; padding: 0;">';
82
83           foreach ($osC_RecentlyVisited->getSearches() as $searchphrase) {
hpdl
686
84             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_SEARCH, 'keywords=' . $searchphrase['keywords']), tep_output_string_protected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></li>';
hpdl
685
85           }
86
87           $this->_content .= '      </ol>' .
88                              '    </td>';
89         }
90
91         $this->_content .= '  </tr>' .
92                            '</table>';
93       }
hpdl
290
94     }
hpdl
298
95   }
hpdl
297
96 ?>