vBulletin Modifications

userid

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support

Reply
 
LinkBack Thread Tools
Old 03-21-2006, 12:36 AM   #1
Junior Member
Join Date: Feb 2006
Gen_MJ is on a distinguished road

Default userid

Okay I know this may sound dumb but bare with me, I can't get it to work or find an example anywhere.

I can get the UserId of someone, but I want to get the username from that user ID.

any idea how, and please post examples i learn better that way.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 03-21-2006, 12:42 AM   #2
vBulletin Guru
Ken Iovino's Avatar
Join Date: Mar 2004
Real Name: Ken Iovino
Location: Miami, Florida
Ken Iovino is on a distinguished road

Default

Do you mean in the templates?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 12:01 PM   #3
Coder
Idan's Avatar
Join Date: Feb 2005
Real Name: Idan
Location: Israel
Idan is on a distinguished road

Default

Quote:
Originally Posted by Gen_MJ
Okay I know this may sound dumb but bare with me, I can't get it to work or find an example anywhere.

I can get the UserId of someone, but I want to get the username from that user ID.

any idea how, and please post examples i learn better that way.
if you mean on template you can use $bbuserinfo[username] on template for 3.0.x, for 3.5.x i think it's $userinfo[username] .
if you want on query, via code, just run query like:
You must first be a registered member to view any code.

Last edited by Idan; 03-21-2006 at 12:09 PM..




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 12:28 PM   #4
Coder
Join Date: Jun 2005
harmor is on a distinguished road

Default

For 3.5.x it's still $bbuserinfo[username]

For php code I use $vbulletin->userinfo['username']




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 03:33 PM   #5
Junior Member
Join Date: Feb 2006
Gen_MJ is on a distinguished road

Default

Yea I am doing this in php

I think i can do it how mad dog said.
basicly run
You must first be a registered member to view any code.
that would work, would it not?

EDIT:
Of course I have to add the mysql access code




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 04:08 PM   #6
Coder
Join Date: Jun 2005
harmor is on a distinguished road

Default

You not even have do that query. What do you want to get from the users table?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 05:13 PM   #7
Join Date: May 2004
TouchingVirus is on a distinguished road

Default

He wants a User's username when he has the user's userid ...the simple query above would work but it might be better to incorporate it into an existing query to reduce the mySQL calls ;)




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 06:17 PM   #8
Coder
Join Date: Jun 2005
harmor is on a distinguished road

Default

If you want the username of the person browsing the site use $vbulletin->userinfo['username']




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 11:13 PM   #9
Junior Member
Join Date: Feb 2006
Gen_MJ is on a distinguished road

Default

I don't want the person browsing the site, I have a user id, drawn through the $_GET array, and i want to find the id's user name
i am gonna try the mysql query theory and see wht happens




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-22-2006, 05:48 PM   #10
Coder
Idan's Avatar
Join Date: Feb 2005
Real Name: Idan
Location: Israel
Idan is on a distinguished road

Default

Quote:
Originally Posted by TouchingVirus
He wants a User's username when he has the user's userid ...the simple query above would work but it might be better to incorporate it into an existing query to reduce the mySQL calls ;)
agreed - point well taken.
it's always better to add extra field or locate some query that already has it for better optimization. on the other hand, 1 small query that have only 1 result filed in it & query that won't return any big array should not take much resources & would be very un-noticable in most cases.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hack to search user by userid vb3.07 cyberman vBulletin Modification Requests 0 10-11-2005 04:19 PM


All times are GMT -3. The time now is 01:12 AM.

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)