The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How Do You Add user Avatar image on homepage WGO box
I've done several searches and cannot find a solution. I'm Running vb4.1.0 Forum only.
Here is an example of what I'm trying to accomplish. |
#2
|
|||
|
|||
Any takers?
|
#3
|
||||
|
||||
Sure, I'll bite.
AdminCP -> Products & Plugins -> Add New Plugin Leave the Product as vBulletin (unless you wanted to make this a product, heh). Select forumhome_loggedinuser for the Hook Location. For the name, put something like "The Amazingly Awesome Sarteck's WGO-Avatar Plugin" or whatever. For the PHP code, try the following: PHP Code:
Badabing, that's it. --------------- Added [DATE]1342674039[/DATE] at [TIME]1342674039[/TIME] --------------- ----------------- Actually, scratch that... Avatar thumbs would get cached like that. If you don't mind the caching, leave it as is. If you want to make sure the new image is displayed whenever someone changes their avatar, use this instead: PHP Code:
Awesome username, btw. --------------- Added [DATE]1342675184[/DATE] at [TIME]1342675184[/TIME] --------------- Anudder update to that code for ya. If you wanted to force a certain size, add style="max-width:40px;max-height:40px;" to the image tag. Change "40px" to whatever size you want. |
#4
|
|||
|
|||
I would love to change my username if possible (I've asked in the past but no dice). I will try this amazingly awesome plugin and update with my results. Thank you Sarteck YOU ROCK!
--------------- Added [DATE]1342758879[/DATE] at [TIME]1342758879[/TIME] --------------- It works! But, is there a way to only display users with avatars or skip users without a avatar? |
#5
|
||||
|
||||
Hmmm. I am sure there is, but I don't know it right at the moment. I'll have to look into it some, unless someone else can give ya the answer before me.
--------------- Added [DATE]1342760313[/DATE] at [TIME]1342760313[/TIME] --------------- Okay, we need to make another plugin on forumhome_loggedinuser_query. This one needs to have the following: PHP Code:
Now, we edit the old plugin we made earlier to use THIS PHP instead: PHP Code:
What THAT one does is checks to see if the user has an avatar (a pre-set one from whatever you provide them as an Admin OR a custom one). That -should- do it... But if you suddenly get Database Errors when you enable this, just kill that plugin what adds to the database lookup, because it means I mistyped soemthing. XP |
#6
|
|||
|
|||
I made the changes you provided above (also couldnt force the width and height). I added another screen shot to help explain.
|
#7
|
||||
|
||||
Yup, I get ya. XD Replied above with a solution.
BTW, if you do not want names to display for those without avatars, but instead a default image that you can choose, try this in the plugin instead: PHP Code:
|
#8
|
|||
|
|||
Thanks for the help and effort. It's working for me now, thank you! I just need to figure a few things out before I get it looking the way I want.
Example: Nothing displays for Invisible users and I would like to learn how to remove the "*" & "," from here. BTW When searching for this solution I ran into quite a few other people asking how to do this. I'm sure this thread will become useful to others. |
#9
|
||||
|
||||
UPDATE:
Two plugins. Name: Avatar --> WGO [Database Query] Location: forumhome_loggedinuser_query PHP Code:
Name: Avatar --> WGO [Display] Location: forumhome_loggedinuser PHP Code:
Check out the comments so you know what to change. EDIT: Posted this before I saw your response. I'll check that out in a minute. EDIT2: Ah, the new stuff I put here already solves that, I think. |
#10
|
|||
|
|||
Database error in vBulletin 4.1.10:
Invalid SQL: SELECT user.username, (user.options & 512) AS invisible, user.usergroupid, user.lastvisit, session.userid, session.inforum, session.lastactivity, session.badlocation, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid , avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar , avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar FROM session AS session LEFT JOIN user AS user ON(user.userid = session.userid) LEFT JOIN avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON (customavatar.userid = user.userid) LEFT JOIN avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON (customavatar.userid = user.userid) WHERE session.lastactivity > 1342763809 ORDER BY username ASC; MySQL Error : Not unique table/alias: 'avatar' Error Number : 1066 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|