The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
Why would you want to do this ?
Can you just right click on the image and check the path ? like here.. |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
Quote:
Quote:
Any ideas anyone? |
#5
|
||||
|
||||
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.
|
#6
|
|||
|
|||
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; |
#7
|
||||
|
||||
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?
|
#8
|
||||
|
||||
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.
|
#9
|
|||
|
|||
Quote:
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. |
#10
|
||||
|
||||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|