Jump to content

Tara A.

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Tara A.'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 7 * 24 * 60 is: 7 days, 24 hours, 60 minutes. It rotates the text it holds in the array every [time] (depends on what it set) it would need to be. So every 7 days. What does (time()+3*24*3600) refer to? Is this in reference to the "starting position" so to speak. Because what's to stop it from giving the first name in the array every time it's loaded up, it must have a starting point against which it is referencing the current week/date. I'm assyming that's what this snippet of code does. Am I wrong? 24 is number of hours in a day 3600 is number of seconds in an hour what is the 3 there for? time() is the current time correct? so current time * 3 * 24 * 3600...
  2. Actually I have a question - just trying to understand this. echo $staff[((time()+3*24*3600)/(7*24*3600)) % count($staff)]; so this returns the array value (1,2 or 3) for staff thus returning/echo the appropriate name. I guess my question lies in this part lol: ((time()+3*24*3600)/(7*24*3600)) % count($staff) What I can see is it's something divided by number of seconds in a week mod 3 (or however many elements are in the array). What do the components of (time()+3*24*3600) mean? And how does it work overall, I'm sorry I'm not getting this, I just really want to get better at this sort of thing. It's amazing what can be done!
  3. Well guys, I can't express my gratitute for your help. This is awesome and looks great on the site! One problem though, I'm somewhat depressed at how staggeringly good you guys are at this. Please tell me you guys code PHP daily and have been doing it for a decade. Please lol
  4. I would love that! lol, but with only 1 post on these forums so far I would feel out of line asking for that I'm not sure what you mean by it being the same day every month. It basically cycles right through the month so 1st week of august it's Tara, 2nd Tom, 3rd Brenda, 4th Tara then first week of September it would be Tom. I hope I answered your questions/made sense. I'm heading home right now but I'm going to try to wrap my head around this tomorrow at work, thanks so much! I hope I don't turn out to be impossibly dense.
  5. Hi Guys, I'm new to PHP. I've gone through a few tutorials and I'm not sure how to go about the following: For work, every week 1 of 3 people is responsible for checking some bug report. This week I have to do this. Next week it's Tom the week after that is Brenda. Then it's back to me again and it cycles. We currently have a white board calendar at the back of the office that gets updated with the name of the person responsible for doing the checks that week. What I'm trying to do is write a small PHP snippet that will show on our internal site something like: Bug Checker this week is: TARA Then the next week it'll show Tom, then Brenda. And cycle back. That way we don't have to keep updating that board. Does anybody know the best way to go about this. I keep thinking of different ideas but they all seem pretty convoluted and I'm fairly certain there's got to be a very easy way to do it; it's just not coming to me. Any help would be appreciated Thanks so much! XXX Tara EDIT: We cycle through every Monday. If that helps. I considered creating a database file with the date and the person and just read that in but that is so embarassingly inefficient that I didn't even want to mention this in the post.
×
×
  • 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.