![]() |
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 * 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> |
Take a look at what is done in the function: fetch_avatar_url().
|
Quote:
|
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.)
|
Quote:
|
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? |
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.
|
All times are GMT. The time now is 03:35 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|