Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Jan 2015, 14:05
DJ-Dez DJ-Dez is offline
 
Join Date: Jun 2010
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
Reply With Quote
  #2  
Old 22 Jan 2015, 18:05
nerbert nerbert is offline
 
Join Date: May 2008
This is what an avatar image looks like from postbits


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I think you could leave out the dateline, I don't even know what's that's for. The alternative would probably to run a query against the avatar table to get avatarpath. I think you would have to do such a query for each forumbit.

To get a username and userid I think you'll need a plugin in "forumbit_display"


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So an avatar would look like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You may have to experiment around.
Reply With Quote
  #3  
Old 22 Jan 2015, 18:08
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I think you could leave out the dateline, I don't even know what's that's for.
The dateline is so that if a user updates his avatar, browsers will request the new one instead of using the cached one, since the url is otherwise the same.
Reply With Quote
  #4  
Old 22 Jan 2015, 18:26
nerbert nerbert is offline
 
Join Date: May 2008
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
Reply With Quote
  #5  
Old 22 Jan 2015, 18:50
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
  #6  
Old 22 Jan 2015, 19:19
OUTL4W OUTL4W is offline
 
Join Date: May 2013
Are you looking for something similar to this?

http://www.vbulletin.org/forum/showthread.php?t=268855
Reply With Quote
  #7  
Old 22 Jan 2015, 20:57
nerbert nerbert is offline
 
Join Date: May 2008
But it's for vB3. It probably wouldn't be too hard to figure out the HTML changes if the PHP is still compatible.
Reply With Quote
  #8  
Old 22 Jan 2015, 21:13
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
Ummm, this one, http://www.vbulletin.org/forum/showthread.php?t=275406
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forum Home Enhancements vBulletin 5 forumhome_lastpostby for vB3 Dr.Wave vBulletin 3.8 Add-ons 12 07 Oct 2019 22:18
Forum Home Enhancements Alternative 'forumhome_lastpostby' display EWGF vBulletin 3.6 Template Modifications 16 14 Sep 2008 21:20



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 03:08.

Layout Options | Width: Wide Color: