vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Loading avatars externally (https://vborg.vbsupport.ru/showthread.php?t=222328)

weasello 09-02-2009 08:38 PM

Loading avatars externally
 
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 [DATE]1251931011[/DATE] at [TIME]1251931011[/TIME] ---------------

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

Quote:

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 [DATE]1251932025[/DATE] at [TIME]1251932025[/TIME] ---------------

......

of course I'm looking at my old installation's PHPBB database. sigh.

nevermind, all solved now. *rolls eyes*


All times are GMT. The time now is 07:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01024 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete