Hier mal n kleines tut
Tagescron wie er originale ist
PHP-Code:
<?
//Tagesklickrally mit smileybonus
$rp = 0;
$ralleydaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_ralleydaten WHERE ralley='tagrally' LIMIT 1"));
$platz = db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT ".$ralleydaten['plaetze']."");
while ($pa = mysql_fetch_array($platz)) {
$rp++;
if ($ralleydaten['art'] == 'statisch') {
$buchungssumme = $ralleydaten['p'.$rp];
} else {
$buchungssumme = $ralleydaten['jackpot'] / 100 * $ralleydaten['p'.$rp];
}
db_query("UPDATE ".$db_prefix."_tagrally SET ausgezahlt = '".time()."' WHERE uid='".$pa['uid']."'");
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$pa['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme, 'Tagesrally (Platz '.$rp.')',$pa['uid']);
bilanz (0,$buchungssumme);
}
db_query ("DELETE FROM ".$db_prefix."_tagrally");
db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot='0' WHERE ralley='tagrally'");
?>
erweitern wir mit dem klickchampion
PHP-Code:
<?
//Tagesklickrally mit smileybonus
$rp = 0;
$ralleydaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_ralleydaten WHERE ralley='tagrally' LIMIT 1"));
$platz = db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT ".$ralleydaten['plaetze']."");
while ($pa = mysql_fetch_array($platz)) {
$rp++;
if ($ralleydaten['art'] == 'statisch') {
$buchungssumme = $ralleydaten['p'.$rp];
} else {
$buchungssumme = $ralleydaten['jackpot'] / 100 * $ralleydaten['p'.$rp];
}
db_query("UPDATE ".$db_prefix."_tagrally SET ausgezahlt = '".time()."' WHERE uid='".$pa['uid']."'");
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$pa['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme, 'Tagesrally (Platz '.$rp.')',$pa['uid']);
bilanz (0,$buchungssumme);
}
db_query ("DELETE FROM ".$db_prefix."_tagrally");
db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot='0' WHERE ralley='tagrally'");
//------------klickchampion--------------//
$datum=date("d.m.Y");
$tag_platz1 = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT 1"));
$ges_platz1 = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userhighscore"));
if($tag_platz1['klicks'] > $ges_platz1['anzahl']){
$usernick = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid ='".$tag_platz1['uid']."'"));
db_query ("UPDATE ".$db_prefix."_userhighscore SET datum='$datum',nick='".$usernick['nickname']."',anzahl='".$tag_platz1['klicks']."', id='".$tag_platz1['uid']."'");
db_query ("INSERT INTO ".$db_prefix."_champions (datum,nick,anzahl,id) VALUES ('$datum','".$usernick['nickname']."','".$tag_platz1['klicks']."','".$tag_platz1['uid']."')");
$buchungssumme='1000';//DER NEUE CHAMP!!
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$tag_platz1['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme,'Neuer Klick-Champion',$tag_platz1['uid']);
echo' der klickchampion ist neu nun'.$tag_platz1['uid'].'er hatt'.$buchungssumme.'miles erhalten';
}else{
$champ = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userhighscore"));
$buchungssumme='20';//DER aktuelle CHAMP täglich!!
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$champ['id']);
buchungsliste ($buchungs_id,'+'.$buchungssumme,'Bonus aktueller Klick-Champion',$champ['id']);
echo' der klickchampion ist immer noch '.$champ['id'].'er hatt'.$buchungssumme.'miles erhalten<br><br><br>';
}
?>
dan noch deine PN's löschen
PHP-Code:
<?
//Tagesklickrally mit smileybonus
$rp = 0;
$ralleydaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_ralleydaten WHERE ralley='tagrally' LIMIT 1"));
$platz = db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT ".$ralleydaten['plaetze']."");
while ($pa = mysql_fetch_array($platz)) {
$rp++;
if ($ralleydaten['art'] == 'statisch') {
$buchungssumme = $ralleydaten['p'.$rp];
} else {
$stand = mysql_fetch_array(db_query("SELECT SUM(klicks) AS klicks FROM ".$db_prefix."_tagrally"));
$aktuell = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_smilie_bonus_30 where klicks <='".$stand['klicks']."' order by klicks desc Limit 1"));
$bonus=$aktuell['bonus'];
$buchungssumme = ($ralleydaten['jackpot']+$bonus) / 100 * $ralleydaten['p'.$rp];
}
db_query("UPDATE ".$db_prefix."_tagrally SET ausgezahlt = '".time()."' WHERE uid='".$pa['uid']."'");
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$pa['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme, 'Tagesrally (Platz '.$rp.')',$pa['uid']);
bilanz (0,$buchungssumme);
}
db_query ("DELETE FROM ".$db_prefix."_tagrally");
db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot='0' WHERE ralley='tagrally'");
//------------klickchampion--------------//
$datum=date("d.m.Y");
$tag_platz1 = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT 1"));
$ges_platz1 = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userhighscore"));
if($tag_platz1['klicks'] > $ges_platz1['anzahl']){
$usernick = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid ='".$tag_platz1['uid']."'"));
db_query ("UPDATE ".$db_prefix."_userhighscore SET datum='$datum',nick='".$usernick['nickname']."',anzahl='".$tag_platz1['klicks']."', id='".$tag_platz1['uid']."'");
db_query ("INSERT INTO ".$db_prefix."_champions (datum,nick,anzahl,id) VALUES ('$datum','".$usernick['nickname']."','".$tag_platz1['klicks']."','".$tag_platz1['uid']."')");
$buchungssumme='1000';//DER NEUE CHAMP!!
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$tag_platz1['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme,'Neuer Klick-Champion',$tag_platz1['uid']);
echo' der klickchampion ist neu nun'.$tag_platz1['uid'].'er hatt'.$buchungssumme.'miles erhalten';
}else{
$champ = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userhighscore"));
$buchungssumme='20';//DER aktuelle CHAMP täglich!!
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$champ['id']);
buchungsliste ($buchungs_id,'+'.$buchungssumme,'Bonus aktueller Klick-Champion',$champ['id']);
echo' der klickchampion ist immer noch '.$champ['id'].'er hatt'.$buchungssumme.'miles erhalten<br><br><br>';
}
//Alle beidseitig gelöschten PN´s löschen
db_query ("DELETE FROM ".$db_prefix."_pn_center WHERE del_e = '1' and del_s = '1'");
?>