Lockfile check.php, addhit.php, BuLi-Tipp Debugging, Galerie Kommentarfunktion
This commit is contained in:
@@ -4,18 +4,35 @@ include("../rowforeach.php");
|
||||
include("inc.php");
|
||||
|
||||
$bundesliga = file_get_contents("liga.txt");
|
||||
$year = file_get_contents("saison.txt");
|
||||
$year = intval(file_get_contents("saison.txt"));
|
||||
|
||||
$reload=false;
|
||||
$lockFile = fopen(__DIR__ . '/script.lock', 'c');
|
||||
|
||||
if (!$lockFile) {
|
||||
die('Lockdatei konnte nicht geöffnet werden');
|
||||
}
|
||||
|
||||
if (flock($lockFile, LOCK_EX | LOCK_NB)) {
|
||||
// Skript läuft noch nicht
|
||||
|
||||
// Paarungen holen
|
||||
// HTTP-Request ausführen
|
||||
$spieltag=getmaxtippspieltag()+1;
|
||||
|
||||
$result=mysqli_execute_query($db_id,"SELECT COUNT(*) FROM `buli-paarungen`;",[]);
|
||||
$row=mysqli_fetch_row($result);
|
||||
if($row[0]==0){
|
||||
echo "Keine Paarungen in der Datenbank, starte mit Spieltag 1";
|
||||
$spieltag=1;
|
||||
}else{
|
||||
$spieltag=getmaxtippspieltag()+1;
|
||||
|
||||
}
|
||||
if($spieltag<=34){
|
||||
$response = file_get_contents("https://api.openligadb.de/getmatchdata/bl".$bundesliga."/".$year."/".$spieltag, false);
|
||||
|
||||
if ($response === false) {
|
||||
echo "<script>window.alert(`Fehler beim HTTP-Request(Z.41)! Bitte einen Admin kontaktieren! BuLi-Tipp Daten konnten nicht aktualisiert werden.`);</script>";
|
||||
echo "Fehler beim HTTP Request!";
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +84,6 @@ if ($responseData!=null) {
|
||||
|
||||
$spieltag=getmaxspieltag()+1;
|
||||
|
||||
if($spieltag<=3){
|
||||
|
||||
$response = file_get_contents("https://api.openligadb.de/getmatchdata/bl".$bundesliga."/".$year."/".$spieltag, false);
|
||||
|
||||
@@ -100,7 +116,6 @@ if ($responseData) {
|
||||
// echo "<script>window.alert(`JSON-Response ungültig (Z.29)! Bitte einen Admin kontaktieren! BuLi-Tipp Daten konnten nicht aktualisiert werden.`);</script>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(srowforeach("SELECT COUNT(`id`) from `buli-icons`;",[])[0][0]<9){
|
||||
mysqli_execute_query($db_id,"TRUNCATE `buli-icons`;",[]);
|
||||
@@ -114,3 +129,7 @@ if(srowforeach("SELECT COUNT(`id`) from `buli-icons`;",[])[0][0]<9){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
flock($lockFile, LOCK_UN);
|
||||
fclose($lockFile);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ $userquery=srowforeach("SELECT id FROM `buli-user` WHERE id = ?",[$userid]);
|
||||
if(count($userquery) == 0) die("User nicht gefunden");
|
||||
|
||||
$userid = $userquery[0][0];
|
||||
$spieltag=getmaxspieltag()+1;
|
||||
|
||||
if(count(srowforeach("SELECT id FROM `buli-tipps` WHERE user = ? AND spieltag=?",[$userid,$spieltag])) == 0) echo "0";
|
||||
else echo "1";
|
||||
|
||||
@@ -1 +1 @@
|
||||
2024
|
||||
2025
|
||||
|
||||
@@ -11,7 +11,6 @@ if(count($query)>0){
|
||||
$hours=(int) date("H", $unixtime);
|
||||
$days=date("d", $unixtime)-1;
|
||||
}
|
||||
$days=0;
|
||||
|
||||
$data=[
|
||||
"spieltag" => getmaxspieltag()+1,
|
||||
@@ -21,4 +20,4 @@ $data=[
|
||||
"days" => $days
|
||||
];
|
||||
|
||||
echo json_encode($data,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
|
||||
echo json_encode($data,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
|
||||
|
||||
Reference in New Issue
Block a user