}
        $suffix = ".manage&banner_type={$_REQUEST['banner_type']}&link_to={$_REQUEST['link_to']}";
    }
    if ($mode == 'update') {
        $banner_id = fn_update_banner($_REQUEST['banner'], $_REQUEST['banner_id'], DESCR_SL);
        $suffix = ".update?banner_id={$banner_id}";
    }
    return array(CONTROLLER_STATUS_OK, "banners_manager{$suffix}");
}
if ($mode == 'update') {
    $banner = fn_get_aff_banner_data($_REQUEST['banner_id'], DESCR_SL);
    if (empty($banner)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    if ($banner['type'] != 'G') {
        $banner['code'] = fn_get_aff_banner_html('js', $banner, '', '', DESCR_SL);
    }
    if ($banner['link_to'] == 'G') {
        $view->assign('all_groups_list', fn_get_groups_list('D', DESCR_SL));
    }
    fn_add_breadcrumb(fn_get_lang_var('banners'), "banners_manager.manage?banner_type={$banner['type']}&link_to={$banner['link_to']}");
    $view->assign('banner', $banner);
    $view->assign('banner_type', $banner['type']);
    $view->assign('link_to', $banner['link_to']);
} elseif ($mode == 'add') {
    $banner_type = empty($_REQUEST['banner_type']) ? 'T' : $_REQUEST['banner_type'];
    $link_to = empty($_REQUEST['link_to']) ? 'G' : $_REQUEST['link_to'];
    if ($link_to == 'G') {
        $view->assign('all_groups_list', fn_get_groups_list('Y', DESCR_SL));
    }
    fn_add_breadcrumb(fn_get_lang_var('banners'), "banners_manager.manage?banner_type={$banner_type}&link_to={$link_to}");
 if ($selected_section == 'products') {
     // [Products banners]
     $banners['products'] = fn_get_aff_banners($_REQUEST['banner_type'], 'P', true);
     // [/Products banners]
 }
 if ($selected_section == 'url') {
     // [Products banners]
     $banners['url'] = fn_get_aff_banners($_REQUEST['banner_type'], 'U', true);
     // [/Products banners]
 }
 $js_banners = array();
 foreach ($banners as $_key => $bans) {
     if (!empty($bans)) {
         foreach ($bans as $__key => $ban) {
             $js_banners[$ban['banner_id']]['example'] = fn_get_aff_banner_html('js', $ban);
             $js_banners[$ban['banner_id']]['code'] = fn_get_aff_banner_html('js', $ban, '', $auth['user_id']);
             if ($_REQUEST['banner_type'] == 'G') {
                 $image_data = fn_get_aff_banner_image_data($ban['banner_id'], 'icon');
                 if (!empty($image_data)) {
                     $banners[$_key][$__key] = fn_array_merge($ban, $image_data);
                 }
             }
             if ($_REQUEST['banner_type'] != 'P') {
                 $js_banners[$ban['banner_id']]['url'] = fn_get_aff_banner_url($ban, $auth['user_id']);
             }
         }
     }
 }
 $view->assign('banners', $banners);
 $view->assign('js_banners', $js_banners);
 if ($_REQUEST['banner_type'] == 'G') {
Beispiel #3
0
****************************************************************************/
//
// $Id: aff_banner.php 10229 2010-07-27 14:21:39Z 2tl $
//
if (!defined('AREA')) {
    die('Access denied');
}
ob_start();
if ($mode == 'view') {
    $type = empty($_REQUEST['type']) ? 'js_content' : $_REQUEST['type'];
    $aff_id = empty($_REQUEST['aff_id']) ? 0 : $_REQUEST['aff_id'];
    if (!empty($_REQUEST['bid'])) {
        $banner_data = fn_get_aff_banner_data($_REQUEST['bid'], CART_LANGUAGE, true);
        $banner_data['product_ids'] = empty($_REQUEST['product_ids']) ? '' : $_REQUEST['product_ids'];
        $banner_data['new_window'] = empty($_REQUEST['force_new_window']) ? $banner_data['new_window'] : $_REQUEST['force_new_window'];
        $_mode = 'view';
        // FIXME
    } else {
        $banner_data = array('type' => 'P', 'banner_id' => '', 'align' => empty($_REQUEST['align']) ? 'center' : $_REQUEST['align'], 'image' => empty($_REQUEST['image']) ? 'N' : $_REQUEST['image'], 'product_name' => empty($_REQUEST['product_name']) ? 'N' : $_REQUEST['product_name'], 'short_description' => empty($_REQUEST['short_description']) ? 'N' : $_REQUEST['short_description'], 'width' => empty($_REQUEST['width']) ? '' : abs(intval($_REQUEST['width'])), 'height' => empty($_REQUEST['height']) ? '' : abs(intval($_REQUEST['height'])), 'border' => empty($_REQUEST['border']) ? '' : $_REQUEST['border'], 'to_cart' => empty($_REQUEST['to_cart']) ? '' : $_REQUEST['to_cart'], 'new_window' => empty($_REQUEST['new_window']) ? '' : $_REQUEST['new_window'], 'lang_code' => CART_LANGUAGE, 'product_ids' => '');
        $_mode = 'demo';
    }
    $_banner_html = fn_get_aff_banner_html($type, $banner_data, $_mode, $aff_id);
    if ($type != 'iframe_content' && $type != 'js') {
        header('Content-type: text/javascript');
        echo $_banner_html;
    } else {
        echo '<div id="id_example_banner"><script type="text/javascript" language="javascript">' . $_banner_html . '</script><!--id_example_banner--></div>';
    }
}
ob_end_flush();
exit;