Advertisement
Guest User

recently viewed

a guest
Jul 16th, 2012
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <?php
  2. define('MAX_COLS_FOOTER', 1);
  3. define('MAX_ROWS_FOOTER', 4);
  4.  
  5. if (strlen($recently_viewed_footer>1)) {
  6. $info_box_contents = array();
  7. $info_box_contents[] = array('align' => 'left',
  8. 'text' => 'RECENTLY VIEWED'
  9. );
  10. new infoBoxHeading($info_box_contents, false, false);
  11.  
  12. $counter = 0;
  13. $info_box_contents = array();
  14. $recent_products = split(';',$recently_viewed_footer);
  15.  
  16. $rows=0;
  17. $cols=0;
  18. foreach ($recent_products as $recent) { if ((strlen($recent) >0) && ($counter < (MAX_ROWS_FOOTER*MAX_COLS_FOOTER)) && ($rows<MAX_ROWS_FOOTER)) {
  19. $recent_info = tep_db_query("select p.products_image from " . TABLE_PRODUCTS . " p where p.products_id = '" . $recent. "'");
  20. $recent_info_values = tep_db_fetch_array($recent_info);
  21. $counter++;
  22. if (strlen($counter) < 2) {
  23. $counter = '0' . $counter;
  24. }
  25. $info_box_contents[$rows][$cols] = array('align' => 'left',
  26. 'params' =>'',
  27. 'text' => '
  28. <!-- Begin Wrapper -->
  29. <div id="wrapperrightinnner">
  30. <!-- Begin Left Column -->
  31. <div id="leftcolumnrightinnner">
  32. <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $recent, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $recent_info_values['products_image'], tep_get_products_name($recent), '60px', '55px') . '
  33. </div>
  34. <!-- End Left Column -->
  35. <!-- Begin Right Column -->
  36. <div id="rightcolumnrightinnner">
  37. ' . tep_get_products_name($recent) . '</div></a>
  38.  
  39. <!-- End Right Column -->
  40. </div>
  41. <!-- End Wrapper -->
  42. '
  43. );
  44. $cols++;
  45. if ($cols >= MAX_COLS) {
  46. $cols = 0;
  47. $rows++;
  48. }
  49. }
  50. } new tableBox($info_box_contents,true);
  51. }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement