Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Apr 2010, 21:25
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
how to get avatar url?

I made a template and a custom page but right now it will not show the avatar. Could anyone help me out as to how I can get the avatar url?

This is the current code I'm using in the src attribute

image.php?u=$hallOfFameEntries[userid]

I use a custom query to get the user id.
__________________


Were your Naruto Soul comes to place..


Last edited by pein87; 23 Apr 2010 at 21:31.
Reply With Quote
  #2  
Old 02 May 2012, 17:10
brandondrury brandondrury is offline
 
Join Date: Oct 2005
It looks like this changed in vb4 as the image.php?u=$userid method worked fine for me in vB3.

Anyone know the URL/variable for this in vB4?

Brandon
__________________
Home Recording Forum

Brandon
Reply With Quote
  #3  
Old 02 May 2012, 19:21
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Actually I think it still works just like it did in 3.x- but the thing is it only works if avatars are stored in the database. If avatars are in the file system it won't work with either.

I'm pretty sure there is no URL- it is an often asked, never answered, question. Someone posted a function to get it (via a query) once but I don't remember anything else about it.


check out this link-
https://www.vbulletin.com/forum/show...o-CMS-Articles
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #4  
Old 03 May 2012, 00:38
souperman souperman is offline
 
Join Date: Mar 2011
You can get the user avatarrevision and locate the file if it's stored on the hdd.


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

That's just the gist, here how I would do it:
Check if the user has an avatarid
If user has avatarid, then get the fileurl of the avatar from the avatar table
if user doesn't have an avatarid (avatarid = 0), then check if user has an avatarrevision > 0
if avatarrevision > 0 then you can get the url path from my code above using the userid and avatarrevision
if avatarrevision == 0 and avatarid ==0, then user has no avatar and display the no avatar url

Hope my pseudo code helps you out.

--------------- Added 03 May 2012 at 00:46 ---------------

Here's what I use in one of my external scripts:


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

In my case, the avartarid is the given. To make it fit your purpose I would do a LEFT join on the customavatar table to get the avatarid and any other useful info.

I would recommend to do the join on the query that's already getting your user information to save resources. If you post your query I can help you out with that.
Reply With Quote
  #5  
Old 03 May 2012, 13:27
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Why would all Avatars be .gif files?
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
Reply



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 11:48.

Layout Options | Width: Wide Color: