...

View Full Version : dj next on air



bobbyw
09-10-2011, 01:36 PM
I have seen a scipit for a news html scipt but i am trying to change it so i can add the times ect on it can anyone help me plz here is the scipit
I hope u understand what i am trying to say



Philip M done this one but i want to make it who is on next ect

<html>
<head>
<title>Time Display</title>

<script type="text/javascript">

function DisplayTIME() {

var currentTime = new Date();
var dayname = currentTime.getDay()
var hours = currentTime.getHours();

var nd = new Date();
nd = nd.getTimezoneOffset();
var offset = Math.floor(nd / 60);
var nextTime = (hours + offset) % 24 +1;
if (nextTime < 10) {nextTime = "0" + nextTime}
var message = "Our next live news bulletin on The Mix Radio is at ";
if (offset == 0) {
message += nextTime + ':00 GMT'
}
else {
message += nextTime + ':00 Local Time '
}
document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
}

</script>
</head>

<body onload = "DisplayTIME()">

<div id="yourdivid">Message about TMR News schedule</div>

</body>
</html>

jmrker
09-10-2011, 10:45 PM
So what are the times you are trying to add
and how do you wish to display them?

If you cannot do the JS, then at least layout the HTML
so we can see where you are trying to go.

BTW: You should enclose you script between [ code] and [ /code] tags (without the spaces)
to make it more easily readable for the forum members.

bobbyw
01-16-2012, 12:45 PM
on the home page we just want to see a dj who is next on it with there photo and time ect that is base

like this

if i am next my name will be show and my photo and time

if someone start a scipit off im can change it also sorrry for the delay to get bk to u

Philip M
01-16-2012, 01:13 PM
What's a scipit? :rolleyes:

bobbyw
01-16-2012, 05:02 PM
<html>
<head>
<title>Time Display</title>

<script type="text/javascript">

function DisplayTIME() {

var currentTime = new Date();
var dayname = currentTime.getDay()
var hours = currentTime.getHours();

var nd = new Date();
nd = nd.getTimezoneOffset();
var offset = Math.floor(nd / 60);
var nextTime = (hours + offset) % 24 +1;
if (nextTime < 10) {nextTime = "0" + nextTime}
var message = "Our next live news bulletin on The Mix Radio is at ";
if (offset == 0) {
message += nextTime + ':00 GMT'
}
else {
message += nextTime + ':00 Local Time '
}
document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
}

</script>
</head>

<body onload = "DisplayTIME()">

<div id="yourdivid">Message about TMR News schedule</div>

</body>
</html>

bobbyw
01-16-2012, 05:03 PM
anyone can do a start for me please and im can add from there

Philip M
01-16-2012, 05:36 PM
Please pay attention to post #2. People will be reluctant to assist you if you seem to ignore advice.

vwphillips
01-16-2012, 06:14 PM
<html>
<head>
<title>Time Display</title>

<script type="text/javascript">
var DJ=[]
DJ[0]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[1]=[[16,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[18,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[2]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[3]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[4]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[5]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[6]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday

function DisplayTIME() {
var currentTime = new Date();
var dayname = currentTime.getDay()
var hours = currentTime.getHours(),message ='';

var nd = new Date();
nd = nd.getTimezoneOffset();
var offset = Math.floor(nd / 60);
nd=new Date(currentTime.getFullYear(),currentTime.getMonth(),currentTime.getDate(),(hours + offset));
hours = nd.getHours();
var ary=DJ[nd.getDay()];
for (var z0=0;z0<ary.length;z0++){
if (ary[z0][0]>hours){
message=ary[z0][1]+'<img src="'+ary[z0][2]+'" />';
break;
}
}
document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
}

</script>
</head>

<body onload = "DisplayTIME()">
<div id="yourdivid">Message about TMR News schedule</div>


</body>
</html>

bobbyw
01-20-2012, 12:55 PM
im tested ur html code out and all i see is a bink page

vwphillips
01-20-2012, 02:03 PM
you will need to change the start time for each DJ(marked in red)


<html>
<head>
<title>Time Display</title>

<script type="text/javascript">
var DJ=[]
DJ[0]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[1]=[[16,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[18,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[2]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[3]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[4]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[5]=[[14,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[23,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
DJ[6]=[[14,'tomjones1','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[23,'cliff1','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday

function DisplayTIME() {
var currentTime = new Date();
var dayname = currentTime.getDay()
var hours = currentTime.getHours(),message ='';

var nd = new Date();
nd = nd.getTimezoneOffset();
var offset = Math.floor(nd / 60);
nd=new Date(currentTime.getFullYear(),currentTime.getMonth(),currentTime.getDate(),(hours + offset));
hours = nd.getHours();
var ary=DJ[nd.getDay()];
for (var z0=0;z0<ary.length*2;z0++){
if (ary[z0%6][0]>hours){
message=ary[z0][1]+'<img src="'+ary[z0][2]+'" />';
break;
}
}
document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
}

</script>
</head>

<body onload = "DisplayTIME()">
<div id="yourdivid">Message about TMR News schedule</div>


</body>
</html>

jmrker
01-20-2012, 05:20 PM
This is my take on the problem. :D
Modify the arrays for the times and names to display at any particular hour of the day.


<html>
<head>
<title>Time Display</title>

<script type="text/javascript">

function DisplayTIME() {
var currentTime = new Date();
var dayname = currentTime.getDay()
var hours = currentTime.getHours();

var nd = new Date();
nd = nd.getTimezoneOffset();
var offset = Math.floor(nd / 60);
var nextTime = (hours + offset) % 24 +1;
if (nextTime < 10) { nextTime = "0" + nextTime; }
var message = "Our next live news bulletin on The Mix Radio is at ";
if (offset == 0) {
message += nextTime + ':00 GMT';
} else {
message += nextTime + ':00 Local Time ';
}
document.getElementById('yourdivid').innerHTML = '<p>'+message;
document.getElementById('currentDJ').innerHTML = CurrentDJ(hours);
}
var baseURL = 'http://www.nova.edu/hpd/otm/pics/4fun/';
var imgNoDJ = 'http://www.vicsjavascripts.org.uk/StdImages/frogs.jpg';
var imgList = ['','','','','','','','','11.jpg', // midnight to 8am
'11.jpg','12.jpg','12.jpg','13.jpg', // 9am to noon
'13.jpg','14.jpg','14.jpg','15.jpg', // 1pm to 4pm
'15.jpg','21.jpg','21.jpg','22.jpg', // 5pm to 8pm
'22.jpg','23.jpg','23.jpg','', // 9pm to midnight
];
var DJList = ['','','','','','','','','John', // midnight to 8am
'John','Jacob','Jacob','Jingle-Heimer', // 9am to noon
'Jingle-Heimer','Smith','Smith','Mary', // 1pm to 4pm
'Mary','Susan','Susan','Ophelia', // 5pm to 8pm
'Ophelia','Wolfman','Wolfman','', // 9pm to midnight
];
function CurrentDJ(hrs) {
var tmp = imgList[hrs];
var msg = '';
if (tmp == '') { tmp = imgNoDJ;
msg = '<p>Currently we are Off-Air'; }
else { tmp = baseURL+imgList[hrs];
msg = '<p>Currently On-Air is: '+DJList[hrs]; }
document.getElementById('DJpicture').src = tmp;
return msg;
}
</script>
</head>

<body onload = "DisplayTIME()">

<div id="yourdivid">Message about TMR News schedule</div>
<div id="currentDJ">Off Air</div>
<img id="DJpicture" src="">
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum