View Full Version : Defining Avatars for different user ids for memberinfo
DJ-Dez
12-24-2014, 12:23 AM
Hey guys,
Merry Christmas everyone.
UPDATE:
Trying a different way. In MEMBERINFO I'm using:
<img src="{vb:raw avatarurl}">
In Plugin Manager I'm using:
require_once('./includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);
vB_Template::preRegister('MEMBERINFO', array('avatarurl' => $avatarurl[0]));
But this only shows my avatar on everyones profile page. How can I define it so when I go to another users profile page it will pick their avatar up and not mine?
Still needing help please!
RichieBoy67
12-24-2014, 02:11 AM
I am not sure what you mean but did you go into usergroup settings and user registration options?
MarkFL
12-24-2014, 02:19 AM
Are your avatars stored in your database or in your file system?
RichieBoy67
12-24-2014, 03:10 AM
Do you mean avatar instead of profile picture or neither of them show up? Did you check use reg options to enable and also usergroup permissions?
Be sure to go into maintenance and update counters after you change settings for the users.
DJ-Dez
12-24-2014, 03:19 AM
Are your avatars stored in your database or in your file system?
file system.
I need a code to put in MEMBERINFO to take the avatar and not the profile picture, but when it does take the avatar it does it by thumbnail
MarkFL
12-24-2014, 03:40 AM
A down and dirty fix would be to go to your "memberinfo_block_ministats" template, and near the bottom locate:
<img src="{vb:raw prepared.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw prepared.username}}" {vb:raw prepared.avatarsize} id="user_avatar" />
and replace it with:
<img src="{vb:raw prepared.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw prepared.username}}" id="user_avatar" onload="this.src = this.src.replace(/\/thumbs/,'');" />
This will replace the src attribute of the avatar with the URL of the full-sized avatar.
DJ-Dez
12-24-2014, 04:33 AM
How would I display block ministats in memberinfo?
{vb:raw blocks.ministats}
Thank you Mark and Merry Christmas :)
MarkFL
12-24-2014, 04:58 AM
How would I display block ministats in memberinfo?
{vb:raw blocks.ministats}
Thank you Mark and Merry Christmas :)
I'm not real sure yet exactly what you are trying to do here. It is my understanding that the set of memberinfo templates all work together.
I am under the impression that you want a user's avatar to display on their profile page full size rather than the thumbnail version. A better solution than the one I quickly offered would be to write a plugin to fetch the user's avatar URL, and define a variable to contain it, and then register it in the correct template.
Can you elaborate on exactly what you are wanting to accomplish? :)
DJ-Dez
12-24-2014, 05:19 AM
Trying a different way. In MEMBERINFO I'm using:
<img src="{vb:raw avatarurl}">
In Plugin Manager I'm using:
require_once('./includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);
vB_Template::preRegister('MEMBERINFO', array('avatarurl' => $avatarurl[0]));
But this only shows my avatar on everyones profile page. How can I define it so when I go to another users profile page it will pick their avatar up and not mine?
Thank you
MarkFL
12-24-2014, 06:30 AM
Yeah, I faced a similar issue recently but was able to hack an existing plugin which already had the userids I needed defined.
I will be interested to see how this can be done, as I am still really inexperienced with writing plugins and am trying to learn from the masters here.
One suggestion I would make to aid you in getting help more promptly would be to edit the first post, and change the title so that it briefly describes your question. ;)
DJ-Dez
12-24-2014, 12:05 PM
Yeah, I faced a similar issue recently but was able to hack an existing plugin which already had the userids I needed defined.
I will be interested to see how this can be done, as I am still really inexperienced with writing plugins and am trying to learn from the masters here.
One suggestion I would make to aid you in getting help more promptly would be to edit the first post, and change the title so that it briefly describes your question. ;)
no worries, thanks for your help :)
Try using $userinfo in place of $vbulletin->userinfo in your plugin.
DJ-Dez
12-24-2014, 12:42 PM
Try using $userinfo in place of $vbulletin->userinfo in your plugin.
this worked, you the man!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.