Jump to content

krishh33

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by krishh33

  1. Hi, thanks for this. Im actually completely new to php. Would you mind telling me where id place this code so that it works with the website? Just how css needs to be linked to the html by the text in the head, how do i link the php if it is to be linked?
  2. Its still early days to know how many images are going to be displayed in a day. Plus, they may vary from 10 a day to even 40. The images would need to change every 15 minutes and as for the images themselves, about 5 or so would stay the same and stay on the website all the time according to certain times in the day.The rest of the images are going to be given to me from different people to place on the website.
  3. I found some php code which relates exactly to what i need doing on my website. I don't think its finished but most of it is apparently done. Could anyone edit it to my needs and explain how I can execute it so that it can change a particular image on the page? What I need doing is for an image on the page to be changed according to certain times in the day, the code below only uses hours and not minutes, I also need minutes. <?php $h = date('G'); //set variable $h to the hour of the day. $m = date('i'); //set variable $m to the min of the hour. $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. // MONDAY SCHEDULE if ($d == 1 && $h >= 0 && $h < 4) $img = 'image.jpg'; else if ($d == 1 && $h >= 4 && $h < 8 ) $img = 'image.jpg'; else if ($d == 1 && $h >= 8 && $h < 12) $img = 'image.jpg'; else if ($d == 1 && $h >= 12 && $h < 13) $img = 'image.jpg'; else if ($d == 1 && $h >= 13 && $h < 15) $img = 'image.jpg'; else if ($d == 1 && $h >= 15 && $h < 19) $img = 'image'; else if ($d == 1 && $h >= 19) $img = 'image.jpg'; else if ($d == 2 && $h < 0) $img = 'image.jpg'; // TUESDAY SCHEDULE if ($d == 2 && $h >= 0 && $h < 4) $img = 'image.jpg'; else if ($d == 2 && $h >= 4 && $h < 8 ) $img = 'image.jpg'; else if ($d == 2 && $h >= 8 && $h < 12) $img = 'image.jpg'; else if ($d == 2 && $h >= 12 && $h < 13) $img = 'image.jpg'; else if ($d == 2 && $h >= 13 && $h < 15) $img = 'image.jpg'; else if ($d == 2 && $h >= 15 && $h < 17) $img = 'image.jpg'; else if ($d == 2 && $h >= 17 && $h < 20) $img = 'image.jpg'; else if ($d == 2 && $h >= 20) $img = 'image.jpg'; else if ($d == 3 && $h < 0) $img = 'image.jpg'; // WEDNESDAY SCHEDULE if ($d == 3 && $h >= 0 && $h < 4) $img = 'image.jpg'; else if ($d == 3 && $h >= 4 && $h < 8 ) $img = 'image.jpg'; else if ($d == 3 && $h >= 8 && $h < 12) $img = 'image.jpg'; else if ($d == 3 && $h >= 12 && $h < 13) $img = 'image.jpg'; else if ($d == 3 && $h >= 13 && $h < 15) $img = 'image.jpg'; else if ($d == 3 && $h >= 15 && $h < 19) $img = 'image.jpg'; else if ($d == 3 && $h >= 19) $img = 'image.jpg'; else if ($d == 4 && $h < 0) $img = 'image.jpg'; // THURSDAY SCHEDULE if ($d == 4 && $h >= 0 && $h < 4) $img = 'image.jpg'; else if ($d == 4 && $h >= 4 && $h < 8 ) $img = 'image.jpg'; else if ($d == 4 && $h >= 8 && $h < 12) $img = 'image.jpg'; else if ($d == 4 && $h >= 12 && $h < 13) $img = 'image.jpg'; else if ($d == 4 && $h >= 13 && $h < 15) $img = 'image.jpg'; else if ($d == 4 && $h >= 15 && $h < 19) $img = 'image.jpg'; else if ($d == 4 && $h >= 19) $img = 'image.jpg'; else if ($d == 5 && $h < 0) $img = 'image.jpg'; // FRIDAY SCHEDULE if ($d == 5 && $h >= 0 && $h < 4) $img = 'image.jpg'; else if ($d == 5 && $h >= 4 && $h < 8 ) $img = 'image.jpg'; else if ($d == 5 && $h >= 8 && $h < 10) $img = 'image.jpg'; else if ($d == 5 && $h >= 10 && $h < 12) $img = 'image.jpg'; else if ($d == 5 && $h >= 12 && $h < 13) $img = 'image.jpg'; else if ($d == 5 && $h >= 13 && $h < 15) $img = 'image.jpg'; else if ($d == 5 && $h >= 15 && $h < 18) $img = 'image.jpg'; else if ($d == 5 && $h >= 18 && $h < 20) $img ='image.jpg'; else if ($d == 5 && $h >= 20 && $h < 22) $img = 'image.jpg'; else if ($d == 5 && $h >= 22) $img = 'image.jpg'; else if ($d == 6 && $h < 0) $img = 'image.jpg'; // SATURDAY SCHEDULE else if ($d == 6 && $h >= 4 && $h < 6) $img = 'image.jpg'; else if ($d == 6 && $h >= 6 && $h < 7) $img = 'image.jpg'; else if ($d == 6 && $h >= 7 && $h < 7) $img = 'image.jpg'; else if ($d == 6 && $h >= 7 && $h < 7) $img = 'image.jpg'; else if ($d == 6 && $h >= 7 && $h < 9) $img = 'image.jpg'; else if ($d == 6 && $h >= 9 && $h < 11) $img = 'image.jpg'; else if ($d == 6 && $h >= 11 && $h < 13) $img = 'image.jpg'; else if ($d == 6 && $h >= 13 && $h < 14) $img = 'image.jpg'; else if ($d == 6 && $h >= 14 && $h < 17) $img = 'image.jpg'; else if ($d == 6 && $h >= 17 && $h < 23) { $img = 'image.jpg'; $locutor = 'Byron'; $hora = '5:00 PM - 11:00 PM'; $text = 'ELECTRONIC MUSIC RADIO SHOW'; if(mb_strlen($text)>13) { $text=mb_substr($text, 0, 13); $text.='...'; } } else if ($d == 6 && $h >= 23) $img = 'image.jpg'; else if ($d == 0 && $h < 0) $img = 'image.jpg'; // SATURDAY SCHEDULE else if ($d == 0 && $h >= 0 && $h < 2) $img = 'image.jpg'; else if ($d == 0 && $h >= 2 && $h < 4) $img = 'image.jpg'; else if ($d == 0 && $h >= 4 && $h < 5) $img = 'image.jpg'; else if ($d == 0 && $h >= 5 && $h < 6) $img = 'image.jpg'; else if ($d == 0 && $h >= 6 && $h < 8 ) $img = 'image.jpg'; else if ($d == 0 && $h >= 8 && $h < 9) $img = 'image.jpg'; else if ($d == 0 && $h >= 9 && $h < 10) $img = 'image.jpg'; else if ($d == 0 && $h >= 10 && $h < 11) $img = 'image.jpg'; else if ($d == 0 && $h >= 11 && $h < 12) $img = 'image.jpg'; else if ($d == 0 && $h >= 12 && $h < 16) $img = 'image.jpg'; else if ($d == 0 && $h >= 16 && $h < 17) $img = 'image.jpg'; else if ($d == 0 && $h >= 17 && $h < 18) $img = 'image.jpg'; else if ($d == 0 && $h >= 18 && $h < 19) $img = 'image.jpg'; else if ($d == 0 && $h >= 19 && $h < 21) $img = 'image.jpg'; else if ($d == 0 && $h >= 21) $img = 'image.jpg'; else if ($d == 1 && $h < 0) $img = 'image.jpg'; echo'<div style="float: left; width: 90px"><img src="'.$img.'" height="80px" width="80px" " /></div><div style="float: left; width: 141px; height: 80px; margin-top: 10px; color: #FFFFFF; font-family: Tahoma; font-size: 15px;">'.$text.' <br \>'.$hora.'<br \> Con: '.$locutor.'</div>'; The person who wrote this was using some spanish words at the bottom like "hora" and "locutor". Im not to familiar with php and so if that needs replacing then please replace it with the correct version.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.