Quick Search:

View

Revision:

Diff

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