Ich stehe gerade bei einem Modul etwas auf dem Schlauch, und zwar geht es um die DJ-Tracklist, denn: Jeden Tag um 0:00 Uhr verschwinden alle Einträge von der Modul-Content-Seite. In der Datenbank sind die Tracks aber wie gewollt noch alle vorhanden. Ich möchte, das sich die Anzeige nicht täglich leert, sondern einfach fortlaufend weiterläuft.
Hier nochmal der Code des ganzen, ich finde einfach keine Funktion darin, die das bewerkstelligt.
contents/tracklist.php
<?php defined ('main') or die ( 'no direct access' ); $title = $allgAr['title'].' :: Kontakt'; $hmenu = 'Kontakt'; $design = new design ( $title , $hmenu ); $design->header(); $tpl = new tpl ('tracklist'); $tpl->out(0); $query = " SELECT a.`name`, a.`avatar`, b.`int`, b.`tit`, DATE_FORMAT(b.`time`,'%H:%i') AS `time` FROM `prefix_user` a JOIN `prefix_tracklist` b ON a.`id` = b.`did` AND b.`date` = '" . date("Ymd") . "' ORDER BY b.`date`, b.`time` DESC "; $sql = db_query($query); while($row = db_fetch_object($sql)){ $time = $row->time; $avatar = $row->avatar; if(empty($avatar)) { $avatar = "include/images/avatars/wurstegal.jpg"; } $name = $row->name; $int = $row->int; $tit = $row->tit; $url = $row->int . " " . $row->tit; $url= str_replace(" ", "+", $url); $url= str_replace("ö", "oe", $url); $url= str_replace("ä", "ae", $url); $url= str_replace("ü", "ue", $url); $url= str_replace("ß", "ss", $url); $url= str_replace("Ö", "Oe", $url); $url= str_replace("Ä", "Ae", $url); $url= str_replace("Ü", "Ue", $url); $tpl->set("time", $time); $tpl->set("avatar", $avatar); $tpl->set("int", $int); $tpl->set("tit", $tit); $tpl->set("name", $name); $tpl->set("youtube", $url); $tpl->set("musicload", $url); $tpl->out(1); } $tpl->out(2); $design->footer(); ?>
admin/tracklist.php
<?php // Copyright by (-GoA][-) Sniper // Support by Jason-Forhie@gmx.de defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); $design = new design ( 'Admins Area', 'Admins Area', 2 ); $design->header(); $tpl = new tpl ( 'tracklist', 1); $aktion = $menu->get(1); $id = $menu->get(2); if($aktion == "edit") { $query = " SELECT `tit`, `int`, `id`, DATE_FORMAT(`time`,'%H') AS `h`, DATE_FORMAT(`time`,'%i') AS `m`, DATE_FORMAT(`time`,'%s') AS `s` FROM `prefix_tracklist` WHERE `id` = '" . $id . "' "; $sql = db_query($query); $row = db_fetch_object($sql); $m = $row->m; $id = $row->id; $h = $row->h; $s = $row->s; $int = $row->int; $tit = $row->tit; } elseif($aktion == "del") { $query = " DELETE FROM `prefix_tracklist` WHERE id = '" . $id . "' "; db_query($query); unset($id); } elseif($aktion == "delall") { $query = " DELETE FROM prefix_tracklist WHERE date < CURDATE() "; db_query($query); } else { $id = (isset($_POST['id'])) ? escape($_POST['id'], 'integer') : ''; $int = (isset($_POST['int'])) ? escape($_POST['int'], 'string') : ''; $tit = (isset($_POST['tit'])) ? escape($_POST['tit'], 'string') : ''; $h = (isset($_POST['h'])) ? escape($_POST['h'], 'string') : ''; $m = (isset($_POST['m'])) ? escape($_POST['m'], 'string') : ''; $s = (isset($_POST['s'])) ? escape($_POST['s'], 'string') : ''; if(!empty($tit) AND !empty($int) AND !empty($h) AND !empty($m) AND !empty($s)) { if(!empty($id)) { $query = " UPDATE `prefix_tracklist` SET `int` = '" . $int . "', `tit` = '" . $tit . "', `int` = '" . $int . "', `time` = '" . $h . $m . $s . "' WHERE `id` = '" . $id . "' "; if(db_query($query)) { unset($h); unset($m); unset($s); unset($id); unset($int); unset($tit); } } else { $query = " INSERT INTO `prefix_tracklist` ( `id`, `date`, `time`, `did`, `dj`, `int`, `tit` ) VALUES ( 'NULL', '" . date("Ymd") . "', '" . $h . $m . $s . "', '" . $_SESSION['authid'] . "', '" . $_SESSION['authname'] . "', '" . $int . "', '" . $tit . "' ) "; if(db_query($query)) { unset($h); unset($m); unset($s); unset($id); unset($int); unset($tit); } } } if(!isset($_POST['submit'])) { $h = date("H"); $m = date("i"); $s = date("s"); } } if(empty($h) OR empty($m) OR empty($s)) { $h = date("H"); $m = date("i"); $s = date("s"); } $int = (!isset($int))?'':$int; $tit = (!isset($tit))?'':$tit; $id = (!isset($id))?'':$id; $tpl->set("INT", $int); $tpl->set("TIT", $tit); $tpl->set("H", $h); $tpl->set("M", $m); $tpl->set("S", $s); $tpl->set("id", $id); $tpl->out(0); $query = " SELECT * FROM `prefix_tracklist` ORDER BY `date` DESC, `time` DESC "; $sql = db_query($query); $i = NULL; while($row = db_fetch_object($sql)){ $id = $row->id; $tit = $row->tit; $int = $row->int; $time = $row->time; if($i%2 == "0"){ $class="Cmite"; } else { $class="Cnorm"; } $tpl->set("wInt", $int); $tpl->set("wTit", $tit); $tpl->set("wId", $id); $tpl->set("TIME", $time); $tpl->set("CLASS", $class); $tpl->set("date", $row->date); $tpl->out(1); $i++; } $tpl->out(2); $design->footer(); ?>
Vielen Dank im Vorraus! Würde mir sehr weiterhelfen hier eine Antwort zu finden
Greetz
~ FFF Team
verwendete ilch Version: 1.1 P