Jump to content

Would this be Possible??


Recommended Posts

Does anyone know of a Script that is able to show a Picture of the DJ on air at a set time :confused:

 

on a PHP webpage i.e "if time 4pm then show dj.jpg"

 

ive found one script that looked promising but alas under testing it kept throwing up errors.

 

Any help would be apprieciated .... Thanks in advance!

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Does anyone know of a Script that is able to show a Picture of the DJ on air at a set time :confused:

 

on a PHP webpage i.e "if time 4pm then show dj.jpg"

 

ive found one script that looked promising but alas under testing it kept throwing up errors.

 

Any help would be apprieciated .... Thanks in advance!

 

Ive developed a few of these over the past year for radio stations. Could you upload the code and i'll check it out?

 

Might end up making a few scripts for users to download over the holidays if i get some demand from users. :yes:

Studiio - All-In-One Radio Communication Platform
SMS | Phone Calls | Social Media | Content

Link to comment
Share on other sites

$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-2;

// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h else if ($d == 1 && $h >= 4 && $h else if ($d == 1 && $h >= 8 && $h else if ($d == 1 && $h >= 12 && $h else if ($d == 1 && $h >= 13 && $h else if ($d == 1 && $h >= 15 && $h else if ($d == 1 && $h >= 19) $img = 'images/gary1.jpg';
else if ($d == 2 && $h 

 

Thats the Basic bit that copes with one day as far as i can see but i cant get it to show a Picture ..... :confused:

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Try This...

 

You just need to change the times and the images in 24 hour time.

 

date_default_timezone_set('Europe/London');
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year


//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.

// MON SCHEDULE
if ($d == 0 && $h >= 0 && $h else if ($d == 0 && $h >= 4 && $h else if ($d == 0 && $h >= 8 && $h else if ($d == 0 && $h >= 12 && $h else if ($d == 0 && $h >= 13 && $h else if ($d == 0 && $h >= 15 && $h else if ($d == 0 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 0 && $h  
// TUE SCHEDULE
if ($d == 1 && $h >= 0 && $h else if ($d == 1 && $h >= 4 && $h else if ($d == 1 && $h >= 8 && $h else if ($d == 1 && $h >= 12 && $h else if ($d == 1 && $h >= 13 && $h else if ($d == 1 && $h >= 15 && $h else if ($d == 1 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 1 && $h  
// WED SCHEDULE
if ($d == 2 && $h >= 0 && $h else if ($d == 2 && $h >= 4 && $h else if ($d == 2 && $h >= 8 && $h else if ($d == 2 && $h >= 12 && $h else if ($d == 2 && $h >= 13 && $h else if ($d == 2 && $h >= 15 && $h else if ($d == 2 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 2 && $h  
// THU SCHEDULE
if ($d == 3 && $h >= 0 && $h else if ($d == 3 && $h >= 4 && $h else if ($d == 3 && $h >= 8 && $h else if ($d == 3 && $h >= 12 && $h else if ($d == 3 && $h >= 13 && $h else if ($d == 3 && $h >= 15 && $h else if ($d == 3 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 3 && $h  
// FRI SCHEDULE
if ($d == 4 && $h >= 0 && $h else if ($d == 4 && $h >= 4 && $h else if ($d == 4 && $h >= 8 && $h else if ($d == 4 && $h >= 12 && $h else if ($d == 4 && $h >= 13 && $h else if ($d == 4 && $h >= 15 && $h else if ($d == 4 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 4 && $h  
// SAT SCHEDULE
if ($d == 5 && $h >= 0 && $h else if ($d == 5 && $h >= 4 && $h else if ($d == 5 && $h >= 8 && $h else if ($d == 5 && $h >= 12 && $h else if ($d == 5 && $h >= 13 && $h else if ($d == 5 && $h >= 15 && $h else if ($d == 5 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 5 && $h  
// SUN SCHEDULE
if ($d == 6 && $h >= 0 && $h else if ($d == 6 && $h >= 4 && $h else if ($d == 6 && $h >= 8 && $h else if ($d == 6 && $h >= 12 && $h else if ($d == 6 && $h >= 13 && $h else if ($d == 6 && $h >= 15 && $h else if ($d == 6 && $h >= 19) { $img = 'images/gary1.jpg'; }
else if ($d == 6 && $h echo $img;
?>

Studiio - All-In-One Radio Communication Platform
SMS | Phone Calls | Social Media | Content

Link to comment
Share on other sites

Now we are starting to get somewhere Its showing a line like this on the PHP page im testing on

 

http://baldyradio.com/livetest/time.php

 

Ive tried this $img = 'images/baldy1.jpg'; } and still no Pic showing up! im gonna hve another crack at it.

 

I really want it in 3hr sections.

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

I noticed in your image link you posted it is like this

 

images/baldy1.jpg

 

You need to use the PHP code James posted

 

$img = 'images/baldy1.jpg';

 

Also try the full URL

 

$img = 'http://baldyradio.com/images/baldy1.jpg';

 

Only a guess on my part I don't use the script.

"I'm Retired" Donations PayPal.Me/artistview . I only do dry reads, if you want FX's you'll have to add them, I might add them. If you use my voice please link to my art site AbstractArtist.xyz, Thank you
Link to comment
Share on other sites

Just tried using the URL and it kept throw parse errors at me

 

now ive switched all the $img = 'images/baldy1.jpg'; back to how they were and now its showing Nothing Im totally Lost!

 

Gonna take a Break and come back to this after doing a search on google see what i can find.

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Did you try something like this

 

{ $img = '"images/baldy1.jpg"'; }

 

couple of others

 

{ $img = '\"images/baldy1.jpg\"'; }

 

$img = '\"images/baldy1.jpg\"'; }

 

 

in PHP files (some times) if you add " you need to do it like this -> \"

"I'm Retired" Donations PayPal.Me/artistview . I only do dry reads, if you want FX's you'll have to add them, I might add them. If you use my voice please link to my art site AbstractArtist.xyz, Thank you
Link to comment
Share on other sites

Thanks Bill

 

Ive Tried all those variables and still nothing

 

googles proving to be as much use as a Chocolate teapot.

 

Im seriously Baffled as it was working now it isnt!

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Going to get my technical monkey to have a look into it maybe he will get something working. Im useless with PHP at the best of times!

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Technical monkeys managed to get it working YAY!!

 

I will show all the code after ive tested it for a few days .....

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Hi bud!

I haven't been on BW in awhile nor have I done work in PHP in a while, so I figured why not start now? Skills are a tad bit rusty but I tested (briefly) and this code will work.

 

date_default_timezone_set('GMT-5.00');
$Year = date('Y');
$Day = date('w');
$Hour = date('G');
// Edit the values in the array below. //
// The current values (E.g. 0-3) Show the hour increments //
$Sunday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
$Monday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
$Tuesday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
$wednesday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
$Thursday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
$Friday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
$Saturday = array('0-3','3-6','6-9','9-12','12-15','15-18','18-21','21-23');
// Do not edit below this line! //
$List;
if($Day == 0) { $List = $Sunday; }
else if($Day == 1) { $List = $Monday; }
else if($Day == 2) { $List = $Tuesday; }
else if($Day == 3) { $List = $Wednesday; }
else if($Day == 4) { $List = $Thursday; }
else if($Day == 5) { $List = $Friday; }
else if($Day == 6) { $List = $Saturday; }
list($Three,$Six,$Nine,$Twelve,$Fifteen,$Eighteen,$TwentyOne,$TwentyThree) = $List;
if(23 > $Hour) { if($Hour > 21) { $Image = $TwentyThree; }}
else if(21 >= $Hour){ if($Hour > 18){ $Image = $TwentyOne; }}
else if(18 >= $Hour){ if($Hour > 15){ $Image = $Eighteen; }}
else if(15 >= $Hour){ if($Hour > 12){ $Image = $Fifteen; }}
else if(12 >= $Hour){ if($Hour > 9){ $Image = $Twelve; }}
else if(9 >= $Hour){ if($Hour > 6){ $Image = $Nine; }}
else if(6 >= $Hour){ if($Hour > 3){ $Image = $Six; }}
else if(3 >= $Hour){ if($Hour > 0){ $Image = $Three; }}
echo "".$Image."";
?>

 

Any questions contact me!

Link to comment
Share on other sites

Hi the below script is what i used on my site, it's a javascript that will display an image at a set hour (or text, table, iframe, whatever) , if there is no image specified for the current hour it will display an alternative image (i.e off air)

 

here is a link to the javascript file

http://radiothree.net/wp-content/themes/radiothree/schedule.js

 

put this in the header of the page you want to put the image on:

 

 

 

put this code where you want the image to be displayed:

 

 

<br />
<br />
document.write(NowON());<br />
<br />




 Now On Air Requires Javascript

           

           

 

 

you can also see this used on the http://klubbfm.com website

 

 

sorry missed a bit: replace

with
Link to comment
Share on other sites

Hi Nick How the heck have you been, haven't seen you here in a long time :) Welcome back.

 

One question about the script, how do you link the images?

 

Thanks for the welcome! I guess I didn't explain my self well enough in the comments.

Each day has a list, and each list has the hours in increments of 3.

So if you wanted to show a image from 00:00-03:00, select the date and look for 0-3. Etc. Etc. Etc.

Link to comment
Share on other sites

Save the code as picture.php and Post this on The Page you need to use the Pictures on

 

require("picture.php"); ?>

 

 


date_default_timezone_set('Europe/London');
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year


//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.

// SUN SCHEDULE
if ($d == 0 && $h >= 0 && $h else if ($d == 0 && $h >= 4 && $h else if ($d == 0 && $h >= 8 && $h else if ($d == 0 && $h >= 12 && $h else if ($d == 0 && $h >= 13 && $h else if ($d == 0 && $h >= 15 && $h else if ($d == 0 && $h >= 19) { $img = 'images/baldy1.jpg'; }
else if ($d == 0 && $h  
// MON SCHEDULE
if ($d == 1 && $h >= 0 && $h else if ($d == 1 && $h >= 4 && $h else if ($d == 1 && $h >= 8 && $h else if ($d == 1 && $h >= 12 && $h else if ($d == 1 && $h >= 13 && $h else if ($d == 1 && $h >= 15 && $h else if ($d == 1 && $h >= 19) { $img = 'images/baldy1.jpg'; }
else if ($d == 1 && $h  
// TUES SCHEDULE
if ($d == 2 && $h >= 0 && $h else if ($d == 2 && $h >= 4 && $h else if ($d == 2 && $h >= 8 && $h else if ($d == 2 && $h >= 12 && $h else if ($d == 2 && $h >= 13 && $h else if ($d == 2 && $h >= 15 && $h else if ($d == 2 && $h >= 19) { $img = 'images/baldy1.jpg'; }
else if ($d == 2 && $h  
// WEDS SCHEDULE
if ($d == 3 && $h >= 0 && $h else if ($d == 3 && $h >= 4 && $h else if ($d == 3 && $h >= 8 && $h else if ($d == 3 && $h >= 12 && $h else if ($d == 3 && $h >= 13 && $h else if ($d == 3 && $h >= 15 && $h else if ($d == 3 && $h >= 19) { $img = 'images/baldy1.jpg'; }
else if ($d == 3 && $h  
// THURS SCHEDULE
if ($d == 4 && $h >= 0 && $h else if ($d == 4 && $h >= 4 && $h else if ($d == 4 && $h >= 8 && $h else if ($d == 4 && $h >= 12 && $h else if ($d == 4 && $h >= 13 && $h else if ($d == 4 && $h >= 15 && $h else if ($d == 4 && $h >= 20 && $h 
else if ($d == 4 && $h >= 22) { $img = 'images/baldy1.gif'; }
else if ($d == 4 && $h  
// FRI SCHEDULE
if ($d == 5 && $h >= 0 && $h else if ($d == 5 && $h >= 4 && $h else if ($d == 5 && $h >= 8 && $h else if ($d == 5 && $h >= 12 && $h 
else if ($d == 5 && $h >= 13 && $h 
else if ($d == 5 && $h >= 15 && $h else if ($d == 5 && $h >= 20 && $h 
else if ($d == 5 && $h >= 22) { $img = 'images/baldy1.jpg'; }
else if ($d == 5 && $h 

// SAT SCHEDULE
if ($d == 6 && $h >= 0 && $h else if ($d == 6 && $h >= 4 && $h else if ($d == 6 && $h >= 8 && $h else if ($d == 6 && $h >= 12 && $h else if ($d == 6 && $h >= 13 && $h else if ($d == 6 && $h >= 15 && $h else if ($d == 6 && $h >= 18 && $h else if ($d == 6 && $h >= 20 && $h 
else if ($d == 6 && $h >= 22) { $img = 'images/gary1.jpg'; }
else if ($d == 6 && $h 

echo ''.$img.'';

?>



Tested and working Thank you To everyone who Gave me a Nudge In the Right Direction

 

Just change the image links to suit Your website.:clap::thumbup:

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

  • 3 months later...

Hi guy thanks for the code but for some resin the the shows are not changing this is what i have

 

Quote:

<?php date_default_timezone_set('Europe/London');

$h = date('G'); //set variable $h to the hour of the day

$d = date('w'); //set variable $d to the day of the week.

$year = date('Y'); //set variable $year to the current year

 

 

//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.

 

// SUN SCHEDULE

if ($d == 0 && $h >= 0 && $h

else if ($d == 0 && $h >= 17 && $h

 

 

 

// MON SCHEDULE

if ($d == 1 && $h >= 0 && $h

else if ($d == 1 && $h >= 20 && $h

 

 

 

// TUES SCHEDULE

if ($d == 2 && $h >= 0 && $h

else if ($d == 2 && $h >= 0 && $h

 

 

 

// WEDS SCHEDULE

if ($d == 3 && $h >= 0 && $h

else if ($d == 3 && $h >= 12 && $h

else if ($d == 3 && $h >= 22 && $h

 

 

// THURS SCHEDULE

if ($d == 4 && $h >= 0 && $h

else if ($d == 4 && $h >= 20 && $h

else if ($d == 4 && $h >= 22 && $h

 

 

// FRI SCHEDULE

if ($d == 5 && $h >= 0 && $h

else if ($d == 5 && $h >= 20 && $h

 

 

 

 

// SAT SCHEDULE

if ($d == 6 && $h >= 0 && $h

else if ($d == 6 && $h >= 0 && $h

 

 

?>

can u help me out ?? i do not know why they are not changeing thanks

 

o and sorry about the long page of text im new at this broadcastingworld website :P

Link to comment
Share on other sites

Only works with 24 hour format so 3pm in the afternoon would be 15 and the 6pm would be 18 etc ...... and the 24 should be 00.

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my most FAVOURITE piece of software EVER

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...