![]() |
Date and Time Variables
OK .. having a bit of a problem here figuring out what Date and Time variables are availlable. Would appreciate any help! :)
Firstly, what I'm looking to do, is be able to use an if/else statement to do/show something dependant on if the 'forum time' falls into a certain range (BETWEEN $feature_open AND $feature_close). Is there a variable that is accessable for your forum's time? By forum time, I mean server time + $vboptions[hourdiff] (which is the variable I found for server to forum offset). Or would I be better off adding the following in global.php if it's a variable I'll be using alot? PHP Code:
I'm very new to this and still learning the basics of PHP, but am I correct in assuming date() is the php function to get the unix time on your forum's server? I'm guessing since I'll be using it for both comparisons and display, that it would be best to keep it in unix time (seconds since 1970), and then later just format it for display purposes? Is this the IF statement I should use? PHP Code:
Code:
$features = Do vB variables have 'scope' (learning new terms .. lol) within SQL statements in vB PHP pages? Also, when wanting to enter the date range to my database to store the range something will be availlable, should I use the following if I used the coresponding form variable on the submit page? $feature_open = mktime(open_hour,0,0,open_month,open_day,open_year ); and $feature_close = mktime(close_hour,0,0,close_month,close_day,close_ year); I'm still not sure how to plug it all into the appropriate database fields, but I'm sure some searching in these and/or other MySQL forums will help, or simply looking at similar code already in vB. Otherwise I 'll start a new topic not to mix it up with this one. THANKS TO ANY AND ALL WHO EVEN TRY TO READ THE ABOVE MESS !!! LOL :) |
Questions about modifying vBulletin's default behaviour and asking about modifications in general, should be posted in General vBulletin Questions. Please read the forum descriptions more carefully in future. I've moved your thread there for you :)
Thanks, - Dean |
OK cool ... thanks ... :) ... Thought it was more of a modification at the time, but now I guess it's more of a "How Do I?" ... lol :)
Anyhow ... anyone have any feedback or comments for me ??? :) |
All times are GMT. The time now is 05:57 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|