skyevolution
Grünschnabel
Hallo,
Ich hätte mal eine Frage, wie kann man das ändern das die Tage wie bei TechnoBase.FM ausgegeben werden (Gestern - Donnerstag - Freitag - Samstag - Sonntag - Montag - Dienstag - Mittwoch)?
Mein Script:
PHP Code der zuständigen PHP-Datei:
...währe sehr dankbar wenn mir einer weiterhelfen könnte...
Gruß Paddy
Ich hätte mal eine Frage, wie kann man das ändern das die Tage wie bei TechnoBase.FM ausgegeben werden (Gestern - Donnerstag - Freitag - Samstag - Sonntag - Montag - Dienstag - Mittwoch)?
Mein Script:
PHP Code der zuständigen PHP-Datei:
PHP:
<?php
##########################################
# Copyright by Philipp Rehs & #
# www.webspell.org #
##########################################
if(isset($_GET['action'])) $action = $_GET['action'];
else $action = null;
$_language->read_module("radio");
eval ("\$title = \"".gettemplate("title_streamingplan")."\";");
echo $title;
$bg1 = BG_1;
$bg2 = BG_2;
$bg3 = BG_3;
$bg4 = BG_4;
$config = radioGetConfig();
if(isset($_POST['search'])){
$_SESSION['day'] = $_POST['day'];
$_SESSION['month'] = $_POST['month'];
$_SESSION['year'] = $_POST['year'];
$_SESSION['stream'] = $_POST['stream'];
}
if(isset($_GET['day'])){
$_SESSION['day'] = $_GET['day'];
$_SESSION['month'] = $_GET['month'];
$_SESSION['year'] = $_GET['year'];
}
if(isset($_GET['activate'])){
$get = safe_query("SELECT dj FROM ".PREFIX."radio_plan WHERE showID='".$_GET['activate']."'");
$data = mysql_fetch_assoc($get);
if(isradioAdmin($userID) || ($loggedin && $data['dj'] == $userID)){
safe_query("UPDATE ".PREFIX."radio_plan SET active='1' WHERE showID='".$_GET['activate']."'");
}
redirect("index.php?site=streamingplan","",0);
}
if(isset($_GET['deactivate'])){
$get = safe_query("SELECT dj FROM ".PREFIX."radio_plan WHERE showID='".$_GET['deactivate']."'");
$data = mysql_fetch_assoc($get);
if(isradioAdmin($userID) || ($loggedin && $data['dj'] == $userID)){
safe_query("UPDATE ".PREFIX."radio_plan SET active='0' WHERE showID='".$_GET['deactivate']."'");
}
redirect("index.php?site=streamingplan","",0);
}
if($action=='new'){
if(isclanmember($userID)){
if(isset($_SESSION['tmp'])){
$cur_day = date("d", time());
$day_s = getSelect("day",$_SESSION['tmp']['day_s']);
$day_e = getSelect("day",$_SESSION['tmp']['day_e']);
$cur_month = date("m", time());
$month_s = getSelect("month",$_SESSION['tmp']['month_s']);
$month_e = getSelect("month",$_SESSION['tmp']['month_e']);
$cur_year = date("Y", time());
$year_s = getSelect("year",$_SESSION['tmp']['year_s']);
$year_e = getSelect("year",$_SESSION['tmp']['year_e']);
$genres = getGenres($_SESSION['tmp']['genre']);
$streams = getStreams($_SESSION['tmp']['stream']);
$h_s = $_SESSION['tmp']['h_s'];
$h_e = $_SESSION['tmp']['h_e'];
$m_s = $_SESSION['tmp']['min_s'];
$m_e = $_SESSION['tmp']['min_e'];
$show = getforminput($_SESSION['tmp']['show']);
$info = getforminput($_SESSION['tmp']['infos']);
}
else{
$cur_day = date("d", time());
$day_s = $day_e = getSelect("day");
$cur_month = date("m", time());
$month_s = $month_e = getSelect("month");
$cur_year = date("Y", time());
$year_s = $year_e = getSelect("year");
$genres = getGenres();
$streams = getStreams();
$h_s = $h_e = $m_s = $m_e = $show = $info = "";
}
$upload_info = $_language->module['upload_info'];
$upload_info = str_replace(array('%max_x%','%max_y%'),array($config['max_x'],$config['max_y']),$upload_info);
eval ("\$sendeplan_add = \"".gettemplate("radio_add")."\";");
echo $sendeplan_add;
}
else redirect('index.php?site=streamingplan',$_language->module['no_access'],3);
}
elseif(isset($_POST['save'])){
if(isclanmember($userID)){
$start_time = mktime((int)$_POST['h_s'],(int)$_POST['min_s'],0,(int)$_POST['month_s'],(int)$_POST['day_s'],(int)$_POST['year_s']);
$end_time = mktime((int)$_POST['h_e'],(int)$_POST['min_e'],0,(int)$_POST['month_e'],(int)$_POST['day_e'],(int)$_POST['year_e']);
$show = $_POST['show'];
$genre = $_POST['genre'];
$infos = $_POST['infos'];
$stream = $_POST['stream'];
$get = safe_query("SELECT showID FROM ".PREFIX."radio_plan WHERE streamID='".$stream."' AND ((".($start_time+1)." BETWEEN start_date AND end_date) || (".($end_time-1)." BETWEEN start_date AND end_date))");
if(!mysql_num_rows($get)){
if(isset($_SESSION['tmp'])) unset($_SESSION['tmp']);
$do = safe_query("INSERT INTO ".PREFIX."radio_plan (start_date,end_date,dj,show_name,genre,info,streamID) VALUES ('".$start_time."','".$end_time."','".$userID."','".$show."','".$genre."','".$infos."','".$stream."') ");
if($do){
$id = mysql_insert_id();
if(!empty($_FILES['image']['tmp_name'])){
$name = $_FILES['image']['name'];
$info = getimagesize($_FILES['image']['tmp_name']);
if( $info[3] == IMAGETYPE_GIF ||
$info[3] == IMAGETYPE_JPEG ||
$info[3] == IMAGETYPE_PNG ){
if($info[0]<=$config['max_x'] && $info[1]<=$config['max_y']){
$ext = substr($name,strrpos($name,"."));
move_uploaded_file($_FILES['image']['tmp_name'],"./images/radio/show_".$id.$ext);
safe_query("UPDATE ".PREFIX."radio_plan SET image='show_".$id.$ext."' WHERE showID = '".$id."'");
}
}
}
redirect('index.php?site=streamingplan', $_language->module['successful'],3);
}
else redirect('index.php?site=streamingplan', $_language->module['error'], 3);
}
else{
$_SESSION['tmp'] = $_POST;
redirect('index.php?site=streamingplan&action=new', $_language->module['conflict_with_show'], 3);
}
}
else redirect('index.php?site=streamingplan',$_language->module['no_access'],3);
}
elseif($action=="edit"){
$id = $_GET['showID'];
$get = safe_query("SELECT * FROM ".PREFIX."radio_plan WHERE showID='$id' LIMIT 0,1");
$ds = mysql_fetch_array($get);
if(isradioAdmin($userID) || ($ds['dj']==$userID && $loggedin)){
$day = getSelect("day",$ds['start_date'],true);
$month = getSelect("month",$ds['start_date'],true);
$year = getSelect("year",$ds['start_date'],true);
$daye = getSelect("day",$ds['end_date'],true);
$monthe = getSelect("month",$ds['end_date'],true);
$yeare = getSelect("year",$ds['end_date'],true);
$h_s = date("H",$ds['start_date']);
$min_s = date("i",$ds['start_date']);
$h_e = date("H",$ds['end_date']);
$min_e = date("i",$ds['end_date']);
$name = $ds['show_name'];
$streams = getStreams($ds['streamID']);
$genres = getGenres($ds['genre']);
$info = $ds['info'];
$upload_info = $_language->module['upload_info'];
$upload_info = str_replace(array('%max_x%','%max_y%'),array($config['max_x'],$config['max_y']),$upload_info);
$showID = $id;
eval("\$sendeplan_edit = \"".gettemplate("radio_edit")."\";");
echo $sendeplan_edit;
}
else redirect('index.php?site=streamingplan',$_language->module['no_access'],3);
}
elseif(isset($_POST['saveedit'])){
$showID = $_POST['showID'];
$get = safe_query("SELECT dj FROM ".PREFIX."radio_plan WHERE showID='".$showID."'");
$data = mysql_fetch_assoc($get);
if(isradioAdmin($userID) || ($data['dj']==$userID && $loggedin)){
$start_time = mktime($_POST['h_s'],$_POST['m_s'],0,$_POST['month_s'],$_POST['day_s'],$_POST['year_s']);
$end_time = mktime($_POST['h_e'],$_POST['m_e'],0,$_POST['month_e'],$_POST['day_e'],$_POST['year_e']);
$show = $_POST['show'];
$genre = $_POST['genre'];
$infos = $_POST['infos'];
$stream = $_POST['stream'];
$get = safe_query("SELECT showID FROM ".PREFIX."radio_plan WHERE streamID='".$stream."' AND ((".($start_time+1)." BETWEEN start_date AND end_date) || (".($end_time-1)." BETWEEN start_date AND end_date))");
if(!mysql_num_rows($get)){
$do = safe_query("UPDATE ".PREFIX."radio_plan SET start_date='".$start_time."', end_date='".$end_time."', show_name='".$show."', genre='".$genre."', info='".$infos."', streamID='".$stream."' WHERE showID='".$showID."'");
if($do){
if(!empty($_FILES['image']['tmp_name'])){
$name = $_FILES['image']['name'];
$info = getimagesize($_FILES['image']['tmp_name']);
if( $_FILES['image']['type'] == "image/jpeg" ||
$_FILES['image']['type'] == "image/gif" ||
$_FILES['image']['type'] == "image/png" ){
if($info[0]<=$config['max_x'] && $info[1]<=$config['max_y']){
$ext = substr($name,strrpos($name,"."));
move_uploaded_file($_FILES['image']['tmp_name'],"./images/radio/show_".$showID.$ext);
safe_query("UPDATE ".PREFIX."radio_plan SET image='show_".$showID.$ext."' WHERE showID = '".$showID."'");
}
}
}
redirect('index.php?site=streamingplan',$_language->module['successful'],3);
}
else redirect('index.php?site=streamingplan',$_language->module['error'],3);
}
else{
redirect('index.php?site=streamingplan&action=edit&showID='.$showID, $_language->module['conflict_with_show'], 3);
}
}
else redirect('index.php?site=streamingplan',$_language->module['no_access'],3);
}
elseif(isset($_GET['del'])){
$get = safe_query("SELECT dj FROM ".PREFIX."radio_plan WHERE showID='".$_GET['del']."'");
$data = mysql_fetch_assoc($get);
if(isradioAdmin($userID) || ($loggedin && $data['dj'] == $userID)){
$do=safe_query("DELETE FROM ".PREFIX."radio_plan WHERE showID='".$_GET['del']."'");
if($do) redirect('index.php?site=streamingplan',$_language->module['successful'],3);
else redirect('index.php?site=streamingplan',$_language->module['error'],3);
}
else{
redirect('index.php?site=streamingplan',$_language->module['error'],3);
}
}
else{
if(isclanmember($userID)) echo'<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=streamingplan&action=new\');return document.MM_returnValue" value="'.$_language->module['new_show'].'"/>';
if(isset($_SESSION['day']) && isset($_SESSION['month']) && isset($_SESSION['year'])){
$cur = mktime(0,0,0,(int)$_SESSION['month'],(int)$_SESSION['day'],(int)$_SESSION['year']);
$days = getSelect('day',(int)$_SESSION['day']);
$months = getSelect('month',(int)$_SESSION['month']);
$years = getSelect('year',(int)$_SESSION['year']);
}
else{
$cur = mktime(0,0,0,date("m",time()),date("d",time()),date("Y",time()));
$days = getSelect('day');
$months = getSelect('month');
$years = getSelect('year');
}
$h_month=date("m",time());
$h_day = date("d",time());
$h_year = date("Y",time());
if(isset($_SESSION['stream'])){
$streams = getStreams($_SESSION['stream'],true);
}
else{
$streams = getStreams(null,true);
}
$previous_day = $cur-86400;
$previous_week = $cur-(86400*7);
$pw_day = date("d",$previous_week);
$pw_month = date("m",$previous_week);
$pw_year = date("Y",$previous_week);
$pd_day = date("d",$previous_day);
$pd_month = date("m",$previous_day);
$pd_year = date("Y",$previous_day);
$next_day = $cur+86400;
$next_week = $cur+(86400*7);
$nw_day = date("d",$next_week);
$nw_month = date("m",$next_week);
$nw_year = date("Y",$next_week);
$nd_day = date("d",$next_day);
$nd_month = date("m",$next_day);
$nd_year = date("Y",$next_day);
eval ("\$radio_head = \"".gettemplate("radio_head")."\";");
echo $radio_head;
for($i=0;$i<=0;$i++){
$x_time_s = $cur + ($i*86400);
$date = $x_time_s;
$x_time_e = $cur + (($i+1)*86400);
$date_end = $x_time_e;
$clear_datum=date("d.m.Y",$date);
$date_string = $_language->module['date'];
$date_string = str_replace(array('%day%','%date_f%'),array($_language->module['days'][date("w",$date)],$clear_datum),$date_string);
eval ("\$radio_head_day = \"".gettemplate("radio_head_day")."\";");
echo $radio_head_day;
$where_con = "";
if(isset($_SESSION['stream']) && $_SESSION['stream']!=0 ){
$where_con = ' AND streamID="'.(int)$_SESSION['stream'].'"';
}
$get=safe_query("SELECT *, ('".time()."' BETWEEN start_date AND end_date) as 'current' FROM ".PREFIX."radio_plan WHERE ((start_date<=".$date." && end_date>=".$date.") || (start_date>=".$date." && end_date<=".$date_end.") || (start_date<=".$date_end." && end_date>=".$date_end."))".$where_con." ORDER BY start_date ASC");
if(mysql_num_rows($get)){
eval ("\$radio_content_head = \"".gettemplate("radio_content_head")."\";");
echo $radio_content_head;
while($ds=mysql_fetch_array($get)){
if($ds['current'] == 1 && $ds['active'] == 1) {
$css_extra_class = "radio_current_show_active";
}
elseif($ds['current'] == 1){
$css_extra_class = "radio_current_show";
}
else{
$css_extra_class = '';
}
if(!empty($ds['image']) && file_exists('images/radio/'.$ds['image'])) $mod_img='images/radio/'.$ds['image'];
else $mod_img='images/avatars/'.getavatar($ds['dj']);
$nickname = getnickname($ds['dj']);
$start_day = date("d.m.Y",$ds['start_date']);
$start = date("H:i",$ds['start_date']);
if($start_day != date("d.m.Y",$date)) $start = $start_day." ".$start;
$end_day = date("d.m.Y",$ds['end_date']);
$end = date("H:i",$ds['end_date']);
if($end_day != date("d.m.Y",$date)) $end = $end_day." ".$end;
$name = $ds['show_name'];
$stream = getStreamName($ds['streamID']);
$adminaction = "";
$genre = getGenreName($ds['genre']);
$info = cleartext($ds['info']);
if(isradioadmin($userID) || ($userID == $ds['dj'] && $loggedin)){
if($ds['current'] == 1) {
if($ds['active']==1) $status_button = '<input type="button" class="button" onclick="MM_goToURL(\'parent\',\'index.php?site=streamingplan&deactivate='.$ds['showID'].'\');return document.MM_returnValue" value="'.$_language->module['deactivate'].'" />';
else $status_button = '<input type="button" class="button" onclick="MM_goToURL(\'parent\',\'index.php?site=streamingplan&activate='.$ds['showID'].'\');return document.MM_returnValue" value="'.$_language->module['activate'].'" />';
}
else{
$status_button = '';
}
$adminaction = '<tr>
<td></td>
<td><input type="button" onclick="MM_confirm(\''.$_language->module['really_delete'].'\',\'index.php?site=streamingplan&del='.$ds['showID'].'\');return document.MM_returnValue"value="'.$_language->module['delete'].'" /> <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=streamingplan&action=edit&showID='.$ds['showID'].'\');return document.MM_returnValue" value="'.$_language->module['edit'].'" /> '.$status_button.'</td>
</tr>';
}
eval ("\$radio_content = \"".gettemplate("radio_content")."\";");
echo $radio_content;
}
eval ("\$radio_content_foot = \"".gettemplate("radio_content_foot")."\";");
echo $radio_content_foot;
}
else{
echo $_language->module['no_entry'];
}
eval ("\$radio_foot_day = \"".gettemplate("radio_foot_day")."\";");
echo $radio_foot_day;
}
eval ("\$radio_foot = \"".gettemplate("radio_foot")."\";");
echo $radio_foot;
}
?>
...währe sehr dankbar wenn mir einer weiterhelfen könnte...
Gruß Paddy