Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 03-18-2008, 03:15 PM
Zizou_SCD Zizou_SCD is offline
 
Join Date: Mar 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Finding Avatar Paths

Hey guys,

As you can see from the thread title, I am trying the path to a persons avatar.

I am trying to ouput a persons avatar onto a webpage, NOT within vBulletin.

So what I need is a query to bring back a path to the avatar when a username is supplied.

Does anyone have this sort of query?
Reply With Quote
  #2  
Old 03-18-2008, 06:04 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why would you want to do this ?
Can you just right click on the image and check the path ?

like here..

Reply With Quote
  #3  
Old 03-18-2008, 06:29 PM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Usually in the database, unless you have moved it to the file system, in which case it would be something like this:

/forum/customavatars

Regards Jason
Reply With Quote
  #4  
Old 03-18-2008, 10:21 PM
Zizou_SCD Zizou_SCD is offline
 
Join Date: Mar 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loco.M View Post
Why would you want to do this ?
Can you just right click on the image and check the path ?

like here..

Maybe I want to output user information from vBulletin on a webpage that's outside vBulletin I am creating website using a CMS and need to use the avatars from vBulletin on the site.

Quote:
Originally Posted by Jase2 View Post
Usually in the database, unless you have moved it to the file system, in which case it would be something like this:

/forum/customavatars

Regards Jason
I know where they are exactly in the file system. I need a query to take a username and bring back the exact url to the image.

Any ideas anyone?
Reply With Quote
  #5  
Old 03-18-2008, 11:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How are you getting the username? Are you calling any standard vb files in the page? The reason I ask is that you may already have the avatar available to you already depending on the coding on your page.
Reply With Quote
  #6  
Old 03-19-2008, 09:10 AM
Zizou_SCD Zizou_SCD is offline
 
Join Date: Mar 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not linking to any vBulletin files. It's an unfeasible solution to the problem.

I have a piece of PHP code which is printing the 5 latest topic titles with the last post and poster name.

I want to get the last posters avatar in on the act here as well.

The query I have at the moment is:

Code:
select a.*, b.pagetext, b.postid from vb_thread a inner join vb_post b on a.lastpostid = b.postid  order by a.lastpost desc limit 0,5;
Is there a simple way to adapt with query to bring back an avatar path as well?
Reply With Quote
  #7  
Old 03-19-2008, 03:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you adverse to using some vb code? I found that there is a function called "fetch_avatar_url" in the includes/functions_user.php file. You pass the userid and it passes back the avatar_url. It's around line 260 of that file. Will that work for you?
Reply With Quote
  #8  
Old 03-19-2008, 03:11 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

fetch_avatar_url is great is you are only trying to get one avatar, but it will do a query for each avatar is pulls.
Reply With Quote
  #9  
Old 03-19-2008, 04:11 PM
Zizou_SCD Zizou_SCD is offline
 
Join Date: Mar 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Are you adverse to using some vb code? I found that there is a function called "fetch_avatar_url" in the includes/functions_user.php file. You pass the userid and it passes back the avatar_url. It's around line 260 of that file. Will that work for you?
To be honest, I thought it would be to difficult to use the vBulletin code in my set up.

Say I have home.php, all it outputs is one div with 5 topic titles, last poster name, and bit of text from the last post (I'll attach the code of the example page). Obviously in the real example there is more on my page, but for the sake of this topic jsut use the home.php I made up. How would the attached code be altered so that I could use the fetch_avatar_url function?

Thanks for all the help so far guys by the way.
Attached Files
File Type: php home.php (2.3 KB, 4 views)
Reply With Quote
  #10  
Old 03-19-2008, 07:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a 'home' page for my site. I read this article to help me make it: https://vborg.vbsupport.ru/showthread.php?t=62164 This allows me to use a vb template to put the 'meat' of my homepage and to use the header and footer templates to make it have the same style as my site. Since I am using the vbulletin global script in it, I have access to all sorts of variables and my guess is it would make your page a lot easier to do if you used it.
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 10:43 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.05274 seconds
  • Memory Usage 2,263KB
  • Queries Executed 12 (?)
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_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete