Quote Originally Posted by lat9 View Post
There's not a method (yet), but what if any file matching the "template" /images/referrers/ref*.120.600.jpg was detected as being a banner image?
I don't have my SNAP test site available, but here's (as yet untested) what I propose using as a replacement for /includes/modules/pages/referrer_tools/header_php.php:
Code:
<?php
// +---------------------------------------------------------------------------+
// |Snap Affiliates for Zen Cart                                               |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2013-2014, Vinos de Frutas Tropicales (lat9) for ZC 1.5.0+  |
// |                                                                           |
// | Original: Copyright (c) 2009 Michael Burke                                |
// | http://www.filterswept.com                                                |
// |                                                                           |
// +---------------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license.            |
// +---------------------------------------------------------------------------+

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

define('DIR_WS_IMAGES_REFERRERS', DIR_WS_IMAGES . 'referrers/');

if (!$_SESSION['customer_id']) {
  $_SESSION['navigation']->set_snapshot();
  $messageStack->add_session('login', CAUTION_NEED_LOGIN, 'caution');
  zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}

$is_logged_in = true;

$query = "SELECT * FROM " . TABLE_REFERRERS ." WHERE referrer_customers_id = " . (int)$_SESSION['customer_id'];
$referrer = $db->Execute($query);

if ($referrer->EOF) {
  zen_redirect(zen_href_link(FILENAME_REFERRER_SIGNUP, '', 'SSL'));
}

if (((int)$referrer->fields['referrer_approved']) == 0) {
  zen_redirect(zen_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'));
}

$snap_banners = array();
if (SNAP_AFFILIATE_IMAGES != '') {
  $snap_banner_files = explode('/', SNAP_AFFILIATE_IMAGES);
  foreach ($snap_banner_files as $current_file ) {
    if (zen_not_null($current_file)) {
      $fileinfo = explode(',', $current_file);
      $width = $fileinfo[0];
      $height = $fileinfo[1];
      $extension = $fileinfo[2];
      $filenames = glob (DIR_WS_IMAGES_REFERRERS . "ref*.$width.$height.$extension");
      if ($filenames !== false {
        foreach ($filenames as $filename) {
          $snap_banners[] = array ( 'name' => $filename, 'width' => $width, 'height' => $height );
        }
      }
    }
  }
}

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_REFERRAL_TOOLS, 'false');
$breadcrumb->add(NAVBAR_TITLE);