The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
forumhome_lastpostby
Heya guys,
How would you display a users avatar in this template? I've tried plugins but the others are not that good and not what I need sadly, so decided to do it myself. Any ideas what raw code would work to display the avatar of the last posting user? Thx |
#2
|
|||
|
|||
This is what an avatar image looks like from postbits
Code:
<img src="image.php?u=100&dateline=1309261189" alt="JoeBlow's Avatar" title="JoeBlow's Avatar"> To get a username and userid I think you'll need a plugin in "forumbit_display" Code:
$forum['lastposterid'] = $lastpostinfo['lastposterid']; $forum['lastposter'] = $lastpostinfo['lastposter']; Code:
<img src="image.php?u={vb:raw forum.lastposterid}" alt="{vb:raw forum.lastposter}'s Avatar" title="{vb:raw forum.lastposter}'s Avatar"> |
#3
|
|||
|
|||
Quote:
|
#4
|
|||
|
|||
That makes sense. But how would you get it without a query against the avatar table? The whole forum.php page seems to be constructed entirely from $vbulletin->forumcache without any query you could put a JOIN into.
I suppose the browser cache would be up to date from the last viewing of showthread |
#5
|
|||
|
|||
Well yeah, you're right, to do it right you'd need to do a query for each user. Or really you could call fetch_userinfo() with the FETCH_USERINFO_AVATAR parameter, that will do the query for you or get it from the cache if it's there.
What you posted above might be good enough. Maybe it doesn't matter if the avatar doesn't update on that page right away. |
#7
|
|||
|
|||
But it's for vB3. It probably wouldn't be too hard to figure out the HTML changes if the PHP is still compatible.
|
#8
|
||||
|
||||
Ummm, this one, https://vborg.vbsupport.ru/showthread.php?t=275406
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|