Log in

View Full Version : user Table - Last visit / activity fields


mpasternak
07-27-2007, 01:22 PM
I notice these fields are not actually date fields but some form of code representing time.

I am running a little contest. users are going to enter into a draw to win about $2,000 in free Goalie gear!

Because of the size of the prize there are a lot of restrictions. I'm trying to pull out the following data from the VBulletin Database in order to make the users earn winning.

I need User name, post count, Refferals, Last activity and last visit.

members are qualified if they have > 10 posts. And activity within the last 30 days. And then they receive an additional entry ballot per refferal ID.

I get the jist of the SQL statement needed. I just need to know what the data in the Last activity / visit feild is!

any help would be wonderfull. Thank you

King Kovifor
07-27-2007, 04:47 PM
To turn it into a date, you must use vbdate(). There are comparisons with the numbers. Let me look at my information and give you a good explaination.

To find a time in a specified time you would create a variable and assign it a time like in vBulletin... Something like this:

$last_month = time() - 60*60*24*60

The explainaion of the last numbers is:
seconds x minutes x hours x days)

Then in your query, you use something like this...

WHERE time > $last month

... in your WHERE clause.

That'll fit you into the last month value. To find the date you want (say when a post was made or so), you'd use vbdate(). I really haven't used it so I couldn't explain it and it's arguments.