Formated by GeSHi
<?php $kreditpromote2 = '0.1'; // include the needed pages for settings include("vars.php"); include("dbconnect.php"); include("funcs.php"); include("geoip.php"); // extract the variables (will be removed later on for better security and coding!) $ip = $REMOTE_ADDR; // check the referring url to make sure it is set $refurl = $HTTP_REFERER; { $refurl="NO_REF"; $curapproved="NO_REF"; } $error=0; $eredm = mysql_query("SELECT * FROM ptphits1 WHERE h_date='$ma' AND h_user='$id' AND h_ip='' ") or die(mysql_error()); // if row exists { $error = 1; } if ($error == 1) { $info_message = "User <b>$id</b> has already received credit for your visit today"; } // If no error continue to use this click if ($error == 0) { $objGeoIP = new GeoIP(); // search for the $ip $objGeoIP->search_ip($ip); if ($objGeoIP->found()) { $curcountry = $objGeoIP->getCountryName(); // for some reason the geo script leaves the country with whitespace at the end :S $sql = 'SELECT * FROM `countries` WHERE `country` = "' . $curcountry . '"'; { $shouldcredit = $def_credit; $tier = 0; } else { $tier = $s["tier"]; $shouldcredit = $s["tcredit"]; } } else { $shouldcredit = $def_credit; $tier=0; } if ($curapproved != "NO_REF") { $eredm = mysql_query("UPDATE `ptpapproved` SET `tothits` = (tothits + 1), `totcredits` = (totcredits + $shouldcredit) WHERE url='$curapproved'") or die(mysql_error()); } // choosing the site to show { // if no site then showing the default one $showurl = $def_site; } else { $showurl = $sor["url"]; $showurlid = $sor["siteid"]; $e = mysql_query("UPDATE ptpsites SET credits=credits-1 WHERE siteid=$sor[siteid]") or die(mysql_error()); } if (!$showurlid) { $showurlid=0; } // crediting the user, adding the hit in the database $eredm = mysql_query("INSERT INTO ptphits1(h_date,h_user,h_ip,h_referrer,h_site) VALUES('$ma','$id','$ip','$refurl',$showurlid)") or die(mysql_error()); $eredm = mysql_query("UPDATE users SET earned=earned+$kreditpromote2,totcash=totcash+$kreditpromote2 WHERE username='$id'") or die(mysql_error()); // crediting the users upline if ($max_ref_level>0) { { $r[1]=$referrer1; $r[2]=$referrer2; $r[3]=$referrer3; $r[4]=$referrer4; $r[5]=$referrer5; $r[6]=$referrer6; $r[7]=$referrer7; $r[8]=$referrer8; $r[9]=$referrer9; $r[10]=$referrer10; } for ($i=1;$i<=$max_ref_level;$i++) { $ccomm=$reflevel[$i]; $refuser=$r[$i]; { $ccredit = ($shouldcredit/100)*$ccomm; $eredm = mysql_query("UPDATE users SET refpoints=refpoints+$ccredit, totpoints=totpoints+$ccredit WHERE username='$refuser'") or die(mysql_error()); } } } $info_message = "<font color=black>User <b>$id</b> has been credited with <b>$kreditpromote2</b> credits for showing you this page</font>"; } if (!$showurl) { $showurl=$def_site; } // showing the banners if ($n>0) { for ($i=1;$i<=$n;$i++) { $cbanner = getbanner(); $cstring = '[BANNER'.$i.']'; } } // showing all textlinks $allinks = getalllinks(); // showing random textlinks if ($n>0) { for ($i=1;$i<=$n;$i++) { $clink = getrandomtextlink(); $cstring = '[TEXTLINK'.$i.']'; } } ?><br><br>Parsed in 0.36128306 seconds
| :: Download | ||||
| :: Print into | ||||
:: Make Diff
:: Erase Post