Radionomy Board
It is currently Thu Sep 19, 2019 12:50 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jan 16, 2015 6:57 am 
Offline

Joined: Mon Dec 29, 2014 11:33 am
Posts: 143
Radio 1: http://listen.radionomy.com/shineonradio
Radio 2: http://listen.radionomy.com/gratefuledradio
O.S: MacOS 10.7
Does anybody use this tracklist script on your website?
-----------------------
<?php
// All settings now in call_api.php, download from http://forum.radionomy.com/
// Script by Jamie Welch (techlover)

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="style-playlist.css" type="text/css" />
</head>
<body><tr><td><div id="playlist">
<div style="text-align: top; vertical-align: top; line-height: 220%; background-image: url(); border-right-style: dashed; border-right-color: #ffffff; border-right-width: 0px; color: #333333; font-size: 16px; font-family: Arial; padding-left:8px; padding-right:8px; margin-top:2px;">
<?php
$xml = @simplexml_load_file("http://www.tonix.si/call_api.php");
if($xml){
echo '<table>';
foreach ($xml->track as $value){
print "<tr><td><td valign=top><b>".$value->artists."</b> - ";
print $value->title."</td></tr>";
}
echo '</table>';
}
else{
echo 'Error with the call_api.php!';
}
?>
</div>
</div>
</div>
<script>

//refresh time is in "minutes:seconds"
var timer="0:15"

if (document.images){
var CoffeeParse=timer.split(":")
CoffeeParse=CoffeeParse[0]*60+CoffeeParse[1]*1
}
function refreshtime(){
if (!document.images)
return
if (CoffeeParse==1)
window.location.reload()
else{
CoffeeParse-=1
currentminutes=Math.floor(CoffeeParse/60)
currentsec=CoffeeParse%60
if (currentminutes!=0)
currenttime=currentminutes+" minuten en "+currentsec+" seconden tot de volgende verversing!"
else
currenttime=currentsec+" seconden tot de volgende verversing!"
window.status=currenttime
setTimeout("refreshtime()",5000)
}
}

window.onload=refreshtime
//-->
</script>
</body>
</html>
------------------------------------------
It works for me, but refreshes whole website, not only track list. What was your solution?


Top
 Profile Send private message  
 
PostPosted: Fri Jan 16, 2015 10:00 pm 
Offline
User avatar

Joined: Mon Dec 01, 2014 6:40 am
Posts: 16
Radio 1: http://peacefulcurrentsradio.com/listen.m3u
O.S: Windows Seven 64 Bits
I don't really consider myself any kind of code "expert," but I've learned enough from my own experiences to get by.

Try putting the webpage containing your track list code inside an iframe elsewhere on your site, like this:

Code:
<iframe>
the website address of the page containing your tracklist script here
</iframe>


The effect is like having a website inside a website. When the information refreshes, only the information inside the iframe "window" refreshes rather than the entire website. You can also set the width and height of the iframe "window" in pixels, and even dictate whether the window shows scrollbars or not. More information on setting the iframe tag including all it's attributes is here: http://www.w3schools.com/tags/tag_iframe.asp

We use iframe tags on our website for our "Now Playing," song history and request services. You can see that in practice at http://kccaferadio.com.

Hope that helps,
John


Top
 Profile Send private message  
 
PostPosted: Sat Jan 17, 2015 8:33 am 
Offline

Joined: Mon Dec 29, 2014 11:33 am
Posts: 143
Radio 1: http://listen.radionomy.com/shineonradio
Radio 2: http://listen.radionomy.com/gratefuledradio
O.S: MacOS 10.7
Thank you very much for your answer, works now. I have 2 more questions: on your site refreshes are not fade-in and fade-out visible like on my site: www.over-nite-radio.net, where all refreshes are visible. Second: I would like to have every song wtriiten in one line now all songs are one line. What should I change?


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group