<?php
/**
* @Enterprise: S&S Media Solutions
* @author: Yannick Spang
* @creation date: July 2009
* @url: http://www.yagendoo.com
* @copyright: Copyright (C) 2009 S&S Media Solutions
* @license: Commercial, see LICENSE.php
* @product: Banner Adspot Pro - Joomla! Module
* @version: 1.0
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>


<div id="yagendoo_banner_adspot_container" style="text-align:<?php echo $params->get('orientation');?>;">
<div id="yagendoo_banner_adspots">
<?php
	$i = 1;
	while($i <= 52) {
		$wdate				= $params->get('date'.$i);
		$wbanner			= $params->get('banner'.$i);
		$wlink				= $params->get('link'.$i);
		$wopenin			= $params->get('openin'.$i);
		$wfollow			= $params->get('follow'.$i);
		$wtitle				= $params->get('title'.$i);
		$wimage				= $params->get('image'.$i);
		$wlinkdesc			= $params->get('linkdesc'.$i);
		$orderlink			= $params->get('orderlink');
		$imgdistance		= $params->get('imgdistance');
		$bannersize 		= $params->get('bannersize');
		$orderbuttontext	= $params->get('orderbuttontext');
	if ((($datenow < $wdate) || ($wdate == '0')) && ($wbanner == '1')):
	if ($orderlink == "") {$params->set('orderlink', $baseurl); }?>
		<a rel="<?php if ($wlink != '') {echo $wfollow;} else {echo 'nofollow';} ?>"   target="<?php if ($wlink != '') {echo $wopenin;} else {echo '_self';} ?>" href="<?php if ($wlink != "") { echo $wlink; } else { echo $orderlink; } ?>" title="<?php echo $wtitle;?>">
			<img width="<?php echo $bannersize;?>px"   style="padding:<?php echo $imgdistance ?>px;"  src="<?php echo $baseurl."modules/mod_yagendoo_banneradspotpro/banners/".$bannersize."/";
		if ($wimage != "") { 
			echo $wimage; 
		} else { 
			echo "placeholder.png"; } ?>" alt="<?php echo $wlinkdesc;?>" name="banner<?php echo $i ?>" id="banner<?php echo $i ?>" />
				</a>
	<?php endif; $i++; } ?>
</div>
<?php if (($params->get('orderlink') != "") && ($params->get('orderbutton') == '1')) : ?>
	<div id="yagendoo_banner_adspot_orderbutton">
		<a href="<?php echo $params->get('orderlink'); ?>" title="<?php echo $orderbuttontext; ?>">
			<?php echo $orderbuttontext; ?>
		</a>
	</div>
<?php endif; ?>
</div>