Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-01-2007, 07:52 AM   #1
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
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?
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 07:54 AM   #2
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
http://www.askapache.com/htaccess/ti...cond-time.html
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:12 AM   #3
KimJI
Confirmed User
 
Join Date: May 2007
Location: So fucking gone
Posts: 1,839
Quote:
Originally Posted by Juicy D. Links View Post
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?
__________________
Trafficadept | Best traffic I have ever tested | web "@t" cuul.org
KimJI is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:16 AM   #4
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
thanks Big D
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:18 AM   #5
RawAlex
So Fucking Banned
 
Join Date: Oct 2003
Location: In a house.
Posts: 9,465
Juicy likes pie... and apache!
RawAlex is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:29 AM   #6
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
<? if (date('G') >= 8 && date('G') >= 12) { ?>

Alternate code

<? } else { ?>

Other code

<? } ?>
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:47 AM   #7
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
Quote:
Originally Posted by KimJI View Post
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
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 06:36 PM   #8
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
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 View Post
<? 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
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 06:42 PM   #9
uno
RIP Dodger. BEST.CAT.EVER
 
uno's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: NYC Area
Posts: 18,450
Quote:
Originally Posted by KimJI View Post
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.
__________________
-uno
icq: 111-914
CrazyBabe.com - porn art
MojoHost - For all your hosting needs, present and future. Tell them I sent ya!
uno is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 06:43 PM   #10
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Wolfy View Post
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.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 06:50 PM   #11
J4ck
Confirmed User
 
J4ck's Avatar
 
Industry Role:
Join Date: Apr 2007
Location: Montreal, Canada
Posts: 254
Quote:
Originally Posted by uno View Post
I think someone hacked his nick.
LOLLL
__________________
Regards,
Jack
ICQ: 1-739-018


Become affiliate now!
J4ck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 07:05 PM   #12
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Wolfy View Post
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.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 07:18 PM   #13
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
i just sent you an ICQ.


Hopefully your hourly rate is pro-rateable, since this should take you a couple seconds to fix :D
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 07:37 PM   #14
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
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.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 07:47 PM   #15
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
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 View Post
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.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 07:57 PM   #16
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
somebody ICQ me please - 169334379
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:20 PM   #17
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
bargitty barg barg barg

COME ON!!!!!!

*New drink :D
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:27 PM   #18
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
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.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:50 PM   #19
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
thank you GA and psili, you guys rock!
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:52 PM   #20
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by Wolfy View Post
thank you GA and psili, you guys rock!
Grouchy's attentive, for a grouchy guy ;)
He doesn't misplace or forget the special characters.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:54 PM   #21
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by psili View Post
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 View Post
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.
__________________

Last edited by GrouchyAdmin; 09-01-2007 at 08:57 PM.. Reason: append.
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:00 PM   #22
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
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 View Post
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.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.