PHP-Code:
<?
header("Cache-control: no-cache");
das übliche....
// SecVMS change begin
$ip = $_SERVER['REMOTE_ADDR'];
// SecVMS change end
$betreibermail = "admin@grafmails.de";
// Banner Jackpot
$jackmin = 1001; // Kleinste Gewinnzahl
$jackmax = 9999; // Maximale Gewinnzahl
$jackerhoehung = 1; // Jackpoterhöhung
$banner_jackpot_startwert = 1; // Jackpot Startzahl
// Mail Jackpot
$jackmin = 1001; // Kleinste Gewinnzahl
$jackmax = 9999; // Maximale Gewinnzahl
$mailjack = 1; // Jackpoterhöhung
$mail_jackpot_startwert = 5; // ist der Wert, mit dem ein neuer jackpot startet (kann auch jede beliebige Zahl sein sein);
// Zufallsjackpot errechnen
$mail_jackpotzahl = rand($jackmin,$jackmax);
// 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){
$vargs = array();
$fargs = func_get_args();
foreach($fargs as $key => $arg){
$vargs[$key] = mysql_real_escape_string($arg);
}
array_shift($vargs);
$sql_tag = vsprintf($sql_tag,$vargs);
if($ret = mysql_query($sql_tag)){
return $ret;
}else{
return 0;
}
}
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 sonderralley ($zumpotdazu) {
global $db_prefix,$_SESSION;
// wenn Sonderralley läuft
$ralleydaten_klick = mysql_fetch_array(db_query("SELECT `start`,`ende`,`art`,`pro` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'sonderralley' LIMIT 1"));
if ($ralleydaten_klick['start'] <= time() && $ralleydaten_klick['ende'] >= time()) {
$klickeintragen = db_query("SELECT * FROM ".$db_prefix."_sonderralley WHERE uid = '".$_SESSION['uid']."'");
if ($ralleydaten_klick['art'] == 'dynamisch') db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot=jackpot+'".$zumpotdazu."' WHERE ralley = 'sonderralley'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."_sonderralley (uid,klicks) VALUES ('".$_SESSION['uid']."','1')");
} else {
db_query ("UPDATE ".$db_prefix."_sonderralley SET klicks = klicks + 1 WHERE uid='".$_SESSION['uid']."'");
}
}
}
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']."'");
}
}
}
function mailralley ($buchungssumme,$userid) {
global $db_prefix;
// Wenn Mailralley läuft
$ralleydaten_aktiv = mysql_fetch_array(db_query("SELECT `start`,`ende` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'mailralley' LIMIT 1"));
if ($ralleydaten_aktiv['start'] <= time() && $ralleydaten_aktiv['ende'] >= time()) {
$aktiveintragen = db_query("SELECT * FROM ".$db_prefix."_mailralley WHERE uid = '".$userid."'");
if (!mysql_num_rows($aktiveintragen)) {
db_query ("INSERT INTO ".$db_prefix."_mailralley (uid,punkte) VALUES ('".$userid."','".$buchungssumme."')");
} else {
db_query ("UPDATE ".$db_prefix."_mailralley SET punkte = punkte + ".$buchungssumme." WHERE uid='".$userid."'");
}
}
}
function mtagrally ($userid) {
global $db_prefix;
// wenn mtagrally läuft
$ralleydaten_mtag = mysql_fetch_array(db_query("SELECT `start`,`ende`,`art`,`pro` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'mtagrally' LIMIT 1"));
if ($ralleydaten_mtag['start'] <= time() && $ralleydaten_mtag['ende'] >= time()) {
$klickeintragen = db_query("SELECT * FROM ".$db_prefix."_mtagrally WHERE uid = '".$userid."'");
if ($ralleydaten_mtag['art'] == 'dynamisch') db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot=jackpot+'".$ralleydaten_mtag['pro']."' WHERE ralley = 'mtagrally'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."_mtagrally (uid,klicks) VALUES ('".$userid."','1')");
} else {
db_query ("UPDATE ".$db_prefix."_mtagrally SET klicks = klicks + 1 WHERE uid='".$userid."'");
}
}
}
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."_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."_ralleydaten SET jackpot=jackpot+'".$ralleydaten_bettel['pro']."' WHERE ralley = 'bettelralley'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."_bettelralley (uid,klicks) VALUES ('".$userid."','1')");
} else {
db_query ("UPDATE ".$db_prefix."_bettelralley SET klicks = klicks + 1 WHERE uid='".$userid."'");
}
}
}
?>