Your IP : 172.28.240.42


Current Path : /var/www/html/clients/kampol.e-nk.ru/OLD/components/com_artbanners/
Upload File :
Current File : /var/www/html/clients/kampol.e-nk.ru/OLD/components/com_artbanners/artbanners.php

<?php
/**
* Content code
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

if (file_exists($mosConfig_absolute_path.'/components/com_artbanners/language/'.$mosConfig_lang.'.php')) {
	include_once ($mosConfig_absolute_path.'/components/com_artbanners/language/'.$mosConfig_lang.'.php');
} else {
	include_once ($mosConfig_absolute_path.'/components/com_artbanners/language/english.php');
}

// including classes (I don't like $mainframe
require_once( $mosConfig_absolute_path."/components/com_artbanners/artbanners.class.php" );

$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) );
$task = mosGetParam( $_REQUEST, "task", "" );

switch($task)
{
	case "clk":
		clickArtBanner( $id );
		break;
}

/**
/* Function to redirect the clicks to the correct url and add 1 click
*/
function clickArtBanner( $id ) {
	global $database, $mosConfig_absolute_path;
	
	$row = new mosArtBanner($database);
	$row->load($id);
	$row->clicks();

	$pat = "http://";
	if (!eregi( $pat, $row->click_url )) {
		$click_url = "http://$row->click_url";
	} else {
		$click_url = $row->click_url;
	}
	mosRedirect( $click_url );
}
?>