Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 18th, 2004, 4:49 PM   #1
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
Alright, I'm in charge of designing my church's website. And each of the religious seasons has a specific color. For each season I have an appropriate CSS file (Blue.css, Green.css etc). Anyway, how could I implement this with PHP. I'm assuming I'd need a to use the date module, but how would I tell it to use which CSS script according to the date? Any help is appreciated. Thanks
thechristelegacy is offline   Reply With Quote
Old Aug 18th, 2004, 5:00 PM   #2
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
well with psuedo code. what you would do is

Check Date;
if data is > then say Dec 1st then
print xmass.css and soo on

if someone hasnt helped out better thent hat by the time i get home i will look up exactly how to do this
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Aug 18th, 2004, 5:59 PM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Here goes nothing:

<?PHP

function compair($date1, $date2, $date3)
{
    //all dates must be unix timestamps.
    //date1 is the current date.
    //date2 is the starting date of a period
    //date3 is the ending date of a period.
    if ($date1 >= $date2 && $date1 <= $date3)
    {
          return true;
     }
     else
     {
          return false;
     }
}

$mydate = date("m.d.y");
list($month, $day, $year) = split('.', $mydate);
$dt = gmmktime(0,0,0,$month, $day, $year); //this is today's date in a unix timestamp.

$periods = gmmktime(0,0,0,12,1,$year); //give you dec first in a timestamp.
$periodf = gmmktime(0,0,0,12,31,$year); //give you dec 31 in a timestamp.
$periods1 = gmmktime(0,0,0,1,1,$year); //give you jan first in a timestamp.
$periodf1 = gmmktime(0,0,0,1,31,$year); //give you jan 31 in timestamp.

//you'd have more of these...how ever many periods that you wanted.

if (compair($dt, $periods, $periodf))
{
      //output some html to include your css here.
}
elseif (compair($dt, $periods1, $periodf1))
{
     //output some html to include your css here.
}

?>


ofcourse none of this code is tested and is just ment to get you going in the right direction, so i don't know if there are errors in it or what. good luck.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Aug 18th, 2004, 6:00 PM   #4
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
oh, and you'd also have to run this code inside your header where you want to declair your css
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Aug 18th, 2004, 6:08 PM   #5
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
Thanks, I'll definatly start with that. I'll post the final content then.
thechristelegacy is offline   Reply With Quote
Old Aug 19th, 2004, 9:58 AM   #6
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
your welcome. post a link to the site too!
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Aug 19th, 2004, 12:40 PM   #7
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
The site is http://www.lavansv-bakersv.org It's not completed yet, so half of the main links don't go anywhere yet, and there are a few places that arent't updated yet. Don't complain about the sloppy coding :-D (using frames for a layout, the pastor wanted it). I didn't write the other CSS scripts yet. I'll get those going in about a week here, I'll post back when I have everything up to par. Feedback and suggestions are welcomed
thechristelegacy is offline   Reply With Quote
Old Aug 19th, 2004, 12:44 PM   #8
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Looks good, however i feel sorry for you because you have to use frames. why not use tables and some nifty iframes? It could use a little more color and some nice gradients to make the menu and rest of the page pop out at the user. I know it's just in the begining faze, so i am sure that it'll just keep getting better and better looking.


Good work so far though.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Aug 19th, 2004, 12:57 PM   #9
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
Yeah, I need to run alternate layout ideas past my pastor. Iframes are nice, but I've seen some odd things happen with them accross some alternate browsers. But then again, most the people in this small town of Pennsylvania have never heard of Mozilla and use either IE or AOL. I'll definatly consider your ideas though.
thechristelegacy is offline   Reply With Quote
Old Aug 19th, 2004, 2:07 PM   #10
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
IFrames are the devil!
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC