Chat Hintergrund Wechsel nach Uhrzeit (Support für das Chatscript)

sala99 ⌂, Thursday, 02.02.2023, 12:06 (vor 456 Tagen)

Guten Tag zusammen

ich habe folgendes in der neuen skin css angelegt

if(isset($_SESSION['bg_imge'])) {
  $bg = $_SESSION['bg_imge'];
} else {

if (is_dir("bg_imge")) {   
$files = scandir('bg_imge');
$files_count = count($files)-2; // .. und . nicht zählen
$bg = 'bg_imge/'.$files[rand(2,$files_count + 1)]; // +1, weil array mit 0 beginnt

// nur täglich wechselnd:
// $daynum = date('z') + 1;
// $r = fmod($daynum,$files_count) + 1;
// $bg = 'bg_img/'.$files[$r];
} else {

if (@fopen("https://source.unsplash.com","r")) {
  $bg = 'https://source.unsplash.com/random/1900×1200?people chatting';
  // $bg = 'https://source.unsplash.com/random/1900×1200?holidays';
} else {
  $bg = 'img/helena-lopes-e3OUQGT9bWU-unsplash_1.jpg'; 
}
}

// setcookie("bg_img", $bg);
$_SESSION["bg_imge"] = $bg;
}

#wall {
overflow: auto;
margin: 0 0 7px 0;
line-height: 1.1em;
    background-image:url(<?php echo $bg; ?>)!important;
background-position: 100% 0;
background-repeat:no-repeat;
background-size:cover !important;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
max-width: 60em; /* damit word-wrap weiss was es tun soll */
word-wrap:break-word;
}

funktioniert auch alles super Bild Wechsel habe neuen Ordner angelegt Bilder rein gepackt fertig wenn der User rein kommt hat er nen andres Bild im Chat wen Mann Chat neu lädt kommt neues Bild also Radom. nun würde ich gerne das Bilder nach Uhrzeiten sich wechseln zum Beispiel von 12 bis 14 Uhr Winter Bild dann von 14 bis 16 Uhr Sommer Bild
könnte da etwas Hilfe gebrauchen bitte wäre eventuell für andre eventuell auch eine feine Sache lg

Eintrag gesperrt
544 Views

gesamter Thread: