En nu we toch bezig zijn met verbouwen heb ik er nog 1.
Eerst een plaatje..

Overal komt keurig het hoesje te staan behalve bij de plaat die staat te wachten.
In dit geval
Tatjana - Feel Good
En die krijg ik er met geen mogelijkheid bijgezet.
Ook wil ik de plaat die staat te wachten op dezelfde manier in beeld krijgen als de rest.
Dus eigenlijk op deze manier.
Tatjana
Feel Good
Hier het hele script playing.php
Code: Selecteer alles
<?
require("config.php");
$db->open("SELECT songlist.*, historylist.listeners as listeners, historylist.requestID as requestID, historylist.date_played as starttime FROM historylist,songlist WHERE (historylist.songID = songlist.ID) AND (songlist.songtype='S') ORDER BY historylist.date_played DESC",6);
$history = $db->rows();
reset($history);
$db->open("SELECT songlist.*, queuelist.requestID as requestID FROM queuelist, songlist WHERE (queuelist.songID = songlist.ID) AND (songlist.songtype='S') AND (songlist.artist <> '') ORDER BY queuelist.sortID ASC",1);
$queue = $db->rows();
reset($queue);
//### Calculate the bezt time to refresh the webpage in order to show new updated song information
//==================================================================================================
list($key, $song) = each($history);
$listeners = $song["listeners"];
$starttime = strtotime($song["date_played"]);
$curtime = time();
$timeleft = $starttime+round($song["duration"]/1000)-$curtime;
//Set refesh interval
if($timeleft>0) # 30 second minimum wait
{ $timeout = $timeleft;} # if timeleft is valid, refresh on timeleft (should be end of song)
else
{ $timeout = 90; } # otherwise, fall back on 90 second refresh
if(($timeout>180) or ($timeout==0)) $timeout = 180;
if($timeout<30) $timeout = 30;
$refreshURL = "playing.php?buster=".date('dhis').rand(1,1000);
//==================================================================================================
$pic_cnt = 0;
function PicName()
{
global $pic_cnt;
echo "Picture".$pic_cnt;
}
function NextPicName()
{
global $pic_cnt;
$pic_cnt += 1;
PicName();
}
function PutSongRow(&$song)
{
global $rc, $showpic, $darkrow, $lightrow;
PrepareSong($song);
$rc++;
$bgcolor = $darkrow;
if(($rc % 2)==0) $bgcolor = $lightrow;
?>
<tr bgcolor="<? echo $bgcolor; ?>">
<?if($showpic){?>
<td valign="middle" width="1%">
<? if($song["haspicture"]) {?>
<img id="<? NextPicName(); ?>" onError="PictureFail('<? PicName(); ?>')" width="60" height="60" src="<? echo $song["picture"]; ?>" alt="Buy CD!" border=0></a>
<?};?>
</td>
<?}?>
<td <?if(!$showpic) echo "colspan=2"?>><b><font face="arial" size="3" color="#000000"><small> <?
echo $song["artist"];
if($song["requestid"]!=0) { echo " ~Verzoekje~ "; }
?></small></font></b><br>
<b><font face="arial" size="3" color="#FF000E"><small> <?
echo $song["title"];?></small></font></b>
</td>
<td nowrap>
<p align="right"><font color="#003366" size="2"><small><strong><? echo $song["mmss"]; ?> </strong></small></font>
</td>
</tr>
<?
}//PutSongRow
/* ## ===================================================================== ## */
?>
<? require("header.php"); ?>
<SCRIPT LANGUAGE="JavaScript">
<!---
var refreshID = "";
refreshID = setTimeout("DoRefresh()", <? echo ($timeout*1000); ?>);
function DoRefresh()
{
document.location.href = '<? echo $refreshURL; ?>';
}
//--->
</SCRIPT>
<table border="0" width="98%" cellspacing="0" cellpadding="1">
<tr bgcolor="#002E5B">
<td colspan="2" nowrap align="left">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"> <b>Nu te horen</b></font>
</td>
<td nowrap align="Right">
<p><font face="Arial" size="2" color="#FFFFFF"><b>Tijd</b> </font>
</td>
</tr>
<?
$rc=0;
PutSongRow($song);
$mainsong = $song;
?>
<?
if(count($queue)>0){?>
<tr bgcolor="<? echo $lightrow; ?>"><td colspan="7">
<b><font face="Verdana" size="1"color="#000144">Zodadelijk over</font>
<?
$secsRemain = (round($song["duration"] / 1000)-($curtime-$starttime));
?>
<b><font size="1"color="#000000"></b>
<a id="countDownText">:</a>
<script language="JavaScript">
var countDownInterval = <? echo $secsRemain; ?>;
var countDownTime = countDownInterval + 1;
if (document.all||document.getElementById)
countDown();
else
window.onload = countDown;
function countDown() {
countDownTime--;
if (countDownTime == 0) {
countDownTime = countDownInterval;
window.location.reload();
return;
}
else if (countDownTime < 0)
countDownTime = 30;
if (document.all)
document.all.countDownText.innerText = secsToMins(countDownTime);
else if (document.getElementById)
document.getElementById("countDownText").innerHTML = secsToMins(countDownTime);
counter = setTimeout("countDown()", 1000);
}
function secsToMins(theValue) {
var theMin = Math.floor(theValue / 60);
var theSec = (theValue % 60);
if (theSec < 10)
theSec = "0" + theSec;
return(theMin + " minuten en " + theSec);
}
</script>
<a font size="1"color="#000144">seconden</font></a>
<br></b>
<font face="Arial" size="2" color="FF000E"><b>
<?
$i=0;
while(list($key, $song) = each($queue))
{
if(empty($song["artist"]))
$song["artist"] = 'Unknown';
if($i>0) echo ", ";
echo $song["artist"];
echo " - ";
echo $song["title"];
if($song["requestid"]!=0)
{ echo " ~Verzoekje~"; }
$i++;
}
?>
</b></font></td></tr>
<?}?>
<tr bgcolor="#002E5B">
<td colspan="7" nowrap>
<p align="left"><b> <font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Recentelijk gedraaid</font></b>
</td>
</tr>
<font size="2">
<?
$rc=0;
while(list($key, $song) = each($history))
PutSongRow($song);
?>
</table>
<table border="0">
<form name="count">
<input type="text" size="99" name="count2">
</form>
<script>
var before="2009"
var current="Gelukkig Nieuwjaar!"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value=" Nog "+dday+ " dagen, "+dhour+" uren, "+dmin+" minuten, and "+dsec+" seconden tot "+before
setTimeout("countdown(theyear,themonth,theday)",1000)
}
//enter the count down date using the format year/month/day
countdown(2009,1,1)
</script>
</table>
</td><td valign='top' align='center'>
<?
####################
# Request Dedication
require("dedication.php");
#===================
?>
<?
####################
# BuyCD image
if($mainsong["haspicture"])
require("buycd.php");
#===================
?>
<?
##################
# SBFN Schijf van de week
require("hit.php");
#===================
?>
</td>