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 03-02-2010, 06:58 PM   #1
teh ghey
Guest
 
Posts: n/a
Php question

I have this If statement
<!-- IF active_module == "homepage" -->
show image here
<!-- ENDIF -->
I only want to use this IF statement on monday - thursday.

on friday-sunday I do not want to use the IF statement, so it just shows the image on every page, not just the homepage.

How can I make it so that the IF statement only runs monday through thursday, and on friday-sunday it doesnt use the IF?
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 07:30 PM   #2
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,058
Quote:
Originally Posted by teh ghey View Post
I have this If statement
<!-- IF active_module == "homepage" -->
show image here
<!-- ENDIF -->
I only want to use this IF statement on monday - thursday.

on friday-sunday I do not want to use the IF statement, so it just shows the image on every page, not just the homepage.

How can I make it so that the IF statement only runs monday through thursday, and on friday-sunday it doesnt use the IF?
if date('w',time())>=1 && date('w',time())<=4 && .................

That will check if the day of the week is between Monday (1) and Thursday (4)
__________________
All cookies cleared!

Last edited by sarettah; 03-02-2010 at 07:32 PM..
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 07:35 PM   #3
teh ghey
Guest
 
Posts: n/a
thank you!
I know zero about php, do I have to put a <?php> in front of it?
im fixing a template i bought
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 07:44 PM   #4
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,058
<?php if(date('w',time())>=1 && date('w',time())<=4) {?>

Your template code here

<?php } ?>

should work.

Let me know how it goes
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 07:47 PM   #5
teh ghey
Guest
 
Posts: n/a
It worked!!!!
you rock, thank you so much!!!

Last edited by teh ghey; 03-02-2010 at 07:50 PM..
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 07:51 PM   #6
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,058
Quote:
Originally Posted by teh ghey View Post
It worked!!!!
you rock, thank you so much!!!
np.......
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 08:13 PM   #7
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 sarettah View Post
<?php if(date('w',time())>=1 && date('w',time())<=4) {?>

Your template code here

<?php } ?>

should work.

Let me know how it goes
Why not just

<? if(date('w')>=1 && date('w')<=4) {?>

time() is redundant
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2010, 09:06 PM   #8
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,058
Quote:
Originally Posted by quantum-x View Post
Why not just

<? if(date('w')>=1 && date('w')<=4) {?>

time() is redundant
Because I am redundant I guess. I usually use the date() function with something other than the current time so I forget that it defaults to using the current time if you leave the param out.

Dangers of answering off the top of my head while I am breaking from code.
__________________
All cookies cleared!
sarettah 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.