<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.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.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/********************************************************/
/* NSN Banner Ads                                       */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2005 by NukeScripts Network         */
/********************************************************/

if (is_file("mainfile.php")) {include_once("mainfile.php");}
$bid = $GLOBALS['db']->XMFnum($bid);
$row = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `clickurl` FROM `".TABLE_NSNBA_BANNERS."` WHERE `bid`='$bid'"));
$clickurl = stripslashes($row['clickurl']);
$GLOBALS['db']->sql_query("UPDATE `".TABLE_NSNBA_BANNERS."` SET `clicks`=clicks+1 WHERE `bid`='$bid'");
Header("Location: $clickurl");