Jump to content


Photo

Total noob help please......


  • Please log in to reply
6 replies to this topic

#1 tj.baker

tj.baker
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2006 - 05:00 AM

I'm not even entirely sure I need to use PHP exclusivly for what I want to accomplish.

All I want to do is have a seven day list with hours of operation, and have the current day be highlighted.

This sounds fairly simple to me to accomplish..... I just have no idea where to start!

I don't necessarily wish for anyone to completly write the code to do this.... I would at least like to be pointed in the right direction for this particular task (I know I need to get to the php newbies tutorials, and I will!  :))...........I would just like to get this one thing accomplished in a fairly quick timeframe.

Thanks for any input........

peace,

tj

#2 vbnullchar

vbnullchar
  • Members
  • PipPipPip
  • Advanced Member
  • 428 posts
  • LocationPasig City, Philippines

Posted 29 September 2006 - 06:18 AM

what is it?
Registered Linux User #399942
Ubuntu User #14134
--
my blog

#3 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 29 September 2006 - 06:32 AM

Create an array from Sunday to Saturday.
Outut them in as a list (going through each day element)
If the day element is today (i.e. date("l")) then highlight that list.




#4 chris9902

chris9902
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationUK

Posted 29 September 2006 - 10:59 AM

it's not the best way but this should work (i think)

<table>
  <tr>
    <td <?php if (date("D") == "Mon") echo('class="highlight"')?>>Monday</td>
    <td <?php if (date("D") == "Tue") echo('class="highlight"')?>>Tuesday</td>
    <td <?php if (date("D") == "Wed") echo('class="highlight"')?>>Wednesday</td>
    <td <?php if (date("D") == "Thu") echo('class="highlight"')?>>Thursday</td>
    <td <?php if (date("D") == "Fri") echo('class="highlight"')?>>Friday</td>
    <td <?php if (date("D") == "Sat") echo('class="highlight"')?>>Saturday</td>
    <td <?php if (date("D") == "Sun") echo('class="highlight"')?>>Sunday</td>
  </tr>
</table>

it will add a class "highlight" to the <td> of the current day.

#5 tj.baker

tj.baker
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2006 - 05:32 PM

what is it?


Mon  8:00am-3:00pm
Tue  8:00am-3:00pm
Wed  8:00am-4:00pm
Thu    9:00am-4:00pm
Fri      9:00am-2:00pm

All of that in a table, with the current day highlighted.

Thanks for the input!!!

peace,

tj

#6 tj.baker

tj.baker
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2006 - 05:37 PM

it's not the best way but this should work (i think)

<table>
  <tr>
    <td <?php if (date("D") == "Mon") echo('class="highlight"')?>>Monday</td>
    <td <?php if (date("D") == "Tue") echo('class="highlight"')?>>Tuesday</td>
    <td <?php if (date("D") == "Wed") echo('class="highlight"')?>>Wednesday</td>
    <td <?php if (date("D") == "Thu") echo('class="highlight"')?>>Thursday</td>
    <td <?php if (date("D") == "Fri") echo('class="highlight"')?>>Friday</td>
    <td <?php if (date("D") == "Sat") echo('class="highlight"')?>>Saturday</td>
    <td <?php if (date("D") == "Sun") echo('class="highlight"')?>>Sunday</td>
  </tr>
</table>

it will add a class "highlight" to the <td> of the current day.


Imma give that one a try!  :)

Thank you very much!!!

peace,

tj

#7 True`Logic

True`Logic
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 29 September 2006 - 06:31 PM

have all the dates like <span>Monday</span>  etc; and have your html file parsed into a varriable ($htmlReturn?)
$htmlReturn = str_replace("<span>" . date("D"), "<span bgcolor=green>" . date("D"), $htmlReturn);

ive used that one successfully before :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users