The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Show Avatars on custom vB page? Do I need to query the db?
I built a custom vB page that has a query to get user data from the db. If I wanted to include avatars on that page, would I have to modify the query to include avatar data? This is for 3.8.
Here's the existing query: Code:
$users=$db->query("SELECT * FROM " . TABLE_PREFIX . "user AS user, " . TABLE_PREFIX . "userfield AS userfield WHERE user.userid = userfield.userid ORDER BY $orderby $direction LIMIT $pos,$perpage"); Code:
<if condition="$show['avatar']"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /><br></if> |
#2
|
||||
|
||||
Take a look at what is done in the function: fetch_avatar_url().
|
#3
|
|||
|
|||
Which file would I find that in? function_user.php?
|
#4
|
||||
|
||||
Yep. A good idea is to also keep a mass search tool handy - this allows you to find things quickly. (Many editors have this feature.)
|
#5
|
|||
|
|||
I guess I could have done a mass search in Homesite or Dreamweaver.... sorry.
|
#6
|
|||
|
|||
Just a follow up to this question...
I added a require statement to the custom vb file I have, pulling in function_user.php. Shouldn't I now be able to use the same variables in my templates that function_user.php uses so that I can pull in the avatar that way? |
#7
|
||||
|
||||
functions_user.php does not run any code when you include it. It is merely a library of functions that allow you to fetch and manipulate data about the user. Alternatively, you could simply have a look at what fetch_avatar_url() does, and "merge" the query with your own; removing the use of functions_user.php altogether.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|