PDA

View Full Version : Easiest Way To Pull Users Info


BamaStangGuy
02-15-2009, 02:40 AM
I would like to pull some of the information that currently exists within a users profile page such as avatar, custom title, join date, dob, post count and online status. What is going to be the easiest way to do this? As far as the images go this will be used on sites with different methods of storing images so I need to respect all the methods (file/database)

Thanks for your help.

Jon Tolzien
02-15-2009, 02:44 AM
Depending on where you have the data being saved, it will be different. For instance you can have the avatar and such in the database, or you can have it save it in a folder in the same directory as your forum. In addition to you want to do this for everyone or only certain profiles.

BamaStangGuy
02-15-2009, 02:47 AM
I want to support both methods of retrieving the avatar as this product I am creating with be used on sites that store it in the file system while others store it in the database. It needs to be able to detect where it is being stored.

Basically what I am looking to do is show that information on a new page (mynewpage.php) for a project I am working on.

I am trying to figure out how to get this information the most efficient way for my page.

Dismounted
02-15-2009, 02:55 AM
fetch_userinfo()
fetch_avatar_from_userinfo()

BamaStangGuy
02-15-2009, 04:13 AM
Thanks Dismounted. This is what I am using:


require_once(DIR . '/includes/functions_user.php');

fetch_avatar_from_userinfo($vbulletin->userinfo, false, true);

$avatarurl = $vbulletin->userinfo['avatarurl'];

$avatarurl doesn't hold my avatar url though. It just holds the unknown.gif avatar.

print_r on $vbulletin->userinfo shows all my other info so that seems to be working correctly.

Dismounted
02-15-2009, 04:39 AM
Look at what fetch_avatar_from_userinfo() does. :)

BamaStangGuy
02-15-2009, 05:08 AM
Got it figured out. Thanks