37 lines
756 B
PHP
37 lines
756 B
PHP
|
|
<?php header('Content-type: application/json');
|
||
|
|
|
||
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
||
|
|
|
||
|
|
include(PATHTOINCLUDES."base.php");
|
||
|
|
|
||
|
|
date_default_timezone_set('UTC');
|
||
|
|
|
||
|
|
$em="";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if(isset($_GET["theadid"]))
|
||
|
|
|
||
|
|
{
|
||
|
|
|
||
|
|
$adid=$_GET["theadid"];
|
||
|
|
|
||
|
|
$sql="UPDATE `community_user_ads` SET `community_user_ads`.`adclicks` = (`community_user_ads`.`adclicks` + 1)
|
||
|
|
|
||
|
|
WHERE `community_user_ads`.`adid` = ".$adid." AND `community_user_ads`.`userid` <> ".$_SESSION["cp_userid"];
|
||
|
|
|
||
|
|
$query=$database->database_query($sql) or $em.=$database->database_error();
|
||
|
|
|
||
|
|
$arr = array ('error' => $em);
|
||
|
|
|
||
|
|
echo json_encode($arr);
|
||
|
|
|
||
|
|
exit();
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
$arr = array ('error' => 'adid not set');
|
||
|
|
|
||
|
|
echo json_encode($arr);
|
||
|
|
|
||
|
|
?>
|