عجب کس تراشیده و ظریفی
Scroll
getField($_GLOBAL['TABLES']['LINKS'], 'short_url',
"`long_url`='{$G_URL}' AND `adtype`='{$G_ADT}' AND `user`='{$user}'")) {
$short = $tmp;
$data = System::getDB()->getRows($_GLOBAL['TABLES']['LINKS'], "`short_url`='{$short}'", '', '1');
} else {
$data = array('long_url' => $G_URL, 'adtype' => $G_ADT, 'user' => $user);
$db->query('LOCK TABLES ' . $_GLOBAL['TABLES']['LINKS'] . ' WRITE;');
$lid = $db->insert($_GLOBAL['TABLES']['LINKS'], $data);
$db->query('UNLOCK TABLES');
$short = $surl . Utilities::compressInt($lid);
$db->update($_GLOBAL['TABLES']['LINKS'], array('short_url' => $short), "`id`='{$lid}'");
$data = System::getDB()->getRows($_GLOBAL['TABLES']['LINKS'], "`id`='{$lid}'", '', '1');
}
$G_SHORT = $short;
} else {
$surl = Utilities::removeURLQueries(Utilities::getCurrentURL());
$data = System::getDB()->getRows($_GLOBAL['TABLES']['LINKS'], "`short_url`='{$surl}'", '', '1');
}
$lid = $data['id'];
$oid = $data['user'];
$url = $data['long_url'];
$title = $data['title'];
$adtyp = $data['adtype'] == 'Interstitial' ? 1 : 2;
if (!$url) kill();
if ($data['adtype'] == 'None') {
$analyzer = new Analyzer($lid, $oid, 0);
$analyzer->_record($adtype);
System::redirect($url);
}
function get_ad() {
global $_GLOBAL, $data;
$a = new Analyzer(0, 0, 0);
if ($a->_isCrawler()) die('Crawlers are not allowed here');
$db = System::getDB();
$t = $data['adtype'] != 'Interstitial' ? 'Banner' : 'Interstitial';
$cc = $a->country($a->ip());
$ci = $db->getField($_GLOBAL['TABLES']['PACKAGES'], 'id', "`code`='{$cc}' AND `advert_type`='{$t}'");
$c = $db->getRows($_GLOBAL['TABLES']['CAMPAIGNS'], "`status`='2' AND `advert_type`='{$t}'");
$valid = array();
for ($i = 0; $i < count($c); $i++) {
if ($c[$i]['spent_today'] >= $c[$i]['daily_budget'] && $c[$i]['daily_budget'] != 0) continue;
$pkg = explode(';', $c[$i]['packages']);
foreach ($pkg as $p) {
$t = explode(',', $p);
if ($t[0] == $ci || $t[0] == '1' || $t[0] == '242') $valid[] = $c[$i];
}
}
return $valid[rand(0, count($valid) - 1)];
}
$AD = get_ad();
$aid = $AD['id'] | 0;
if ($adtyp == 2) {
$analyzer = new Analyzer($lid, $oid, $aid);
$analyzer->_record('top_banner', 3);
}
$_user = new User($_GLOBAL['TABLES']['USERS'], $oid, System::getDB());
?>
?php
ini_set('display_errors',>
Aucun commentaire:
Enregistrer un commentaire