View Full Version : Loading avatars externally
weasello
09-02-2009, 08:38 PM
Hey there,
I'm trying to find a user's avatar and am having problems.
I don't have access to any of the VB template functions or includes, but I do have full DB access. The problem I'm running into is this:
user_id in the users table DOES NOT match u= in the image.php file.
For example:
user_id 2 (me) has an avatar at images.php?u=1
user_id 67 (someone else) has an avatar at images.php?u=17
I tried looking into the database table "customavatars" but I couldn't find it in PHPMyAdmin.
Any clues on where to go?
TCattitude
09-02-2009, 09:01 PM
Check "customavatar" table. There are all customavatars (and "avatar" for you own uploaded avatars for users use as gallery to choose)
There you have an "userid" column to search for userid, and get user's avatar data (filename, size, etc).
BUT... i use avatars as files, not from DB, and have no userful data in there :)
So i took a quick lookup for what you ask, and... found this:
You only need to check "user" table, and see "avatarrevision" column. If that column is not zero, then user have an avatar, and that avatar is on the server's path that you point on vb's admincp to save them, and have that "revision number" as part of the filename.
Like this example:
If in "user" table for "userid" = 8 his "avatarrevision" is = 2, then his avatar image is:
/server/path/where/avatars/are/stored/avatar8_2.gif
The trick is that filename: avatarUSERID_AVATARREVISION.gif
Hope helps ;)
weasello
09-02-2009, 09:22 PM
I wish my avatar images were stored as files! They're stored in the DB though and I can't seem to find the "customavatars" database table. I'm thinking it's hidden or something...
How can I store things on the file system instead? Is there an option to enable this I'm missing?
In any case, you are quite correct - userId 2, revision 1000, equals an image of 2_1000.png in the user table under "avatar filename". Unfortunately it runs into the same problem as I originally posted..
User_id 2 has an image filename of 2_1000.png, but to load the image the only way I can find is to follow the URL:
/image.php?u=1
I can't find the correlation between the User_ID and image.php's u= field.
--------------- Added 1251931011 at 1251931011 ---------------
Update:
Well I just found out how to store them to the disk instead of the DB, but I'm still having the same problem. UserID2 has /customavatars/avatar1_1.png . I can't find any reference to the number 1 in the user database at all. :(
TCattitude
09-02-2009, 09:38 PM
How can I store things on the file system instead? Is there an option to enable this I'm missing?
vBulletin -> AdminCP -> Avatars -> User Picture Storage Type
There you can move avatar from DB to filesystem.
weasello
09-02-2009, 09:39 PM
Just did a few test queries against the "customavatar" table and it doesn't exist, so I'm not just crazy. :)
TCattitude
09-02-2009, 09:47 PM
Table_prefix?
If you are using a tableprefix for your vbulletin installation (check your includes/config.php file), then use it when you call that table. I use "vb_" as prefix, so that table to me is: vb_customavatar
weasello
09-02-2009, 09:52 PM
Nope, no prefixes. I can browse all the tables, and am doing so... can see all the internal workins! just no table that remotely resembles the customavatars one. :/
--------------- Added 1251932025 at 1251932025 ---------------
......
of course I'm looking at my old installation's PHPBB database. sigh.
nevermind, all solved now. *rolls eyes*
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.