Author Topic: Fix For Aurora 4.0.8E , Members Clicks Are Counted As Outside Visits  (Read 2675 times)

0 Members and 1 Guest are viewing this topic.

  • Developer
  • Hero Member
  • *
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 933
  • Karma: +58/-2
  • Referrals: 81
    • Cashons Network
    • Email
- This fix will solve the problem of members clicks being counted as outside visits for the ptc ads and it doesn't deduct from ads credits .

To apply the fix , Do the following :

1- In your cpanel find the following file : source/clicking/entry.php and replace the code inside it with this

Code: [Select]
<?
if(!IN_CLICKING) exit;

if(!$LOGGED_IN && $type == "ptc") {

$sql=$Db1->query("SELECT * FROM ".$adTables[$type]." WHERE id='{$id}'");
$ad=$Db1->fetch_array($sql);
}

$ad=$Db1->query_first("SELECT * FROM ".$adTables[$type]." WHERE id='{$id}'");

if($LOGGED_IN) {
if($type == "ptra") {
$ct = $Db1->querySingle("SELECT dsub FROM click_sessions WHERE username='$username' and type='ptra'","dsub")+9;
if($ct > time() || $Db1->num_rows()==0) error("You didn't wait long enough!");
}

$time=time();
mt_srand((double)microtime()*1000000);
$num = mt_rand(0,3);

$Db1->query("DELETE FROM click_sessions WHERE username='$username' and type='{$type}'");
$sql=$Db1->query("INSERT INTO click_sessions SET
dsub='{$time}',
username='{$username}',
val='{$num}',
type='{$type}'
");

        if(cheat_check("click", $id) == true) {
$ad[target]="gpt.php?v=cheat&id={$id}&return=click&".$url_variables;
$id=-1;
}

if($clickVerified == false && findclick($clickHistory, $id) == 1) {
error("You Have Already Clicked This Link Today");
}
if($ad[credits] <= 0 || ($ad[daily_limit] <= $ad[views_today] && $ad[daily_limit] > 0) || ($ad[upgrade] == 1 && $thismemberinfo[type]!=1) ) {
error("This Link Is Not Available To Click!!!!");
}
if($ad[country]!="") {
$cont = $ad[country];
$tstring = explode(',' , $cont);
if (in_array("$thismemberinfo[country]",$tstring)) {
$loadz=1;
}
else {
error("We really apologize, this ads not allowed to be viewed from your country!");
}
}

if($thismemberinfo[type] !=1 && $ad[upgrade] == 1) {
error("You must be a premium member to view this ad");
}

$time=time();
mt_srand((double)microtime()*1000000);
$num = mt_rand(0,3);

$Db1->query("DELETE FROM click_sessions WHERE username='$username' and type='{$type}'");
$sql=$Db1->query("INSERT INTO click_sessions SET
dsub='{$time}',
username='{$username}',
val='{$num}',
type='{$type}'
");
}
else {
$Db1->query("UPDATE ".$adTables[$type]." SET oviews=oviews+1, oviews_today=oviews_today+1 WHERE id='$id'");
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<title>Viewing Ad @ <?=$settings['site_title'];?></title>
</head>

<frameset rows="80,*" style="border: 1px black;" noresize="noresize">
<?php if($LOGGED_IN) { ?>
  <frame name="surftopframe" src="gpt.php?v=timer&user=<?=$username;?>&pretime=<?=$time;?>&id=<?=$id;?>&<?=$url_variables;?>" scrolling=no marginheight="2" marginwidth="2" noresize="noresize" >
<? } else { ?>
  <frame name="surftopframe" src="gpt.php?v=outside&id=<?=$id;?>&<?=$url_variables;?>" scrolling=no marginheight="2" marginwidth="2" noresize="noresize" >
  <?php ?>
  <frame name="surfmainframe" src="<?=$ad[target];?>" marginheight="0" marginwidth="0" noresize="noresize">
</frameset>

</html>


2- Go to the following file : source/clicking/verifyClick.php , and replace the code inside it with the following

Code: [Select]
<?
if(!IN_CLICKING) exit;

if(cheat_check2("clickfinal", $id) == true) {
$Db1->sql_close();
header("Location: gpt.php?v=entry&id={$id}&{$url_variables}");
exit;
}

if(!$LOGGED_IN && $type == "ptc") {
$time=time();
mt_srand((double)microtime()*1000000);
$num = mt_rand(0,3);

$ad=$Db1->query_first("SELECT * FROM ".$adTables[$type]." WHERE id='$id'");

$st = $statType[$type];

$Db1->sql_close();

if($_GET['s']==1) $goto = "gpt.php?v=entry&s=1&{$url_variables}";
else $goto = $ad['target'];


}


$Db1->query("UPDATE user SET last_click='".time()."' WHERE username='$username'");


$payout=0;

$time=time();
mt_srand((double)microtime()*1000000);
$num = mt_rand(0,3);

$ad=$Db1->query_first("SELECT * FROM ".$adTables[$type]." WHERE id='$id'");


if($type=="ce") $ad['timed']=$settings['ce_time'];

$browseval=$Db1->query_first("SELECT * FROM click_sessions WHERE dsub='{$_GET['pretime']}' AND username='{$username}' AND type='{$type}' LIMIT 1");

if($_GET['buttonClicked'] == "") error("Error determining which button clicked.");
elseif($_GET['pretime'] == "") error("Error determining pretime variable.");
elseif($Db1->num_rows() == 0) {

error("There was a problem finding your click session. Are you viewing more than 1 ad at a time?");
}
elseif($_GET['buttonClicked'] != $browseval[val]) error("You clicked the wrong number!");
elseif((time()-$ad[timed]-1) < $browseval[dsub]) error("You did not wait long enough.");

/*
$Db1->query("INSERT INTO click_history SET
username='{$username}',
type='{$type}',
ad_id='{$id}'
");
*/

$Db1->query("UPDATE click_history SET clicks='".$clickHistory.$id.":' WHERE username='$username' and type='{$type}'");

$Db1->query("UPDATE ".$adTables[$type]." SET views=views+1, views_today=views_today+1, credits=credits-1 WHERE id='$id'");

$sql=$Db1->query("DELETE FROM click_sessions WHERE username='$username' AND type='{$type}'");

$todayDate=date("d/m/y");

$statType = array(
"ptc"=>"clicked",
"ptre"=>"emails",
"ptra"=>"ptrads",
"ce"=>"xclicked"
);
$st = $statType[$type];


$userStatType = array(
"ptc"=>array("clicks","clicked_today"),
"ptre"=>array("emails","emails_today"),
"ptra"=>array("ptra_clicks","ptra_clicks_today"),
"ce"=>array("xclicks","xclicked_today")
);
$ust = $userStatType[$type];






if($type == "ce") {
$paytype="xcredits";
$payout=round($settings[ce_ratio2]/$settings[ce_ratio1],5);
$totalPaid=$payout;

if(isset($thismemberinfo[refered])) {
$totalPaid += creditUpline($thismemberinfo[refered], 1, $payout);
}

$sql=$Db1->query("UPDATE stats SET xclicked=xclicked+1, xcredits=xcredits+".$payout." WHERE date='$todayDate'");
}
else {
$paytype=($ad['class']=="P"?"points":"balance");

if($type == "ptre") $payout = $settings['ptr_earn'];
else $payout=$ad[pamount];

$totalPaid=$payout;

if((isset($thismemberinfo[refered])) && ($ad['class'] != "P")) {
$totalPaid += pay_upline($thismemberinfo[refered], 1, ($ad[pamount]));
}
$sql=$Db1->query("UPDATE stats SET $st=$st+1, ".($ad['class']=="P"?"points=points":"cash=cash")."+".$totalPaid." WHERE date='$todayDate'");
}




if($paytype == "balance") $queryextra .= " earned_today=earned_today+$payout, ";

if($type=="ptc") $queryextra.=" clickcon_clic=clickcon_clic+1, ";
if($type=="ptc" && $settings[tickets_ptc] > 0) $queryextra.=" tickets=tickets+$settings[tickets_ptc], ";
if($type=="ptre" && $settings[tickets_ptr] > 0) $queryextra.=" tickets=tickets+$settings[tickets_ptr], ";
if($type=="ptra" && $settings[tickets_ptra] > 0) $queryextra.=" tickets=tickets+$settings[tickets_ptra], ";
if($type=="ce" && $settings[tickets_xclick] > 0) $queryextra.=" tickets=tickets+$settings[tickets_xclick], ";

$sql=$Db1->query("UPDATE user SET $paytype=$paytype+$payout, coclicks=coclicks+1, $queryextra {$ust[0]}={$ust[0]}+1, {$ust[1]}={$ust[1]}+1 WHERE username='$username'");



$Db1->sql_close();

if($_GET['s']==1) $goto = "gpt.php?v=entry&s=1&{$url_variables}";
else $goto = $ad['target'];

header("Location: $goto");
exit;


?>


- This should fix this problem



  • Member
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 10
  • Karma: +1/-0
  • Referrals: 2
    • Email
Re: Fix For Aurora 4.0.8E , Members Clicks Are Counted As Outside Visits
« Reply #1 on: December 18, 2014, 04:16:26 AM »
Thanks for your help.... It worked for me :)