Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
$wochentage = array("mo", "di", "mi", "do", "fr", "sa", "so"); $aktueller_wochentag = $wochentage[date("N") - 1]; $sql = "SELECT `time`, `" . $aktueller_wochentag . "` FROM `prefix_radio_sendplan`"; $erg = db_query($sql); $sendeplan = array(); while($row = db_fetch_assoc($erg)) { $time = explode(":", $row["time"]); $timestamp = mktime($time[0], $time[1]); $differenz = time() - $timestamp; if(!$differenz < 0) { $sendeplan[$differenz] = $row[$aktueller_wochentag]; } } krsort($sendeplan); $aktueller_eintrag = array_pop($sendeplan); echo $aktueller_eintrag;
MySQL Error: 1054 : Unknown column 'so' in 'field list' in Query: SELECT `time`, `so` FROM `ic2_radio_sendeplan` Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ onairbox.php:21 -- db_query(...) @ design.php:332 -- require_once(...) @ design.php:254 -- design->get_boxcontent(...) @ design.php:46 -- design->get_boxes(...) @ self.php:68 -- design->design(...) @ index.php:39 -- require_once(...) Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/include/includes/func/db/mysql.php on line 58
$datum = date("Y-m-d"); $sql = "SELECT a.id, a.date, a.time, a.content, b.name as dj FROM xic_radio_sendeplan a LEFT JOIN xic_user b ON a.dj_id = b.id WHERE a.date = '" . $datum . "'"; $erg = db_query($sql); $sendeplan = array(); while($row = db_fetch_assoc($erg)) { $time = explode(" - ", $row["time"]); $time_anfang = explode(":", $time[0]); $timestamp_anfang = mktime($time_anfang[0], $time_anfang[1]) - 60; $time_ende = explode(":", $time[1]); $timestamp_ende = mktime($time_ende[0], $time_ende[1]); if($timestamp_anfang < time() AND $timestamp_ende > time()) { $sendeplan = $row; } } if($sendeplan["id"] == "") { echo "Keinen Eintrag im Sendeplan gefunden"; } echo $sendeplan["date"]; echo $sendeplan["time"]; echo bbcode($sendeplan["content"]); echo $sendeplan["dj"];
<?php ##################################################### # RadioModul by DjGeCk0 # http://gecko.ilch.de # On Air - Box # Support: http://www.ilch.de/forum-showposts-37650.html ############################################## ######## defined ('main') or die ( 'no direct access' ); require_once('./include/includes/class/scRadioModul.php'); $datum = date("Y-m-d"); $sql = "SELECT a.id, a.date, a.time, a.content, b.name as dj FROM ic2_radio_sendeplan a LEFT JOIN ic2_user b ON a.dj_id = b.id WHERE a.date = '" . $datum . "'"; $erg = db_query($sql); $sendeplan = array(); while($row = db_fetch_assoc($erg)) { $time = explode(" - ", $row["time"]); $time_anfang = explode(":", $time[0]); $timestamp_anfang = mktime($time_anfang[0], $time_anfang[1]) - 60; $time_ende = explode(":", $time[1]); $timestamp_ende = mktime($time_ende[0], $time_ende[1]); if($timestamp_anfang < time() AND $timestamp_ende > time()) { $sendeplan = $row; } } if($sendeplan["id"] == "") { echo "Keinen Eintrag im Sendeplan gefunden"; } echo $sendeplan["date"]; echo $sendeplan["time"]; echo bbcode($sendeplan["content"]); echo $sendeplan["dj"]; if (@db_result(db_query("SELECT `einstellung` FROM `xic_radio_settings` WHERE `auswahl` = 'sendeplanlink'")) == 'Ja') echo '<hr /><div align="center"><a href="index.php?sendeplan" title="Sendeplan">Zum Sendeplan</a></div>'; function output($text) { return preg_replace( '/([^\s]{10})(?=[^\s])/', "$1-\n", $text); } ?>
echo $sendeplan["date"] . "<br/>"; echo $sendeplan["time"] . "<br/>"; echo bbcode($sendeplan["content"]) . "<br/>"; echo $sendeplan["dj"];
?> <p><?php echo $sendeplan["date"]; ?></p> <p><?php echo $sendeplan["time"]; ?></p> <p><?php echo bbcode($sendeplan["content"]); ?></p> <p><?php echo $sendeplan["dj"]; ?></p> <?php
echo $sendeplan["dj"];
$sql = "SELECT a.id, a.date, a.time, a.content, b.name as dj, b.avatar FROM ic2_radio_sendeplan a LEFT JOIN ic2_user b ON a.dj_id = b.id WHERE a.date = '" . $datum . "'";
<img src="<?php echo $sendeplan["avatar"]; ?>" alt="<?php echo $sendeplan["dj"]; ?>" />
<img src="<?php echo $sendeplan["avatar"]; ?>" alt="<?php echo $sendeplan["dj"]; ?>" />
echo "<img src='" . $sendeplan["avatar"] . "' alt='" . $sendeplan["dj"] . "' />";
<?php ##################################################### # RadioModul by DjGeCk0 # http://gecko.ilch.de # On Air - Box # Support: http://www.ilch.de/forum-showposts-37650.html ############################################## ######## defined ('main') or die ( 'no direct access' ); require_once('./include/includes/class/scRadioModul.php'); $datum = date("Y-m-d"); $sql = "SELECT a.id, a.date, a.time, a.content, b.name as dj, b.avatar FROM ic2_radio_sendeplan a LEFT JOIN ic2_user b ON a.dj_id = b.id WHERE a.date = '" . $datum . "'"; $erg = db_query($sql); $sendeplan = array(); while($row = db_fetch_assoc($erg)) { $time = explode(" - ", $row["time"]); $time_anfang = explode(":", $time[0]); $timestamp_anfang = mktime($time_anfang[0], $time_anfang[1]) - 60; $time_ende = explode(":", $time[1]); $timestamp_ende = mktime($time_ende[0], $time_ende[1]); if($timestamp_anfang < time() AND $timestamp_ende > time()) { $sendeplan = $row; } } if($sendeplan["id"] == "") { echo "Keinen Eintrag im Sendeplan gefunden"; } echo $sendeplan["dj"] . "<br/>"; echo "<img src='" . $sendeplan["avatar"] . "' alt='" . $sendeplan["dj"] . "' />"; echo "<br/>"; echo $sendeplan["date"] . "<br/>"; echo $sendeplan["time"] . "<br/>"; echo bbcode($sendeplan["content"]) . "<br/>"; if (@db_result(db_query("SELECT `einstellung` FROM `xic_radio_settings` WHERE `auswahl` = 'sendeplanlink'")) == 'Ja') echo '<hr /><div align="center"><a href="index.php?sendeplan" title="Sendeplan">Zum Sendeplan</a></div>'; function output($text) { return preg_replace( '/([^\s]{10})(?=[^\s])/', "$1-\n", $text); } ?>
<?php 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 ('radio/djs.htm', 1); if ($menu->getA(1) == 'd') { $id = escape($menu->getE(1),'integer'); $test = db_query("SELECT `userid` FROM `prefix_radio_djs` WHERE `userid` = '$id'"); if (!$test) { $mid1 = db_result(db_query("SELECT `id` FROM `prefix_modules` WHERE `url` = 'sendeplan'")); $mid2 = db_result(db_query("SELECT `id` FROM `prefix_modules` WHERE `url` = 'wunschgruss'")); db_query("DELETE FROM `prefix_radio_djs` WHERE `userid` = '$id'"); db_query("DELETE FROM `prefix_modulerights` WHERE `uid` = '$id' AND (`mid` = '$mid1' OR `mid` = '$mid2')"); wd('admin.php?djs','Erfolgreich ausgetragen.'); } else { wd('admin.php?djs','Dieser DJ ist nicht eingetragen!'); } } elseif (isset($_POST['save'])) { $name = escape($_POST['name'],'string'); $id = @db_result(db_query("SELECT `id` FROM `prefix_user` WHERE `name` = '$name'")); if (!$id) { wd('admin.php?djs','Diesen User gibt es nicht.'); } else { $test = db_query("SELECT `userid` FROM `prefix_radio_djs` WHERE `userid` = '$id'"); if (db_num_rows($test) == 0) { $mid1 = db_result(db_query("SELECT `id` FROM `prefix_modules` WHERE `url` = 'sendeplan'")); $mid2 = db_result(db_query("SELECT `id` FROM `prefix_modules` WHERE `url` = 'wunschgruss'")); db_query("INSERT INTO `prefix_radio_djs` (`userid`) VALUES ('$id')"); db_query("INSERT INTO `prefix_modulerights` (`uid`,`mid`) VALUES ('$id','$mid1'),('$id','$mid2')"); wd('admin.php?djs','Neuer DJ wurde hinzugefügt.'); } else { wd('admin.php?djs','Dieser User ist bereits als DJ eingetragen.'); } } } else { $tpl->out(0); $limit = 5; // Limit $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1 ); $MPL = db_make_sites ($page , '' , $limit , "?djs" , 'radio_djs' ); $anfang = ($page - 1) * $limit; $q = db_query("SELECT `a`.`name`,`a`.`id` FROM `prefix_radio_djs` b LEFT JOIN `prefix_user` a ON `b`.`userid` = `a`.`id` LIMIT $anfang,$limit"); while($row = db_fetch_assoc($q)) { $tpl->set('DJID',$row['id']); $tpl->set('DJ',$row['name']); $tpl->out(1); } $tpl->set('MPL', $MPL); $tpl->out(2); } require_once('include/includes/class/scRadioModul.php'); echo getCopyright(false); $design->footer(); ?>
Geschlossen | ||
Zurück zu Module und Modifikationen |