Advertisement:

Author Topic: Avatars on Board and/or MessageIndex  (Read 50775 times)

Offline cuongvttt

  • Semi-Newbie
  • *
  • Posts: 55
    • http://vietnetwork.vn
Re: Avatars on Board and/or MessageIndex
« Reply #180 on: June 13, 2019, 04:29:29 AM »
This is a beautiful mod and it makes website look very lively, bro Pipke.
It' more than perfect if avatars appear on Recent Topic/Post also, can you help me? Thank you so much.



Offline Pipke

  • Full Member
  • ***
  • Posts: 478
    • [NRNS]
Re: Avatars on Board and/or MessageIndex
« Reply #181 on: June 13, 2019, 01:12:20 PM »
It' more than perfect if avatars appear on Recent Topic/Post also, can you help me? Thank you so much.

thx glad you like it,
The answer to your question will be no, because i no longer update the version for smf2.0.x, currently working on a mod update for smf2.1.x, maybe I will add this part to it.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Avatars on Board and/or MessageIndex
« Reply #182 on: August 30, 2019, 09:16:07 AM »
I was wondering if you could help me make this mod work with the Default Avatar mod
so that it will show the default avatars on the boards/child boards, instead of the "blank" default avatar
thank you

Offline Pipke

  • Full Member
  • ***
  • Posts: 478
    • [NRNS]
Re: Avatars on Board and/or MessageIndex
« Reply #183 on: August 31, 2019, 05:48:00 PM »
I was wondering if you could help me make this mod work with the Default Avatar mod
so that it will show the default avatars on the boards/child boards, instead of the "blank" default avatar
thank you

ok here we go, open Sources/abm_code.php

find:
Code: [Select]
$avatar = preg_replace($find[2], ' src="'.$settings['images_url']. '/abm_avatar.gif"', $avatar);
replace with:
Code: [Select]
if(!empty($modSettings['enable_default_avatar']) && !empty($modSettings['default_avatar_url']))
$avatar = preg_replace($find[2], ' src="'.$modSettings['default_avatar_url'].'"', $avatar);
else // No costum url set
$avatar = preg_replace($find[2], ' src="'.$settings['default_images_url'] . '/default_avatar.png"', $avatar);

find:
Code: [Select]
SELECT mem.id_member,
replace with:
Code: [Select]
SELECT mem.id_member, mem.gender,

find:
Code: [Select]
if (empty($avatar))
$avatar = $settings['images_url']. '/abm_avatar.gif';
replace with:
Code: [Select]
if (empty($avatar))
{
// Default
if(!empty($modSettings['enable_default_avatar']) && ($row['gender'] == 0) && !empty($modSettings['default_avatar_url']))
$avatar = $modSettings['default_avatar_url'];
else // No costum url set
$avatar = $settings['default_images_url'] . '/default_avatar.png';
// Male
if(!empty($modSettings['enable_default_avatar']) && ($row['gender'] == 1) && !empty($modSettings['default_male_avatar_url']))
$avatar = $modSettings['default_male_avatar_url'];
// Female
if(!empty($modSettings['enable_default_avatar']) && ($row['gender'] == 2) && !empty($modSettings['default_female_avatar_url']))
$avatar = $modSettings['default_female_avatar_url'];
}

see attached image for result.

uncheck the admin setting from Default Avatar Mod: Makes default avatars transparent when user logs out, as that would need more db queries and will slow down your site, and not really needed anyway.
« Last Edit: August 31, 2019, 06:02:23 PM by Pipke »

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Avatars on Board and/or MessageIndex
« Reply #184 on: September 01, 2019, 12:39:20 AM »
thank you, works perfectly and thanks for the tip about the transparent log off setting