Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 09-02-2009, 08:38 PM
weasello weasello is offline
 
Join Date: Aug 2009
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 09-02-2009, 09:01 PM
TCattitude's Avatar
TCattitude TCattitude is offline
 
Join Date: Oct 2004
Location: Chile
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 09-02-2009, 09:22 PM
weasello weasello is offline
 
Join Date: Aug 2009
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-02-2009, 09:38 PM
TCattitude's Avatar
TCattitude TCattitude is offline
 
Join Date: Oct 2004
Location: Chile
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 09-02-2009, 09:39 PM
weasello weasello is offline
 
Join Date: Aug 2009
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just did a few test queries against the "customavatar" table and it doesn't exist, so I'm not just crazy.
Reply With Quote
  #6  
Old 09-02-2009, 09:47 PM
TCattitude's Avatar
TCattitude TCattitude is offline
 
Join Date: Oct 2004
Location: Chile
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 09-02-2009, 09:52 PM
weasello weasello is offline
 
Join Date: Aug 2009
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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*
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 05:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04120 seconds
  • Memory Usage 2,217KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete