Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 12 Apr 2002, 05:57
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Real name: Jeebus the Almighty
Retrieving lastvisit, should be easy...

Ok this is my code


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But everytime I call $userlastvisit it says "1018586613" I have tried $user[lastvisit], $user[lastvisitdate], $user['lastvisit'], and $user['lastvisitdate']. I'm probably making this harder than it should be, but help please. gre:
Reply With Quote
  #2  
Old 12 Apr 2002, 17:03
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
First of all, use the query_first() method instead of query() and then fetch_array(), since you are only getting one row of data.

Anyway, what you get (that long number) is in Unix Timestamp, and needs to be converted. Use:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

FORMAT is the format of the date / time, see the manual entry for date() for more info.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #3  
Old 13 Apr 2002, 02:13
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Real name: Jeebus the Almighty
Thanx FireFly, that was MUCH easier than what I thought it would be. :bandit:

But about the query_first, if I use that I get an error in db_mysql about a bad argument, so I had to just use query.
Reply With Quote
  #4  
Old 13 Apr 2002, 07:00
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
If you use query_first() you don't need fetch_array(), because it does that internally.

So instead of:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You just use this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #5  
Old 13 Apr 2002, 18:53
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Real name: Jeebus the Almighty
Oh ok I got it now, sorry I'm still trying to learn all this coding.
Reply With Quote
  #6  
Old 15 Apr 2002, 12:26
jjj0923's Avatar
jjj0923 jjj0923 is offline
 
Join Date: Mar 2002
Firefly - what a timely post.

Thanks for this information.

While we're on the subject, I was working over the weekend trying something along the same lines.

I have Photopost installed along with vbulletin and I want to pop-up a little javascript message or display a blinking "photo gallery" graphic if there have been new photos posted in the gallery since the users last visit.

The problem I was running into was selecting the photopost db in index.php. It would appear to get selected properly (since servername, username & password) are the same, but then I went to select data from the photpost db, I would get a message returned a string that said something like "Resource ID 27".

I'm fairly confident the select_db was working ok becuase if I did not reselect the Vbulletin db at the end of my code, vb would throw errors.

any ideas????

thanks if advance Firefly!

- jeff
Reply With Quote
  #7  
Old 15 Apr 2002, 12:34
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

$result isn't what you are looking for, you first need to fetch the row:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And then use $result['fieldName'].
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #8  
Old 15 Apr 2002, 12:46
jjj0923's Avatar
jjj0923 jjj0923 is offline
 
Join Date: Mar 2002
cool - thanks!

now where do you want me to send contributions for that condo????

- jeff
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 02:52.

Layout Options | Width: Wide Color: