Ejemplo n.º 1
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_banner_box_all.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
// select banners_group to be used
$new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET_ALL);
// secure pages
switch ($request_type) {
    case 'SSL':
        $my_banner_filter = " and banners_on_ssl= " . "1 ";
        break;
    case 'NONSSL':
        $my_banner_filter = '';
        break;
}
$sql = "select banners_id from " . TABLE_BANNERS . " where status = 1 " . $new_banner_search . $my_banner_filter . " order by banners_sort_order";
$banners_all = $db->Execute($sql);
// if no active banner in the specified banner group then the box will not show
$banner_cnt = 0;
while (!$banners_all->EOF) {
    $banner_cnt++;
    $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET_ALL);
Ejemplo n.º 2
0
function zen_banner_exists($action, $identifier)
{
    global $db;
    $my_page_ssl = $_SERVER['HTTPS'];
    switch (true) {
        case $my_page_ssl == 'on':
            $my_banner_filter = " and banners_on_ssl= " . "'1' ";
            break;
        case $my_page_ssl == 'off':
            $my_banner_filter = '';
            break;
    }
    if ($action == 'dynamic') {
        $new_banner_search = zen_build_banners_group($identifier);
        return $db->Execute("select banners_id, banners_title, banners_image, banners_html_text, banners_open_new_windows\r\n                           from " . TABLE_BANNERS . "\r\n                               where status = '1' " . $new_banner_search . $my_banner_filter . " order by rand()");
    } elseif ($action == 'static') {
        $banner_query = "select banners_id, banners_title, banners_image, banners_html_text, banners_open_new_windows\r\n                       from " . TABLE_BANNERS . "\r\n                       where status = '1'\r\n                       and banners_id = '" . (int) $identifier . "'" . $my_banner_filter;
        return $banner = $db->Execute($banner_query);
    } else {
        return false;
    }
}
Ejemplo n.º 3
0
function zen_banner_exists($action, $identifier)
{
    global $db, $request_type;
    switch ($request_type) {
        case 'SSL':
            $my_banner_filter = " and banners_on_ssl= " . "1 ";
            break;
        case 'NONSSL':
            $my_banner_filter = '';
            break;
    }
    if ($action == 'dynamic') {
        $new_banner_search = zen_build_banners_group($identifier);
        return $db->Execute("select banners_id, banners_title, banners_image, banners_html_text, banners_open_new_windows, banners_url\n                           from " . TABLE_BANNERS . "\n                               where status = 1 " . $new_banner_search . $my_banner_filter . " order by rand()");
    } elseif ($action == 'static') {
        $banner_query = "select banners_id, banners_title, banners_image, banners_html_text, banners_open_new_windows, banners_url\n                       from " . TABLE_BANNERS . "\n                       where status = 1\n                       and banners_id = '" . (int) $identifier . "'" . $my_banner_filter;
        return $banner = $db->Execute($banner_query);
    } else {
        return false;
    }
}
Ejemplo n.º 4
0
function zen_banner_exists($action, $identifier)
{
    global $gBitDb;
    if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
        $my_banner_filter = " and `banners_on_ssl`= " . "'1' ";
    } else {
        $my_banner_filter = '';
    }
    if ($action == 'dynamic') {
        $new_banner_search = zen_build_banners_group($identifier);
        return $gBitDb->Execute("SELECT `banners_id`, `banners_title`, `banners_image`, `banners_html_text`, `banners_open_new_windows`\n                           FROM " . TABLE_BANNERS . "\n                               WHERE `status` = '1' " . $new_banner_search . $my_banner_filter . " order by " . $gBitDb->convertSortmode('random'));
    } elseif ($action == 'static') {
        $banner_query = "select `banners_id`, `banners_title`, `banners_image`, `banners_html_text`, `banners_open_new_windows`\n                       from " . TABLE_BANNERS . "\n                       where `status` = '1'\n                       and `banners_id` = '" . (int) $identifier . "'" . $my_banner_filter;
        return $banner = $gBitDb->Execute($banner_query);
    } else {
        return false;
    }
}