PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/includes/modules/pages/popup_image/header_php.php

http://daocart.googlecode.com/
PHP | 60 lines | 33 code | 9 blank | 18 comment | 7 complexity | 7f7f9f0edb65ee0045ab08f2f42424e1 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, BSD-3-Clause
  1. <?php
  2. /**
  3. * Pop up Image Header
  4. *
  5. * @package page
  6. * @copyright Copyright 2003-2007 Zen Cart Development Team
  7. * @copyright Portions Copyright 2003 osCommerce
  8. * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9. * @version $Id: header_php.php 7319 2007-10-30 16:40:03Z drbyte $
  10. */
  11. /**
  12. * Header code file for the product-larger-images popup window
  13. *
  14. */
  15. // This should be first line of the script:
  16. $zco_notifier->notify('NOTIFY_HEADER_START_POPUP_IMAGES_ADDITIONAL');
  17. $_SESSION['navigation']->remove_current_page();
  18. $products_values_query = "SELECT pd.products_name, p.products_image
  19. FROM " . TABLE_PRODUCTS . " p
  20. left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
  21. on p.products_id = pd.products_id
  22. WHERE p.products_status = 1
  23. and p.products_id = :productsID
  24. and pd.language_id = :languagesID ";
  25. $products_values_query = $db->bindVars($products_values_query, ':productsID', $_GET['pID'], 'integer');
  26. $products_values_query = $db->bindVars($products_values_query, ':languagesID', $_SESSION['languages_id'], 'integer');
  27. $products_values = $db->Execute($products_values_query);
  28. $products_image = $products_values->fields['products_image'];
  29. //auto replace with defined missing image
  30. if ($products_image == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
  31. $products_image = PRODUCTS_IMAGE_NO_IMAGE;
  32. }
  33. $products_image_extension = substr($products_image, strrpos($products_image, '.'));
  34. $products_image_base = ereg_replace($products_image_extension, '', $products_image);
  35. $products_image_medium = $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extension;
  36. $products_image_large = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
  37. // check for a medium image else use small
  38. if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) {
  39. $products_image_medium = DIR_WS_IMAGES . $products_image;
  40. } else {
  41. $products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_medium;
  42. }
  43. // check for a large image else use medium else use small
  44. if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) {
  45. $products_image_large = $products_image_medium;
  46. } else {
  47. $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large;
  48. }
  49. // This should be last line of the script:
  50. $zco_notifier->notify('NOTIFY_HEADER_END_POPUP_IMAGES');
  51. ?>