|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi Everyone,
I am attempting to get the logic of something figured out and I thought someone might be able to confirm what I'm thinking ![]() I want to be able to display something like an image of a turkey during the month of november from now until I'm dead. I was playing around with mktime and it showed very different time stamps for 11/1/07 and 11/1/08 so I can't set it to compare specifically to the timestamp.. But, would I be able to have it evaluate the string stored in php as 11/1/07 and create a timestamp to compare todays date to, and if it matches within the month, have it display the turkey? and if not, have it display a different graphic? I'm attempting to be able to make small changes to my website without having to remember to do them or change them ![]() I hope I've made enough sense that someone can point me in the right direction ![]() Thanks for looking! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Errr... Never mind... Soon as I hit send I got a brain storm... I
just do this: <?PHP $month = date('m'); if ($month == "11"){ echo "turkey"; }else{ echo "No turkey"; } ?> Or something similar, I'll try and feather it out and see how it works for multiple holidays (IE: Thanksgiving, Christmas, NewYears, Halloween etc. etc.) On Oct 24, 2007, at 3:57 PM, Jason Pruim wrote: > Hi Everyone, > > I am attempting to get the logic of something figured out and I > thought someone might be able to confirm what I'm thinking ![]() > > I want to be able to display something like an image of a turkey > during the month of november from now until I'm dead. I was playing > around with mktime and it showed very different time stamps for > 11/1/07 and 11/1/08 so I can't set it to compare specifically to > the timestamp.. But, would I be able to have it evaluate the string > stored in php as 11/1/07 and create a timestamp to compare todays > date to, and if it matches within the month, have it display the > turkey? and if not, have it display a different graphic? > > I'm attempting to be able to make small changes to my website > without having to remember to do them or change them ![]() > > I hope I've made enough sense that someone can point me in the > right direction ![]() > > Thanks for looking! > > -- > > Jason Pruim > Raoset Inc. > Technology Manager > MQC Specialist > 3251 132nd ave > Holland, MI, 49424 > www.raoset.com > japruim@raoset.com > > -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 10/24/07, Jason Pruim <japruim@raoset.com> wrote:
> Hi Everyone, > > I am attempting to get the logic of something figured out and I > thought someone might be able to confirm what I'm thinking ![]() > > I want to be able to display something like an image of a turkey > during the month of november from now until I'm dead. I was playing > around with mktime and it showed very different time stamps for > 11/1/07 and 11/1/08 so I can't set it to compare specifically to the > timestamp.. But, would I be able to have it evaluate the string > stored in php as 11/1/07 and create a timestamp to compare todays > date to, and if it matches within the month, have it display the > turkey? and if not, have it display a different graphic? > > I'm attempting to be able to make small changes to my website without > having to remember to do them or change them ![]() > > I hope I've made enough sense that someone can point me in the right > direction ![]() > > Thanks for looking! > > -- > > Jason Pruim > Raoset Inc. > Technology Manager > MQC Specialist > 3251 132nd ave > Holland, MI, 49424 > www.raoset.com > japruim@raoset.com > > > <? if(date("M") == "11") { // Display turkey } ?> -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished.... |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
> I am attempting to get the logic of something figured out and I thought
> someone might be able to confirm what I'm thinking ![]() > > I want to be able to display something like an image of a turkey during > the month of november from now until I'm dead. I was playing around with > mktime and it showed very different time stamps for 11/1/07 and 11/1/08 > so I can't set it to compare specifically to the timestamp.. But, would > I be able to have it evaluate the string stored in php as 11/1/07 and > create a timestamp to compare todays date to, and if it matches within > the month, have it display the turkey? and if not, have it display a > different graphic? > > I'm attempting to be able to make small changes to my website without > having to remember to do them or change them ![]() > > I hope I've made enough sense that someone can point me in the right > direction ![]() Well, I hope this makes sense: <?php if (date('m') == 11) { echo '<img src="turkey.png" />'; } ?> -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and Desk software that can cut the cost of online support |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On 10/24/07, Daniel Brown <parasane@gmail.com> wrote:
> On 10/24/07, Jason Pruim <japruim@raoset.com> wrote: > > Hi Everyone, > > > > I am attempting to get the logic of something figured out and I > > thought someone might be able to confirm what I'm thinking ![]() > > > > I want to be able to display something like an image of a turkey > > during the month of november from now until I'm dead. I was playing > > around with mktime and it showed very different time stamps for > > 11/1/07 and 11/1/08 so I can't set it to compare specifically to the > > timestamp.. But, would I be able to have it evaluate the string > > stored in php as 11/1/07 and create a timestamp to compare todays > > date to, and if it matches within the month, have it display the > > turkey? and if not, have it display a different graphic? > > > > I'm attempting to be able to make small changes to my website without > > having to remember to do them or change them ![]() > > > > I hope I've made enough sense that someone can point me in the right > > direction ![]() > > > > Thanks for looking! > > > > -- > > > > Jason Pruim > > Raoset Inc. > > Technology Manager > > MQC Specialist > > 3251 132nd ave > > Holland, MI, 49424 > > www.raoset.com > > japruim@raoset.com > > > > > > > > > <? > if(date("M") == "11") { > // Display turkey > } > ?> > > -- > Daniel P. Brown > [office] (570-) 587-7080 Ext. 272 > [mobile] (570-) 766-8107 > > Give a man a fish, he'll eat for a day. Then you'll find out he was > allergic and is hospitalized. See? No good deed goes unpunished.... > Sorry, that should've been a lower-case M. <? if(date("m") == "11") { // Display turkey } ?> -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished.... |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Oct 24, 2007, at 4:09 PM, Richard Heyes wrote: >> I am attempting to get the logic of something figured out and I >> thought someone might be able to confirm what I'm thinking ![]() >> I want to be able to display something like an image of a turkey >> during the month of november from now until I'm dead. I was >> playing around with mktime and it showed very different time >> stamps for 11/1/07 and 11/1/08 >> so I can't set it to compare specifically to the timestamp.. But, >> would I be able to have it evaluate the string stored in php as >> 11/1/07 and create a timestamp to compare todays date to, and if >> it matches within the month, have it display the turkey? and if >> not, have it display a different graphic? >> I'm attempting to be able to make small changes to my website >> without having to remember to do them or change them ![]() >> I hope I've made enough sense that someone can point me in the >> right direction ![]() > > Well, I hope this makes sense: > > <?php > if (date('m') == 11) { > echo '<img src="turkey.png" />'; > } > ?> Yeah... The joys of dealing with a cold that makes your head feel like it wants to explode and you just wish it would so it would feel better ![]() -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
> I want to be able to display something like an image of a turkey > during the month of november from now until I'm dead. And how will the application know when you are dead? __________________________________________________ _______________ Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now. http://office.microsoft.com/en-us/ou...CL100626971033 |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On 10/24/07, Instruct ICC <instructicc@hotmail.com> wrote:
> > > I want to be able to display something like an image of a turkey > > during the month of november from now until I'm dead. > > And how will the application know when you are dead? > > __________________________________________________ _______________ > Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now. > http://office.microsoft.com/en-us/ou...CL100626971033 <? echo "</LIFE>\n"; die($jason); ?> -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished.... |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
what about if (date("m") == 11){ echo ""; } bastien ----------------------------------------> To: php-general@lists.php.net> From: japruim@raoset.com> Date: Wed, 24 Oct 2007 15:57:38 -0400> Subject: [php] Question about time...>> Hi Everyone,>> I am attempting to get the logicof something figured out and I> thought someone might be able to confirm what I'm thinking >> I want to be able to display something like an image of a turkey> during the month of november from now until I'm dead. I was playing> around with mktime and it showed very different time stamps for> 11/1/07 and 11/1/08 so I can't set it to compare specifically to the> timestamp.. But, would I be able to have it evaluate the string> stored in php as 11/1/07 and create a timestamp to compare todays> date to, and if it matcheswithin the month, have it display the> turkey? and if not, have it displaya different graphic?>> I'm attempting to be able to make small changes to my website without> having to remember to do them or change them >> I hope I've made enough sense that someone can point me in the right> direction >> Thanks for looking!>> -->> Jason Pruim> Raoset Inc.> Technology Manager> MQC Specialist> 3251 132nd ave> Holland, MI, 49424> www.raoset.com> japruim@raoset.com>>__________________________________________________ _______________ Have fun while connecting on Messenger! Click here to learn more. http://entertainment.sympatico.msn.ca/WindowsLiveMessenger |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
At 3:10 PM -0700 10/24/07, Instruct ICC wrote:
> > I want to be able to display something like an image of a turkey >> during the month of november from now until I'm dead. > >And how will the application know when you are dead? When you stop paying for hosting, the application get's the idea when it's bits go poof! If anyone ever noticed, my web site (http://sperling.com) has a tree on it that changes with the seasons. I use: $dates = getdate(); $month = $dates['mon']; $w = "http://www.sperling.com/css/seasons/"; switch( $month ) { case "03": case "04": case "05": $var = $w . "spring.jpg"; break; case "06": case "07": case "08" : $var = $w . "summer.jpg"; break; case "09": case "10": case "11": $var = $w . "fall.jpg"; break; case "12": case "01": case "02": $var = $w . "winter.jpg"; $break; } echo($var); And this code is called from within my css file for a background image. Yes, I use variables in css. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
> > > I want to be able to display something like an image of a turkey > >> during the month of november from now until I'm dead. > > > >And how will the application know when you are dead? > > When you stop paying for hosting, the application get's the idea when > it's bits go poof! Yep, that will do it. I wonder if they can legally bill your "estate"? Or if the estate is liable. > If anyone ever noticed, my web site (http://sperling.com) has a tree > on it that changes with the seasons. I use: Nice. __________________________________________________ _______________ Boo!Scare away worms, viruses and so much more! Try Windows Live OneCare! http://onecare.live.com/standard/en-...wl_hotmailnews |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
On Oct 24, 2007, at 6:10 PM, Instruct ICC wrote: > >> I want to be able to display something like an image of a turkey >> during the month of november from now until I'm dead. > > And how will the application know when you are dead? Well, I code all of my applications to receive RFID signals, and I had a RFID transmitter embedded into me that gets powered by the electricity that my body generates, so when it can no longer get that signal, the application is designed to shut down and put up a message that says "Due to the death of my creator I quit, have a nice day!" ![]() -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
On Oct 24, 2007, at 9:01 PM, tedd wrote: > At 3:10 PM -0700 10/24/07, Instruct ICC wrote: >> > I want to be able to display something like an image of a turkey >>> during the month of november from now until I'm dead. >> >> And how will the application know when you are dead? > > When you stop paying for hosting, the application get's the idea > when it's bits go poof! > > If anyone ever noticed, my web site (http://sperling.com) has a > tree on it that changes with the seasons. I use: > > $dates = getdate(); > $month = $dates['mon']; > $w = "http://www.sperling.com/css/seasons/"; > switch( $month ) > { > case "03": case "04": case "05": > $var = $w . "spring.jpg"; > break; > case "06": case "07": case "08" : > $var = $w . "summer.jpg"; > break; > case "09": case "10": case "11": > $var = $w . "fall.jpg"; > break; > case "12": case "01": case "02": > $var = $w . "winter.jpg"; > $break; > } > echo($var); > > And this code is called from within my css file for a background > image. Yes, I use variables in css. > > Cheers, > > tedd Hi tedd, That's actually where I got the idea, just couldn't remember who on what list said they did it using variables in css is it as easy asjust putting in a quick <?PHP echo "background: $date"; ?> in the css? or is it more complicated? -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
2007. 10. 25, csütörtök keltezéssel 09.01-kor Jason Pruim ezt Ãrta:
> On Oct 24, 2007, at 9:01 PM, tedd wrote: > > > At 3:10 PM -0700 10/24/07, Instruct ICC wrote: > >> > I want to be able to display something like an image of a turkey > >>> during the month of november from now until I'm dead. > >> > >> And how will the application know when you are dead? > > > > When you stop paying for hosting, the application get's the idea > > when it's bits go poof! > > > > If anyone ever noticed, my web site (http://sperling.com) has a > > tree on it that changes with the seasons. I use: > > > > $dates = getdate(); > > $month = $dates['mon']; > > $w = "http://www.sperling.com/css/seasons/"; > > switch( $month ) > > { > > case "03": case "04": case "05": > > $var = $w . "spring.jpg"; > > break; > > case "06": case "07": case "08" : > > $var = $w . "summer.jpg"; > > break; > > case "09": case "10": case "11": > > $var = $w . "fall.jpg"; > > break; > > case "12": case "01": case "02": > > $var = $w . "winter.jpg"; > > $break; > > } > > echo($var); > > > > And this code is called from within my css file for a background > > image. Yes, I use variables in css. > > > > Cheers, > > > > tedd > > > Hi tedd, > > That's actually where I got the idea, just couldn't remember who on > what list said they did it using variables in css is it as easy as> just putting in a quick <?PHP echo "background: $date"; ?> in the > css? or is it more complicated? you have to configure apache to handle css files as php files. also you have to send headers including content-type set to text/css and then you can script your css greets Zoltán Németh > > -- > > Jason Pruim > Raoset Inc. > Technology Manager > MQC Specialist > 3251 132nd ave > Holland, MI, 49424 > www.raoset.com > japruim@raoset.com > > > |
|
|
|
#15 |
|
Messages: n/a
Hébergeur: |
On 10/25/07, Zoltán Németh <znemeth@alterationx.hu> wrote:
> 2007. 10. 25, csütörtök keltezéssel 09.01-kor Jason Pruim ezt írta: > > On Oct 24, 2007, at 9:01 PM, tedd wrote: > > > > > At 3:10 PM -0700 10/24/07, Instruct ICC wrote: > > >> > I want to be able to display something like an image of a turkey > > >>> during the month of november from now until I'm dead. > > >> > > >> And how will the application know when you are dead? > > > > > > When you stop paying for hosting, the application get's the idea > > > when it's bits go poof! > > > > > > If anyone ever noticed, my web site (http://sperling.com) has a > > > tree on it that changes with the seasons. I use: > > > > > > $dates = getdate(); > > > $month = $dates['mon']; > > > $w = "http://www.sperling.com/css/seasons/"; > > > switch( $month ) > > > { > > > case "03": case "04": case "05": > > > $var = $w . "spring.jpg"; > > > break; > > > case "06": case "07": case "08" : > > > $var = $w . "summer.jpg"; > > > break; > > > case "09": case "10": case "11": > > > $var = $w . "fall.jpg"; > > > break; > > > case "12": case "01": case "02": > > > $var = $w . "winter.jpg"; > > > $break; > > > } > > > echo($var); > > > > > > And this code is called from within my css file for a background > > > image. Yes, I use variables in css. > > > > > > Cheers, > > > > > > tedd > > > > > > Hi tedd, > > > > That's actually where I got the idea, just couldn't remember who on > > what list said they did it using variables in css is it as easy as> > just putting in a quick <?PHP echo "background: $date"; ?> in the > > css? or is it more complicated? > > you have to configure apache to handle css files as php files. > also you have to send headers including content-type set to text/css > > and then you can script your css > > greets > Zoltán Németh > > > > > -- > > > > Jason Pruim > > Raoset Inc. > > Technology Manager > > MQC Specialist > > 3251 132nd ave > > Holland, MI, 49424 > > www.raoset.com > > japruim@raoset.com > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Or, in the event that you're unable to set MIME types and parsing, you can just add the appropriate <style></style> tags and then <? include('css/style.css'); ?> -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished.... |
|
|
|
#16 |
|
Messages: n/a
Hébergeur: |
At 3:13 PM +0200 10/25/07, Zoltán Németh wrote:
>2007. 10. 25, csütörtök keltezéssel 09.01-kor Jason Pruim ezt írta: > > That's actually where I got the idea, just couldn't remember who on >> what list said they did it using variables in css is it as easy as>> just putting in a quick <?PHP echo "background: $date"; ?> in the >> css? or is it more complicated? > >you have to configure apache to handle css files as php files. >also you have to send headers including content-type set to text/css > >and then you can script your css > >greets >Zoltán Németh That's one way. Here's another: http://sperling.com/examples/pcss/ As Zoltán suggested, but didn't elaborate, you can drop a .htaccess file into your root directory that contains: <FilesMatch "\.(css|style)$"> SetHandler application/x-httpd-php </FilesMatch> and then use <?php whatever you want ?> inside the css file. This makes things easier when trying to change constants like colors, or dealing with the box-model problem, or rules that are dependant upon other rules; or really neat automatic image width/height determinations for images on the fly (think about that). :-) There are a lot of opportunities to add functionality to css that apparently has not been addressed in any documentation I've been able to find. I can't be the first down this street, but for certain it hasn't been traveled often. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|
|
#17 |
|
Messages: n/a
Hébergeur: |
> >> I want to be able to display something like an image of a turkey > >> during the month of november from now until I'm dead. > > > > And how will the application know when you are dead? > > Well, I code all of my applications to receive RFID signals, and I > had a RFID transmitter embedded into me that gets powered by the > electricity that my body generates, so when it can no longer get that > signal, the application is designed to shut down and put up a message > that says "Due to the death of my creator I quit, have a nice day!" ![]() I'm not amused. http://zeitgeistmovie.com/ Way way way at the end. __________________________________________________ _______________ Climb to the top of the charts! Play Star Shuffle: the word scramble challenge with star power. http://club.live.com/star_shuffle.as...iltextlink_oct |
|
![]() |
| Outils de la discussion | |
|
|