<?php
/**
 * pragmaMx  Content Management System
 * Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * $Source: /home/www/dps3311/home/cvsroot/pragmamx/html/banners.php,v $
 * $Revision: 1.4.4.1 $
 * $Author: tora60 $
 * $Date: 2006/11/23 22:06:26 $
 * 
 * this file based on:
 * php-nuke Web Portal System - http://phpnuke.org/
 * Thatware - http://thatware.org/
 */
/**
 */
/* mxBanner Modifikation 1.0                                            */
/* © 2003 by www.komplett-umsonst.de                                    */
/* modified by Christian Kleinschroth                                   */
/**
 */

if (!defined("mxMainFileLoaded")) require_once("mainfile.php");

$mxbop = (empty($_REQUEST['mxbop'])) ? "" : $_REQUEST['mxbop'];

if (empty($mxbop)) { // / falls noch irgendein alter aufruf op=click rumschwirrt
    if (isset($_REQUEST['op'])) {
        $mxbop = ($_REQUEST['op'] == 'click') ? 'click' : '';
    } 
} 

switch ($mxbop) {
    case "click":
        if (!function_exists('clickbanner')) {
            include_once("includes/mx_bannerfunctions.php");
        } 
        $bid = (empty($_REQUEST['bid'])) ? 0 : intval($_REQUEST['bid']);
        clickbanner($bid);
        break;

    default:
        if ($GLOBALS['banners']) {
            if (!function_exists('viewbanner')) {
                include_once('includes/mx_bannerfunctions.php');
            } 
            $xx_banners = viewbanner(1);
            if ($xx_banners) {
                echo "<center>$xx_banners</center>";
            } 
            unset ($xx_banners);
        } 
        break;
} 

?>