www.webdeveloper.com
Results 1 to 5 of 5

Thread: Display div box depending on server day & time

  1. #1
    Join Date
    Jan 2010
    Posts
    57

    Display div box depending on server day & time

    Basically Im developing an online radio website on wordpress.
    We have a schedule of DJ's that have bi-hourly slots between 2pm and 3am, then its just re-runs of old shows between 3am - 2pm.

    A nice feature would be to display, lets say in the header or somewhere else, a small image of the DJ, along with a little bit of information of the show during his slot.

    As we get listeners from all over the world, we will need to get the time from the server but the server is based in the US, while we are based in the UK but I know a few extra lines will overcome this obstacle.

    The biggest problem is that I have 0 knowledge of PHP (hence why im using wordpress to develop this site) so I will be willing to pay $15 for someone to simply write me the code aswell as the best way to implement it ie. in hidden div boxes or whatnot.

    If you're up for it, get at me on here or on my email stylishjm[at]hotmail[dot]com
    Last edited by stylishjm; 02-07-2011 at 04:26 PM.

  2. #2
    Join Date
    Jan 2010
    Posts
    57
    Anyone? Ill up the pay to $25

  3. #3
    Join Date
    Mar 2010
    Posts
    672
    You can simply use strtotime(), which will pull its time from the current time on the server. From there its as easy as knowing how far off your servers time is from your time zone and then compensating for it:
    strtotime("+3 hours");

    If your time zone is 3 hours ahead, that'll give the correct time. Now, that will output the correct time, but in unix epoch timestamp format, to format it how you want you can simply pass it through date(), using whatever parameters give the needed output:
    http://php.net/manual/en/function.date.php

    As for how to implement it, unless you have some specific reason to, i wouldn't use hidden divs. You can simply have code that conditionally outputs the div contents itself, assuming you're not doing some sort of page caching. Though this type of thing can be hard coded, it would be best if you did it through a database implementation.

  4. #4
    Join Date
    Jan 2010
    Posts
    57
    Thanks. But still I have no idea on how to do this as I have little experience with coding, which is why Im willing to pay to get it done for me.

  5. #5
    Join Date
    Mar 2013
    Posts
    1
    I would recommend tweaky.com to get quick additions like this to your Wordpress site. You can set a small scope for a project and a developer there will charge in $39 increments to complete the task. (Something like this I am thinking would only be the minimum $39) This has been a lifesaver for me on a few coding issues like this that are over my head.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles