vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Finding Avatar Paths (https://vborg.vbsupport.ru/showthread.php?t=173401)

Zizou_SCD 03-18-2008 03:15 PM

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?

Brandon Sheley 03-18-2008 06:04 PM

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

like here..

https://vborg.vbsupport.ru/

Jase2 03-18-2008 06:29 PM

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 :)

Zizou_SCD 03-18-2008 10:21 PM

Quote:

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

like here..

http://www.vbulletin.org/custompics/...tar80028_6.gif

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

Quote:

Originally Posted by Jase2 (Post 1468097)
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?

Lynne 03-18-2008 11:44 PM

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.

Zizou_SCD 03-19-2008 09:10 AM

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?

Lynne 03-19-2008 03:02 PM

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?

Boofo 03-19-2008 03:11 PM

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.

Zizou_SCD 03-19-2008 04:11 PM

1 Attachment(s)
Quote:

Originally Posted by Lynne (Post 1468747)
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.

Lynne 03-19-2008 07:42 PM

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.


All times are GMT. The time now is 02:03 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.01213 seconds
  • Memory Usage 1,732KB
  • 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_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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