UBB.Dev
Posted By: larrydougherty date/time function help - 09/03/2001 8:22 PM
this is what im tryin to do.. I have it set on the forum now to show last post and by who in the ultimate.cgi file.. what I wanna do is if the last post was made today.. I want it to say today instead of saying the date there.. so I need a comparison statement.. I have the if else wrote but what do I compare what to what?? can anyone help or lead me in the right direction..
Posted By: BassTeQ Re: date/time function help - 09/04/2001 2:06 AM
There are a few ways you could do it, depending upon the way your date it setup in your ubb

something like this will run the nix date command and slap it in a string

$date2 = system("date -u '+%d/%m/%y'");

then compare the two strings.

[ September 03, 2001: Message edited by: BassTeQ ]
Posted By: larrydougherty Re: date/time function help - 09/04/2001 6:39 AM
ok so thats the one string to get the current date but whats the varialbe that UBB stores the last post date?? is the $lastjulian or something like that??
Posted By: BassTeQ Re: date/time function help - 09/05/2001 12:40 AM
Thats a very good question, id have to look when I get home from work.

Just tppe this somewhere in your code, and see what it prints, if it prints the date then you're in business.

print "This is the date from UBB variable $lastjuliann";
Posted By: larrydougherty Re: date/time function help - 09/05/2001 1:52 AM
nope.. that didnt work.. the variable was actually $LastPostJulian but when I call it I get no value.. prolly not declared before i call it.. so not sure.. im bout to give up on this one..its confusing.. another ? real fast incase u know the answer.. any idea where I can get the rate member mod as I cant find that either??
Posted By: BassTeQ Re: date/time function help - 09/06/2001 12:47 AM
Hmmm.....

I dont think there is a rate member mod sorry.
Posted By: BassTeQ Re: date/time function help - 09/06/2001 8:33 AM
Have you set your date to be in Julian format in the UBB? Because that could be the reason the variable could be blank.

Whats the url to your board?
Posted By: larrydougherty Re: date/time function help - 09/06/2001 8:24 PM
the forum is http://www.newcelica.org/cgi-bin/Ultimate.cgi

i havent played with the date settings so it should be what it comes set at..
Posted By: BassTeQ Re: date/time function help - 09/07/2001 12:45 AM
Ok, Try printing out that variable again after changing the date settings in your CP a few times.
Also make sure you are printing it out in a spot where it would be used, (ie where it would contain data) just becareful not to put it inside a sub that may never get called, know what I mean?
© UBB.Developers