PDA

View Full Version : vbCMS comments displaying profile picture not the avatar


kinhell
04-15-2011, 11:07 PM
Anyone know how I can change this so it displays the users avatar not their profile picture please?

Lynne
04-16-2011, 02:53 AM
The comments show the avatar, not the profile picture. So, do you mean you want to switch it to show the profile picture instead? What version vB are you running?

kinhell
04-16-2011, 12:29 PM
Hi Lynne thanks for the reply

On our site the comments show the profile picture (tried in default style and our current style)

Id like it to show the avatar as intended

Version is 4.1.3

Not sure how this has happened?

Lynne
04-16-2011, 04:43 PM
It only shows the profile picture if the user doesn't have an avatar. If the user has an avatar, then it should show the avatar.

If you want to change the code for this, edit packages/vbcms/comments.php around line 644

kinhell
04-16-2011, 05:58 PM
Strange as we all have avatars but it still shows the profile picture, Ill look at the code.

--------------- Added 1302981101 at 1302981101 ---------------

What would I need to change?

if (!$post['hascustomavatar'])
{
if ($post['profilepic'])
{
$post['hascustomavatar'] = 1;
$post['avatarid'] = true;
$post['avatarpath'] = "image.php?" . vB::$vbulletin->session->vars['sessionurl'] . "u=" . $post['userid'] . "&dateline=" . $post['profilepicdateline'] . "&type=profile";
$post['avwidth'] = $post['ppwidth'];
$post['avheight'] = $post['ppheight'];
}
else
{
$post['hascustomavatar'] = 1;
$post['avatarid'] = true;
// explicity setting avatarurl to allow guests comments to show unknown avatar
$post['avatarurl'] = $post['avatarpath'] = vB_Template_Runtime::fetchStyleVar('imgdir_misc') . '/unknown.gif';
$post['avwidth'] = 60;
$post['avheight'] = 60;
}
}

Shuurajou
04-16-2011, 06:20 PM
Worth noting that when you view the comments forum the posts have avatars showing, just on the CMS page it's showing the profile pics.

Lynne
04-16-2011, 07:58 PM
Disable all Products except the vBulletin Blog and vBulletin CMS (Admin CP -> Plugins & Products -> Manage Products -> Disable) AND uncheck all the plugins except those related to the vBulletin Blog and vBulletin CMS by (Admin CP -> Plugins & Products -> Plugin Manager). You must do BOTH of those steps in order to disable all non vBulletin Modifications. Then see if the profile image is still showing instead of the avatars (you will need to do a force refesh to check).

kinhell
04-16-2011, 10:45 PM
Done what you said above, but it had no effect. The comments still showed the profile picture and not the avatar. If I copy the profile image URL on the comments page it links to http://www.mysite.com/image.php?u=15&dateline=1300995847&type=profile for example.

Lynne
04-16-2011, 11:24 PM
And you have the usergroups set to be allowed to upload their own custom avatars?

Have you modified that template at all?

kinhell
04-16-2011, 11:53 PM
Usergroups are currently set to not be able to upload custom avatars, avatars are chosen from a list of preuploaded ones

Does that make a difference?

Not modified the template.

Lynne
04-17-2011, 02:39 AM
Yes, that makes a difference if you look at the code (and the code above there that defines hascustomavatar if the user has a customavatar). If custom avatar - custom avatar is shown. If they don't have a custom avatar - the profile image is shown. Otherwise, the unknown.gif is shown.

kinhell
04-17-2011, 02:51 PM
So it wont show avatars that have been selected from our forum selection?

Lynne
04-17-2011, 03:52 PM
Correct.

kinhell
04-17-2011, 09:26 PM
Ok thanks, sorted then.