Code:
<?
header("Cache-control: no-cache");
$db_host = "rdbms.xxx";
$db_user = "xxx";
$db_pass = "xxx";
$db_base = "xxx";
$db_prefix = "vms";
$domain = "http://www.thelinkmaster.de/klickmafia"; // ohne Slash am ende
$seitenname = "Klickmafia";
$waehrung = "Lose";
$admin_id = "xxx";
$percode = "xxx";
// SecVMS change begin
$ip = $_SERVER['REMOTE_ADDR'];
// SecVMS change end
// Banner Jackpot
$jackmin = 100; // Kleinste Gewinnzahl
$jackmax = 99999; // Maximale Gewinnzahl
$banner_jackpotcode = 8743; // Jackpot Gewinnzahl
$betreibermail = "xxx";
// Variabeln definieren
if (!isset($login_check['hinweis'])) $login_check['hinweis'] = "";
function db_connect() {
global $db_host,$db_user,$db_pass,$db_base,$sql_open;
$sql_open = @mysql_connect($db_host,$db_user,$db_pass) or die("Keine Verbindung zur Datenbank!");
$sql_base = @mysql_select_db($db_base) or die("Keine oder falsche Datenbank gewählt!");
}
function db_query($sql_tag) {
$sql_return = mysql_query($sql_tag);
return $sql_return;
}
function db_close() {
global $sql_open;
@mysql_close($sql_open) or die("Konnte die Verbindung mit Datenbank nicht schliessen!");
}
function create_code($code_laenge) {
srand((double)microtime()*1000000);
$created_code = '';
$zeichen="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
for ($i=0;$i<$code_laenge;$i++) {
$n=rand() % strlen($zeichen);
$created_code .=substr($zeichen, $n, 1);
}
return $created_code;
}
function buchungsliste ($buchungs_id,$trans_menge,$verwendung,$fuer) {
global $db_prefix;
db_query("INSERT INTO ".$db_prefix."_buchungen (uid,buchungszeit,buchungs_id,buchungsmenge,verwendungszweck) VALUES (".$fuer.",".time().",'".$buchungs_id."','".$trans_menge."','".$verwendung."')");
}
function kontobuchung ($art,$trans_menge,$fuer) {
global $db_prefix;
db_query("UPDATE ".$db_prefix."_kontodaten SET `kontostand` = `kontostand` ".$art." ".$trans_menge." WHERE uid=".$fuer."");
}
function userstatus () {
global $_SESSION,$db_prefix;
if ($_SESSION['login'] == 'true') {
$us = db_query("SELECT `uid`,`passwort`,`status`,`hinweis` FROM ".$db_prefix."_kontodaten WHERE uid=".$_SESSION['uid']." and passwort='".$_SESSION['passwort']."' LIMIT 1");
$login_check = mysql_fetch_array($us);
if (!mysql_num_rows($us) or $login_check['status'] == 0) {
setCookie('uid','',time()-86400*30);
setCookie('passwort','',time()-86400*30);
setCookie('autologin','',time()-86400*30);
$_SESSION['uid'] = "";
$_SESSION['passwort'] = "";
$_SESSION['login'] = "";
@include_once('content/error/kein_zutritt.php');
@include_once('lib/footer.php');
die();
}
if ($login_check['status'] == 2) {
setCookie('uid','',time()-86400*30);
setCookie('passwort','',time()-86400*30);
setCookie('autologin','',time()-86400*30);
$_SESSION['uid'] = "";
$_SESSION['passwort'] = "";
$_SESSION['login'] = "";
@include_once('content/error/user_gesperrt.php');
@include_once('lib/footer.php');
die();
}
} else {
@include_once('content/error/kein_zutritt.php');
@include_once('lib/footer.php');
die();
}
}
function refumsatz ($buchungssumme,$fuer) {
global $db_prefix;
db_query ("UPDATE ".$db_prefix."_werberdaten SET umsatz = umsatz + ".$buchungssumme.", aktivzeit='".time()."' WHERE uid='".$fuer."' and werber != 0");
}
function aktivralley ($buchungssumme,$fuer) {
global $db_prefix;
// Wenn Aktivralley läuft
$ralleydaten_aktiv = mysql_fetch_array(db_query("SELECT `start`,`ende` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'aktivralley' LIMIT 1"));
if ($ralleydaten_aktiv['start'] <= time() && $ralleydaten_aktiv['ende'] >= time()) {
$aktiveintragen = db_query("SELECT * FROM ".$db_prefix."_aktivralley WHERE uid = '".$fuer."'");
if (!mysql_num_rows($aktiveintragen)) {
db_query ("INSERT INTO ".$db_prefix."_aktivralley (uid,punkte) VALUES ('".$fuer."','".$buchungssumme."')");
} else {
db_query ("UPDATE ".$db_prefix."_aktivralley SET punkte = punkte + ".$buchungssumme." WHERE uid='".$fuer."'");
}
}
}
function klickralley () {
global $db_prefix,$_SESSION;
// wenn Klickralley läuft
$ralleydaten_klick = mysql_fetch_array(db_query("SELECT `start`,`ende`,`art`,`pro` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'klickralley' LIMIT 1"));
if ($ralleydaten_klick['start'] <= time() && $ralleydaten_klick['ende'] >= time()) {
$klickeintragen = db_query("SELECT * FROM ".$db_prefix."_klickralley WHERE uid = '".$_SESSION['uid']."'");
if ($ralleydaten_klick['art'] == 'dynamisch') db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot=jackpot+'".$ralleydaten_klick['pro']."' WHERE ralley = 'klickralley'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."_klickralley (uid,klicks) VALUES ('".$_SESSION['uid']."','1')");
} else {
db_query ("UPDATE ".$db_prefix."_klickralley SET klicks = klicks + 1 WHERE uid='".$_SESSION['uid']."'");
}
}
}
db_query("UPDATE ".$db_prefix."_support SET status=2 WHERE status=1 AND time<".(time()-(5*86400)));
function bettelralley ($userid) {
global $db_prefix;
// wenn Bettelralley läuft
$ralleydaten_bettel = mysql_fetch_array(db_query("SELECT `start`,`ende`,`art`,`pro` FROM ".$db_prefix."vms_ralleydaten WHERE ralley = 'bettelralley' LIMIT 1"));
if ($ralleydaten_bettel['start'] <= time() && $ralleydaten_bettel['ende'] >= time()) {
$klickeintragen = db_query("SELECT * FROM ".$db_prefix."_bettelralley WHERE uid = '".$userid."'");
if ($ralleydaten_bettel['art'] == 'dynamisch') db_query ("UPDATE ".$db_prefix."vms_ralleydaten SET jackpot=jackpot+'".$ralleydaten_bettel['pro']."' WHERE ralley = 'bettelralley'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."vms_bettelralley (uid,klicks) VALUES ('".$userid."','1')");
} else {
db_query ("UPDATE ".$db_prefix."vms_bettelralley SET klicks = klicks + 1 WHERE uid='".$userid."'");
}
}
}
?>