GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How can I show different html based on time of day? perhaps php code? (https://gfy.com/showthread.php?t=765262)

Wolfy 09-01-2007 07:52 AM

How can I show different html based on time of day? perhaps php code?
 
I need to embed a flash file from 8-midnight CST (server time), and a different bit of html at all other times.

Like
Code:

From 8-midnight embed this movie

then

all other times use this html.

How do I do this?

Juicy D. Links 09-01-2007 07:54 AM

http://www.askapache.com/htaccess/ti...cond-time.html

KimJI 09-01-2007 08:12 AM

Quote:

Originally Posted by Juicy D. Links (Post 13019088)

Holy shit. Did Juicy just make a serious webmaster related reply? Or this one of the outsourced monkey that forgot what character he was logged in with?

Wolfy 09-01-2007 08:16 AM

thanks Big D :)

RawAlex 09-01-2007 08:18 AM

Juicy likes pie... and apache!

quantum-x 09-01-2007 08:29 AM

<? if (date('G') >= 8 && date('G') >= 12) { ?>

Alternate code

<? } else { ?>

Other code

<? } ?>

Juicy D. Links 09-01-2007 09:47 AM

Quote:

Originally Posted by KimJI (Post 13019139)
Holy shit. Did Juicy just make a serious webmaster related reply? Or this one of the outsourced monkey that forgot what character he was logged in with?

i gave them off for the weekend , they be back on Tues :pimp:pimp:pimp

Wolfy 09-01-2007 06:36 PM

Damn - I tried the mod rewrite Juicy sent me. It worked fine at first, but it didn't switch it back at the appropriate hour.


Quote:

Originally Posted by quantum-x (Post 13019171)
<? if (date('G') >= 8 && date('G') >= 12) { ?>

Alternate code

<? } else { ?>

Other code

<? } ?>


So I tried tat one, and it doesn't seem to be working either.

Anyone can help me with this? 169334379

uno 09-01-2007 06:42 PM

Quote:

Originally Posted by KimJI (Post 13019139)
Holy shit. Did Juicy just make a serious webmaster related reply? Or this one of the outsourced monkey that forgot what character he was logged in with?

I think someone hacked his nick.

GrouchyAdmin 09-01-2007 06:43 PM

Quote:

Originally Posted by Wolfy (Post 13021166)
So I tried tat one, and it doesn't seem to be working either.

Anyone can help me with this? 169334379

You need to set it to run at whatever your server time is, offset from yours. So if the server thinks it's 10, and you think it's 8, you set it for 10. If it didn't work at all, php short tags are off, replace the <? part with <?php and it should work.

J4ck 09-01-2007 06:50 PM

Quote:

Originally Posted by uno (Post 13021179)
I think someone hacked his nick.

LOLLL :upsidedow:):winkwink:

quantum-x 09-01-2007 07:05 PM

Quote:

Originally Posted by Wolfy (Post 13021166)
Damn - I tried the mod rewrite Juicy sent me. It worked fine at first, but it didn't switch it back at the appropriate hour.





So I tried tat one, and it doesn't seem to be working either.

Anyone can help me with this? 169334379


Sure it does.
If you need assitance, you can ICQ me for my hourly rate.

Wolfy 09-01-2007 07:18 PM

i just sent you an ICQ.


Hopefully your hourly rate is pro-rateable, since this should take you a couple seconds to fix :D

psili 09-01-2007 07:37 PM

I suck at programming, so if you try the following, you might be insane.

Code:

<?PHP
 // default to all hours
 $flash = "<object....><embed....></embed></object>";
 // test time frame
 if( date("H") >= 20 && date("H") != 0 )
 {
  $flash = "<object...>new shit<embed...>new shit</embed></object>";
 }
?>

Code:

<html>
  <body>
    <?PHP echo($flash); ?>
  </body>
 </html>

Again, I'll make no excuses for the above blowing up a server. Sorry. I like to bump threads sometimes with uselessnessnessness....ness.

psili 09-01-2007 07:47 PM

I do suck at programming... maybe the PHP "if" statement could have simply been:

if( date("H") >= 20 ) // 'H'
{
.. blah blah
}

anyway... back to nonsense.


Quote:

Originally Posted by psili (Post 13021298)
I suck at programming, so if you try the following, you might be insane.

Code:

<?PHP
 // default to all hours
 $flash = "<object....><embed....></embed></object>";
 // test time frame
 if( date("H") >= 20 && date("H") != 0 )
 {
  $flash = "<object...>new shit<embed...>new shit</embed></object>";
 }
?>

Code:

<html>
  <body>
    <?PHP echo($flash); ?>
  </body>
 </html>

Again, I'll make no excuses for the above blowing up a server. Sorry. I like to bump threads sometimes with uselessnessnessness....ness.


Wolfy 09-01-2007 07:57 PM

somebody ICQ me please - 169334379

Wolfy 09-01-2007 08:20 PM

bargitty barg barg barg

COME ON!!!!!!

*New drink :D

GrouchyAdmin 09-01-2007 08:27 PM

Hi Wolfy,

Sorry I missed you - I was having dinner and my volume was set too low to notice. Feel free to hit me up. ICQ is in the sig.

Wolfy 09-01-2007 08:50 PM

thank you GA and psili, you guys rock!

psili 09-01-2007 08:52 PM

Quote:

Originally Posted by Wolfy (Post 13021447)
thank you GA and psili, you guys rock!

Grouchy's attentive, for a grouchy guy ;)
He doesn't misplace or forget the special characters.

GrouchyAdmin 09-01-2007 08:54 PM

Quote:

Originally Posted by psili (Post 13021314)
I do suck at programming... maybe the PHP "if" statement could have simply been:

if( date("H") >= 20 ) // 'H'
{
.. blah blah
}

There's no need for the leading zeros. 'G' will work fine. This will work until 11:59, but if you want to get pedantic:

Code:

if (date("G") >= "20" || (date("G") == "0" && date("i")  == "00")) {
Quote:

Originally Posted by psili (Post 13021451)
Grouchy's attentive, for a grouchy guy ;)
He doesn't misplace or forget the special characters.

Hahaha. I love using a text editor that colorizes for me. I've used 'vi' until I switched to KDE, and Kate's my new babe. :thumbsup

psili 09-01-2007 09:00 PM

I totally see what you mean. When I was sadly trying to help Wolfy, after looking at his .txt file, I gave him:

if (date("G") >= "20" {

which made his PHP puke -- I missed the right parens. Oh well... that's why there's "programmers" and "script kiddies" (I'll be the latter) to help all others get confused, I guess.

Quote:

Originally Posted by GrouchyAdmin (Post 13021457)
There's no need for the leading zeros. 'G' will work fine. This will work until 11:59, but if you want to get pedantic:

Code:

if (date("G") >= "20" || (date("G") == "0" && date("i")  == "00")) {


Hahaha. I love using a text editor that colorizes for me. I've used 'vi' until I switched to KDE, and Kate's my new babe. :thumbsup



All times are GMT -7. The time now is 09:42 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc