<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

include("_mysql.php");
include("_settings.php");
include("_functions.php");

//get values

if($_GET['bannerID']) {
	safe_query("UPDATE ".PREFIX."bannerrotation SET hits=hits+1");
	$ds=mysql_fetch_array(safe_query("SELECT bannerurl FROM ".PREFIX."bannerrotation WHERE bannerID='".$_GET['bannerID']."'"));
	$target=$ds[bannerurl];
	$type="direct";
}


//output

if($type=="frame") {
	
	echo'<html>
<head>
<title>'.PAGETITLE.' - Outgoing</title>
</head>
<frameset rows="20,*" framespacing="0" border="0" frameborder="0">
  <frame name="header" scrolling="no" noresize target="_blank" marginwidth="0" marginheight="0" src="templates/out.html">
  <frame name="content" src="'.$target.'">
  <noframes>
  <body>
  <p>This site is using frames. Your browser doesn´t support frames!</p>
  </body>
  </noframes>
</frameset>
</html>';

} elseif($type=="direct") header("Location: $target");


?>
