Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Pipke on April 05, 2016, 06:27:00 PM

Title: Avatars on Board and/or MessageIndex
Post by: Pipke on April 05, 2016, 06:27:00 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4107)

Avatars on Board and/or MessageIndex

For SMF 2.0.x
Same mod for SMF 2.1.* can be found here (https://custom.simplemachines.org/mods/index.php?mod=4246)

This mod will display the avatar of last poster in Board(Child)Index and or the avatar of first and or last poster of topics in MessageIndex.
Extra setting: Display topic starter time in MessageIndex.


Hook install

Tested only with the SMF default theme...but should work with other themes aswell!

License

* This SMF modification is subject to the BSD 2-Clause License
* Which can be found here (http://opensource.org/licenses/BSD-2-Clause)

Settings

- Admin->Configuration->Modification Settings->Avatars on Board/MessageIndex

Languages

- English/utf8
- Spanish_latin/utf8 by Rock Lee (http://www.simplemachines.org/community/index.php?action=profile;u=322597)

Changelog

Version 2.0.17 - Jan 3, 2020
- Fixed: Script proxy for external avatar urls

Version 2.0 - Dec 28, 2017
- Fixed: Illegal string offset 'value' (due > PHP 7.1)
- Added: Proxy for external avatar urls

Version 1.9 - May 18, 2017
- Fixed: More Undefined index and Undefined offset errors

Version 1.8 - Jan 10, 2017
- Fixed: Admin setting "Show avatar of last poster on the BoardIndex"

Version 1.7 - Sep 01, 2016
- Fixed: The 'abm_id={}' text in subject column when avatar path is fault or been removed from server

Version 1.6 - Aug 20, 2016
- Fixed: Mod messed up array for template when Board has Child in Child and deeper Child etc.
- Fixed: The 'abm_id={}' text in last column when avatar path is fault or been removed from server

Version 1.5 - Jul 14, 2016
- Fixed: Last post link icon to topic was unclickable
- Fixed: The 'abm' text in last column on other costum themes!
- Fixed: Database error, given array of integer values is empty
- Fixed: Some undefined index errors

Version 1.4 - Jul 12, 2016
- New: Fully 'Hook' Mod
- Fixed: Query messed up the array output when id of poster was quest or deleted/removed
- Added: You can set the size of the avatars
- Added: You can change the width of the output column to make room for avatar
- Added: Avatar stays in center/equal to column/output text
- Added: SMF 'global' avatars can be set with round borders!
- Added: Avatars now display also on unread posts and new replies index

Version 1.0 - April 03, 2016
- Initial Release
Title: Re: Avatars on Board and/or MessageIndex
Post by: RockLee on April 05, 2016, 07:21:03 PM
A really great job this change had something different when you need it but I think more than one will leave you the translation into Latin Spanish I hope you help :D


Regards!
Title: Re: Avatars on Board and/or MessageIndex
Post by: JBlaze on April 05, 2016, 07:46:51 PM
Great work, Pipke!
Title: Re: Avatars on Board and/or MessageIndex
Post by: OCJ on April 05, 2016, 11:15:04 PM
I have a problem but maybe it is because I store member avatars as png files in another folder. That is an accepted method on SMF.

You can see the screenshot with missing avatars replaced by question mark.

It was also showing my avatar instead of the last poster inside the board with view of topics list.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 06, 2016, 03:05:04 AM
Quote from: igirisjin on April 05, 2016, 11:15:04 PM
I have a problem but maybe it is because I store member avatars as png files in another folder. That is an accepted method on SMF.

You can see the screenshot with missing avatars replaced by question mark.

It was also showing my avatar instead of the last poster inside the board with view of topics list.

ill check that later if i can do something about that.
Title: Re: Avatars on Board and/or MessageIndex
Post by: OCJ on April 06, 2016, 03:53:29 AM
It was given quite a bit of promotion as a way of improving performance - several posts on the site about it.

This is in the SMF wiki - official. The first suggestion:
http://wiki.simplemachines.org/smf/Performance_enhancements

QuoteBasic Improvements

Just about anyone can make use of these optimizations, regardless of how much control you have over your server. The first few options here can have an extremely dramatic effect on your server's performance, I've sorted them roughly in order of potential impact.
Move your uploaded avatars directory


In the administration panel, go to Attachments and Avatars, and then go to Avatar settings.

For Upload avatars to... select: Specific directory... For Upload directory: put in the raw, publicly accessible server directory you want them added to ie /var/www/yoursite/docs/forums/avs

So assuming /docs was your webroot, you would put /forums/avs for your upload URL. Do not do what I did and make it a subdirectory of your main avatars directory, SMF still handles it like an attachment directory for some reason so if someone uploads a .png avatar, someone else decides to use it and the first person replaces it with a .jpg avatar, the first will be deleted.

The benefit of this borders on the ridiculous
. Every single avatar load is another php call, which loads a session, the user's settings and permissions, the board and its theme. In addition, two additional calls to the database are made to load the avatar itself, and to increment the view counter. So not only are you reducing the processor load on your server, but you are also reducing your database load. If five different avatars are displayed on a page, that's five additional php calls and dozens of database queries getting made.
Title: Re: Avatars on Board and/or MessageIndex
Post by: nend on April 06, 2016, 08:50:23 AM
Quote from: Pipke on April 06, 2016, 03:05:04 AM
Quote from: igirisjin on April 05, 2016, 11:15:04 PM
I have a problem but maybe it is because I store member avatars as png files in another folder. That is an accepted method on SMF.

You can see the screenshot with missing avatars replaced by question mark.

It was also showing my avatar instead of the last poster inside the board with view of topics list.

ill check that later if i can do something about that.

Take a look here.
http://www.simplemachines.org/community/index.php?topic=232539.msg3841891#msg3841891

I  shared this awhile back with VB, his mod does attachments, my site does that along with embeds, avatars and images. It is a fallback method. ;)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 06, 2016, 02:41:14 PM
Quote from: igirisjin on April 05, 2016, 11:15:04 PM
It was also showing my avatar instead of the last poster inside the board with view of topics list.

Fixed this with update. Latest version is now 1.1
Title: Re: Avatars on Board and/or MessageIndex
Post by: morris91 on April 06, 2016, 02:53:50 PM
even with 1.1 i still get blank avator images on my main board. in the categorys its fine but on the index this still happends.

Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 06, 2016, 02:57:10 PM
Quote from: morris91 on April 06, 2016, 02:53:50 PM
even with 1.1 i still get blank avator images on my main board. in the categorys its fine but on the index this still happends.



can you post your website url so i can take look whats going on?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 06, 2016, 06:28:48 PM
Quote from: Pipke on April 06, 2016, 03:05:04 AM
Quote from: igirisjin on April 05, 2016, 11:15:04 PM
I have a problem but maybe it is because I store member avatars as png files in another folder. That is an accepted method on SMF.

You can see the screenshot with missing avatars replaced by question mark.

ill check that later if i can do something about that.

fixed, latest version is now 1.2
Title: Re: Avatars on Board and/or MessageIndex
Post by: morris91 on April 06, 2016, 08:10:36 PM
Quote from: Pipke on April 06, 2016, 02:57:10 PM
Quote from: morris91 on April 06, 2016, 02:53:50 PM
even with 1.1 i still get blank avator images on my main board. in the categorys its fine but on the index this still happends.



can you post your website url so i can take look whats going on?

http://ultrastunting.net/index.php

Also updated to 1.2.
Title: Re: Avatars on Board and/or MessageIndex
Post by: DSystem on April 06, 2016, 08:45:35 PM
Brazil Portuguese translation attached.
Title: Re: Avatars on Board and/or MessageIndex
Post by: DSystem on April 06, 2016, 08:49:26 PM
With this amendment the mod is compatible with as many themes.

<search position="after"><![CDATA[<a href="', $topic['last_post']['href']]]></search>
<add><![CDATA[';
if (($modSettings['abm_messageindex'] == 'last') || ($modSettings['abm_messageindex'] == 'both'))
{
if ((filter_var($topic['last_post']['member']['avatar'], FILTER_VALIDATE_URL) === false) || (empty($topic['last_post']['member']['avatar'])))
echo'', $topic['last_post']['member']['id'] ? '<a href="' .$topic['last_post']['member']['href']. '">' : '', '<img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'.$settings['images_url']. '/abm_avatar.gif" alt="[?]" />', $topic['last_post']['member']['id'] ? '</a>' : '';
else
echo'<a href="' ,$topic['last_post']['member']['href'], '"><img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'. $topic['last_post']['member']['avatar'].'" alt="[?]" /></a>';
}
echo']]></add>
</operation>


After that had no additional themes installation error. ;)
Title: Re: Avatars on Board and/or MessageIndex
Post by: OCJ on April 06, 2016, 09:42:37 PM
Thanks, its an improvement. Not quite there yet.

The topic poster is displaying a [?]  on the left, and previous members also same rather than a default avatar.
Title: Re: Avatars on Board and/or MessageIndex
Post by: OCJ on April 06, 2016, 09:52:19 PM
And something else. I thought the display was a bit odd as only 8 topics displayed. On the second page it was almost blank. After uninstall it was fine again.
Title: Re: Avatars on Board and/or MessageIndex
Post by: morris91 on April 06, 2016, 11:14:56 PM
Quote from: DSystem on April 06, 2016, 08:49:26 PM
With this amendment the mod is compatible with as many themes.

<search position="after"><![CDATA[<a href="', $topic['last_post']['href']]]></search>
<add><![CDATA[';
if (($modSettings['abm_messageindex'] == 'last') || ($modSettings['abm_messageindex'] == 'both'))
{
if ((filter_var($topic['last_post']['member']['avatar'], FILTER_VALIDATE_URL) === false) || (empty($topic['last_post']['member']['avatar'])))
echo'', $topic['last_post']['member']['id'] ? '<a href="' .$topic['last_post']['member']['href']. '">' : '', '<img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'.$settings['images_url']. '/abm_avatar.gif" alt="[?]" />', $topic['last_post']['member']['id'] ? '</a>' : '';
else
echo'<a href="' ,$topic['last_post']['member']['href'], '"><img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'. $topic['last_post']['member']['avatar'].'" alt="[?]" /></a>';
}
echo']]></add>
</operation>


After that had no additional themes installation error. ;)

i thought i would try this amendment . get errors but installed anyway. everything works still but the icon problem i stated above now no longer appear at all.
Title: Re: Avatars on Board and/or MessageIndex
Post by: JerzyLS on April 07, 2016, 04:01:41 AM
On the index is working fine.
http://spolecznosc.bialenia.org.pl/index.php

But in the boards on child boards not.
http://spolecznosc.bialenia.org.pl/index.php?board=2.0

How to solve it?
Title: Re: Avatars on Board and/or MessageIndex
Post by: JerzyLS on April 07, 2016, 07:08:23 AM
Okay, here is the solution for child boards.

Themes/default/MessageIndex.template

Find:

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';


And replace:

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
$abm_img_style = 'width:42px; height: 42px; float:left; margin-right: 6px; padding: 0px;';
if (!empty($modSettings['abm_boardindex']))
{
if ((filter_var($board['last_post']['member']['avatar'], FILTER_VALIDATE_URL) === false) || (empty($board['last_post']['member']['avatar'])))
echo'', $board['last_post']['member']['id'] ? '<a href="' .$board['last_post']['member']['href']. '">' : '', '<img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'.$settings['images_url']. '/abm_avatar.gif" alt="[?]" />', $board['last_post']['member']['id'] ? '</a>' : '';
else
echo'<a href="' ,$board['last_post']['member']['href'], '"><img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'. $board['last_post']['member']['avatar'].'" alt="[?]" /></a>';
}
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';

Title: Re: Avatars on Board and/or MessageIndex
Post by: JerzyLS on April 07, 2016, 02:03:46 PM
Some errors in logs:

8: Undefined variable: abm_img_style
/Themes/default/BoardIndex.template.php
Line: 376

356: // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
357: echo '
358: <strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
359: <p id="infocenter_onepost" class="middletext">
360: ', $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
361: </p>';
362: }
363: // Show lots of posts.
364: elseif (!empty($context['latest_posts']))
365: {
366: echo '
367: <dl id="ic_recentposts" class="middletext">';
368:
369: /* Each post in latest_posts has:
370: board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
371: subject, short_subject (shortened with...), time, link, and href. */
372: foreach ($context['latest_posts'] as $post)
373: echo '
374: <dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
375: <dd>', $post['time'], '</dd>';
==>376: echo '
377: </dl>';
378: }
379: echo '
380: </div>';
381: }

8: Undefined variable: board
Themes/default/BoardIndex.template.php
Linia: 375

358: <strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
359: <p id="infocenter_onepost" class="middletext">
360: ', $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
361: </p>';
362: }
363: // Show lots of posts.
364: elseif (!empty($context['latest_posts']))
365: {
366: echo '
367: <dl id="ic_recentposts" class="middletext">';
368:
369: /* Each post in latest_posts has:
370: board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
371: subject, short_subject (shortened with...), time, link, and href. */
372: foreach ($context['latest_posts'] as $post)
373: echo '
374: <dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
==>375: <dd>', $post['time'], '</dd>';
376: echo '
377: </dl>';
378: }
379: echo '
380: </div>';
381: }
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 07, 2016, 05:13:01 PM
Quote from: Rock Lee [BC] on April 05, 2016, 07:21:03 PM
A really great job this change had something different when you need it but I think more than one will leave you the translation into Latin Spanish I hope you help :D


Regards!

thank you ;)

Quote from: DSystem on April 06, 2016, 08:45:35 PM
Brazil Portuguese translation attached.

thank you ;)

Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 07, 2016, 05:16:33 PM
Quote from: JerzyLS on April 07, 2016, 07:08:23 AM
Okay, here is the solution for child boards.

Themes/default/MessageIndex.template

Find:

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';


And replace:

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
$abm_img_style = 'width:42px; height: 42px; float:left; margin-right: 6px; padding: 0px;';
if (!empty($modSettings['abm_boardindex']))
{
if ((filter_var($board['last_post']['member']['avatar'], FILTER_VALIDATE_URL) === false) || (empty($board['last_post']['member']['avatar'])))
echo'', $board['last_post']['member']['id'] ? '<a href="' .$board['last_post']['member']['href']. '">' : '', '<img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'.$settings['images_url']. '/abm_avatar.gif" alt="[?]" />', $board['last_post']['member']['id'] ? '</a>' : '';
else
echo'<a href="' ,$board['last_post']['member']['href'], '"><img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'. $board['last_post']['member']['avatar'].'" alt="[?]" /></a>';
}
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';



thx for letting me know, i missed this one!!  :P

Quote from: igirisjin on April 06, 2016, 09:42:37 PM
Thanks, its an improvement. Not quite there yet.

The topic poster is displaying a [?]  on the left, and previous members also same rather than a default avatar.


should be fixed in v1.3 wich is the latest for now i hope  :o , otherwise shoot me lol.
Title: Re: Avatars on Board and/or MessageIndex
Post by: DSystem on April 07, 2016, 09:12:03 PM
@Pipke,  It was perfect

1.3 version working 100% -> http://eletronicabr.com/treinamento-eletronica/16/50

It would be great avatars in unread:

Recent.php
Recent.template.php

Title: Re: Avatars on Board and/or MessageIndex
Post by: OCJ on April 07, 2016, 11:15:35 PM
Well, the first poster is working now on my site but there is a problem.

Only 8 topics show on the board index (set for something like 30). On the second page almost everything does not display - all titles gone. It does not process previous members whose accounts have been closed but name still displays - they are still [?].
That is maybe where it fails as it stops at the no.8 topic with a (last) reply from previous member.
On the 2nd page there is another previous member last reply in the first topic and the board is trashed after that.
Any combination of mod settings produce it.

Andy
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wellwisher on April 20, 2016, 02:03:54 AM
Quote from: Pipke on April 07, 2016, 05:16:33 PM
Quote from: JerzyLS on April 07, 2016, 07:08:23 AM
Okay, here is the solution for child boards.

Themes/default/MessageIndex.template

Find:

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';


And replace:

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
$abm_img_style = 'width:42px; height: 42px; float:left; margin-right: 6px; padding: 0px;';
if (!empty($modSettings['abm_boardindex']))
{
if ((filter_var($board['last_post']['member']['avatar'], FILTER_VALIDATE_URL) === false) || (empty($board['last_post']['member']['avatar'])))
echo'', $board['last_post']['member']['id'] ? '<a href="' .$board['last_post']['member']['href']. '">' : '', '<img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'.$settings['images_url']. '/abm_avatar.gif" alt="[?]" />', $board['last_post']['member']['id'] ? '</a>' : '';
else
echo'<a href="' ,$board['last_post']['member']['href'], '"><img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'. $board['last_post']['member']['avatar'].'" alt="[?]" /></a>';
}
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';



thx for letting me know, i missed this one!!  :P

Quote from: igirisjin on April 06, 2016, 09:42:37 PM
Thanks, its an improvement. Not quite there yet.

The topic poster is displaying a [?]  on the left, and previous members also same rather than a default avatar.


should be fixed in v1.3 wich is the latest for now i hope  :o , otherwise shoot me lol.

Wasn't working for me but after I introduced this code, it only showed up in the child boards. Am I missing something? Do I have to set permissions or what? Also seeing some "?" next to some avatars in child boards.  Like @igirisjin mentioned. ???
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 20, 2016, 07:38:07 AM
@Wellwisher can you post your site url(with mod installed), so i can take look?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wellwisher on April 20, 2016, 03:27:17 PM
Quote from: Pipke on April 20, 2016, 07:38:07 AM
@Wellwisher can you post your site url(with mod installed), so i can take look?

Much respect @Pipke but I always run new mods locally to test against my latest live production set-up.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 20, 2016, 04:03:53 PM
Quote from: Wellwisher on April 20, 2016, 03:27:17 PM
Quote from: Pipke on April 20, 2016, 07:38:07 AM
@Wellwisher can you post your site url(with mod installed), so i can take look?

Much respect @Pipke but I always run new mods locally to test against my latest live production set-up.

Wich setting are you using for your profile avatar...
-No avatar
-Choose avatar from gallery
-Specify avatar by URL
-Upload an avatar

url your using for avatar? etc wich folder you use etc?
Well i'm not a mind taker, if i dont get more details i cannot help?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 20, 2016, 05:28:56 PM
To all who use my mod and see [?] instead of an avatar on there board(child)messageindex, the most common possible problem is that the particular user used in on his/her profile setting avatar to 'Upload an avatar' and used a link/url to a picture/image wich does not exists anymore(deleted or removed from the host) or has no link/url added in the input box, solution to fix that (so no more display [?]) is set the users profile avatar to 'No avatar' or ask the user in question to change the url.
Title: Re: Avatars on Board and/or MessageIndex
Post by: nend on April 21, 2016, 12:54:53 AM
@ Pipke, I would suggest a fallback avatar. I know it is impossible to check every avatar, but here is a little trick I have done.

First you don't want to use the img tag, you want to use a div. With the div you can put a style tag in it with two background images, one will be the users avatar URL and the other will be a generic avatar. So if the first one doesn't load it will fall through to the generic.

Also be sure to set the div and image demensions accordingly and I would suggest only using this for linked avatars. ;)

*edit
I would also suggest putting the fallback in a class in the CSS.
Title: Re: Avatars on Board and/or MessageIndex
Post by: foropimiento on April 26, 2016, 06:06:23 AM
I have a problem with de installation...

in the last modification, give me an error

cant find:
<td class="lastpost ', $alternate_class, '">

what can I do?

thanks..
Title: Re: Avatars on Board and/or MessageIndex
Post by: NukeWorker.com on April 26, 2016, 11:08:19 PM
When I install this mod, for some weird reason it hides all but sticky topics in some boards.

Makes me sad, because I like this mod.  Looks nice.  Just can't use it if it hides thousands of posts.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wellwisher on April 27, 2016, 02:59:54 AM
Really wanted this mod to work, but it's too much hassle for me to tinker around with and get it working. Also I feel it's another "over-kill", for it to show a simple avatar on the display.template.php and index.template.php?

I could come up with a mod but the approval process's a joke and I code for thrills.  :P Which is one of the reason I now just stick everything in "Tips & Tricks board"... but even my simple article based on html and css took 3 days to approve. It was rejected at first because I put the css on the top instead of the bottom.  Like seriously wth?  ::)

Seems like if and when the mods are released, they don't work properly. :laugh: Luckily we dont need to blame the developers, just blame the the Mod who approved it.  :P
Title: Re: Avatars on Board and/or MessageIndex
Post by: nend on April 29, 2016, 08:55:11 AM
Usually all software has unforeseen bugs. In every app store devs release patches all the time. This is also the same for OS'es and even peripherals.

As with them, no problems where discovered during this mods testing phase.

Please also note there has been code changes since this mods initial review. We do not review code changes after a mod has been accepted onto the mod site.

If there is a security issue, users have the ability to report the issue and then we will do our best to get the issue resolved. Until then a modification with problems security wise, would be first pulled from the mod site and the mod author will be given the opportunity to fix the issue. The mod will be treated as a new mod and will have to go through the review process again.

Ask anyone who has been through the process, it isn't a cakewalk.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Arantor on April 29, 2016, 09:09:13 AM
I've seen your "it's overkill" claims before but the reality is often vastly more complex. Avatar information isn't available by default upon loading the thread data, so that had to be added in by this mod, not to mention processing the different types of avatars SMF supports (attached, attached/custom directory, direct URL, gallery) which this looks like it supports.

I don't think it could be written much more simply than it is but I guess I wouldn't know much about that.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wellwisher on April 29, 2016, 12:51:16 PM
Quote from: Arantor on April 29, 2016, 09:09:13 AM
I've seen your "it's overkill" claims before but the reality is often vastly more complex. Avatar information isn't available by default upon loading the thread data, so that had to be added in by this mod, not to mention processing the different types of avatars SMF supports (attached, attached/custom directory, direct URL, gallery) which this looks like it supports.

I don't think it could be written much more simply than it is but I guess I wouldn't know much about that.

@Arantor it is an over-kill mate. :P A *simple* solution can be developed to easily work on all 2.0 themes (without errors). You basically use .JS to go to the members "index.php?action=profile;u=123" URL, and "fetch" the div container with "avatar img" and stick it to index.template.php. This can be done with just a few lines of .Js code. :)

I'd develop this but the approval process makes me a #SadPanda. In fact, now I can develop pretty nifty mods but the approval team needs to step-down and let develpers, develop and the community govern its own mods. Smf team should only step in *if* and *when* a security risk has been flagged.

Title: Re: Avatars on Board and/or MessageIndex
Post by: qc on April 29, 2016, 12:58:43 PM
Quote from: Wellwisher on April 29, 2016, 12:51:16 PM
@Arantor it is an over-kill mate. :P A *simple* solution can be developed to easily work on all 2.0 themes (without errors). You basically use .JS to go to the members "index.php?action=profile;u=123" URL, and "fetch" the div container with "avatar img" and stick it to index.template.php. This can be done with just a few lines of .Js code. :)
Some men just want to watch the world burn :o

I mean - as long as you do this only on your own website, I am totally ok with that ;D

Title: Re: Avatars on Board and/or MessageIndex
Post by: nend on April 29, 2016, 12:58:56 PM
Quote from: Wellwisher on April 29, 2016, 12:51:16 PM
@Arantor it is an over-kill mate. :P A *simple* solution can be developed to easily work on all 2.0 themes (without errors). You basically use .JS to go to the members "index.php?action=profile;u=123" URL, and "fetch" the div container with "avatar img" and stick it to index.template.php. This can be done with just a few lines of .Js code. :)

I'd develop this but the approval process makes me a #SadPanda. In fact, now I can develop pretty nifty mods but the approval team needs to step-down and let develpers, develop and the community govern its own mods. Smf team should only step in *if* and *when* a security risk has been flagged.

The load that will generate would be tremendous, plus you'd block the users IP through SMF's flood control.  :-\
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wellwisher on April 29, 2016, 01:31:37 PM
Quote from: nend on April 29, 2016, 12:58:56 PM
The load that will generate would be tremendous, plus you'd block the users IP through SMF's flood control.  :-\

I am prepared to build it and prove anyone wrong for $29.99 - with 16 minium pre-paid customers and ofc my life-time support included for 2.0 only and if you run into install bugs with my script, I will solve them free of charge.  ;) My script will show avatars in index.template.php in the last post div and avatars in board posts list.
Title: Re: Avatars on Board and/or MessageIndex
Post by: qc on April 29, 2016, 01:33:26 PM
@Wellwisher You are a special snowflake, aren't you ;D First trashing another mod for being overkill, then boasting about your 'one of a kind' (read: deranged :P) js solution and after being challenged with criticism offering to prove them wrong for just about 500$

I respect that  8)
Title: Re: Avatars on Board and/or MessageIndex
Post by: nend on April 29, 2016, 01:39:01 PM
Quote from: Wellwisher on April 29, 2016, 01:20:57 PM
Quote from: nend on April 29, 2016, 12:58:56 PM
The load that will generate would be tremendous, plus you'd block the users IP through SMF's flood control.  :-\

I prepared to build it and prove anyone wrong for $29.99 - with 16 minium pre-paid customers and ofc my life-time support included for 2.0 only and if you run into install bugs with my script, I will solve them free of charge.  ;) My script will show avatars in index.template.php in the last post div and avatars in board posts list.

I don't know, I already have a custom system in place - http://www.sicomm.us/random-discussion/

Quote from: Wellwisher on April 29, 2016, 12:51:16 PM
You basically use .JS to go to the members "index.php?action=profile;u=123" URL, and "fetch" the div container with "avatar img" and stick it to index.template.php. This can be done with just a few lines of .Js code. :)

Second, let me explain. What your doing here is doing a AJAX request to the server for every single topic that needs a avatar. Say for instance you have 20 topics per page then possibly your going to end up with 20 request. Each request requires SMF to load up the information and display it, it's not cheap.

Best way to do this is still server side, any way you slice it up.  ;)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Kindred on April 29, 2016, 02:02:48 PM
and this sort of suggestion on how to "do things" just demonstrates why we need the customization team to review mods on submission... :D
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wellwisher on April 29, 2016, 02:13:20 PM
Quote from: nend on April 29, 2016, 01:39:01 PM

Second, let me explain. What your doing here is doing a AJAX request to the server for every single topic that needs a avatar. Say for instance you have 20 topics per page then possibly your going to end up with 20 request. Each request requires SMF to load up the information and display it, it's not cheap.


That's one of the reasons why I haven't implemented this on our forums. The biggest forum I have, has 21 boards on index, now that's basically your 21 additional avatar requests and atm, I am trying *hard* to reduce the number of http requests. ;D
I have around 300-500 visitors per day, now times that figure by 21... (that final figure would be ffa lol'sums for webmasters) and that's why I wouldn't recommend touching this with a 10ft pool my friend. For smaller forums, it's fine.

Quote from: nend
Best way to do this is still server side, any way you slice it up.  ;)

Actually, now that you've mention it, I think it's better to use a combination of both. :P Idk haven't figured out the logisitics in my head, but if enough ppl want it here, I can come up with a solution that will be compatible with 2.0 themes (within a few days).
Title: Re: Avatars on Board and/or MessageIndex
Post by: Arantor on April 29, 2016, 02:45:58 PM
Which is why you save yourself the load and use a custom avatar folder where the URL directly to the image can be obtained and avoid the PHP overhead entirely.

Though I really don't understand how AJAX queries to the profile page are "less overkill". Might be less dev effort but will be far less server effort. It's a great thing we don't all write mods that are less dev effort. Though that mentality is how come Discourse ended up making a CDN for white-letter-on-coloured-background default avatars, because it was less dev effort than fixing the actual problem.
Title: Re: Avatars on Board and/or MessageIndex
Post by: 420SA on May 06, 2016, 10:17:06 AM
Hi there

I apologise if someone has raised the issue before.

When I install the mod it works great but quite a number of topics disappear from the boards. When I uninstall the mod those missing topics appear again.

Any possible causes of this?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 06, 2016, 11:32:08 AM
Quote from: 420SA on May 06, 2016, 10:17:06 AM
Hi there

I apologise if someone has raised the issue before.

When I install the mod it works great but quite a number of topics disappear from the boards. When I uninstall the mod those missing topics appear again.

Any possible causes of this?

there are certain reasons for, one of the most cases could be that another mod distubs the query my mods uses? On my forum i have about 30 mods running with this mod included and it all works fine. Could you post as attachment the messagindex.php and subs-boardindex.php files when mod is installed?
Title: Re: Avatars on Board and/or MessageIndex
Post by: 420SA on May 07, 2016, 12:51:47 PM
Thanks for your response.

I have 40 mods installed, excluding this one.

Here's a list of my installed mods. Attached are those files you requested, with the mod installed.

1.   Hide Signatures from Guests   2.0   [ Uninstall ]
2.   Simple Audio Video Embedder   3.6.1   [ Uninstall ]
3.   Mentions   1.1.1   [ Uninstall ]
4.   Tapatalk SMF 2.0 Plugin   4.3.6   [ Uninstall ]
5.   Say Thanks   1.3   [ Uninstall ]
6.   SBTM: Search Bar To Menu   1.0.1   [ Uninstall ]
7.   DMOT: Default Menu On Top   1.4.1   [ Uninstall ]
8.   Custom Copyright   1.0.4   [ Uninstall ]
9.   Regbar Warning   1.0.5   [ Uninstall ]
10.   SMF 1.1.21 / 2.0.10 Update   1.0   [ Uninstall ]
11.   SCEditor4Smf   0.5.1   [ Uninstall ]
12.   E-Arcade   3.0   [ Uninstall ]
13.   SMF 1.1.20 / 2.0.9 Update   1.0   [ Uninstall ]
14.   Advanced Attachments Uploader   2.0.3   [ Uninstall ]
15.   Customize *Child Board*   2.7   [ Uninstall ]
16.   Misc Anti Spam   1.0   [ Uninstall ]
17.   Optimus Brave   1.8.7   [ Uninstall ]
18.   SMFPacks Shoutbox   1.0.5   [ Uninstall ]
19.   Profile Statuses   3.1   [ Uninstall ]
20.   SMF Quiz   1.1.0   [ Uninstall ]
21.   PM to New Members   1.2   [ Uninstall ]
22.   Dream Portal   1.1   [ Uninstall ]
23.   Menu Box   1.0   [ Uninstall ]
24.   Watermark.light   1.5   [ Uninstall ]
25.   Enhanced Dropdown   1.3   [ Uninstall ]
26.   PM Attachments   1.6   [ Uninstall ]
27.   Highslide Image Viewer   1.7   [ Uninstall ]
28.   Remove Help From Menu   1.0   [ Uninstall ]
29.   Recent Forum Topics Boardindex   1.0   [ Uninstall ]
30.   Polls Can Block New Users   1.2   [ Uninstall ]
31.   Board Icons   1.0   [ Uninstall ]
32.   Reason For Editing Mod   2.3.2   [ Uninstall ]
33.   Like Posts   1.5.2   [ Uninstall ]
34.   Post Ratings   1.6   [ Uninstall ]
35.   Advanced Recent Posts   1.1.1   [ Uninstall ]
36.   Hide ip stuff for users   1.04   [ Uninstall ]
37.   Add Favicon.ico Support   1.101   [ Uninstall ]
38.   MetaTags Modification   2.0.2   [ Uninstall ]
39.   SMF Gallery Lite   3.7   [ Uninstall ]
40.   Ad Managment   3.2   [ Uninstall ]
Title: Re: Avatars on Board and/or MessageIndex
Post by: juventusventus on May 09, 2016, 12:04:47 PM
I confirm the problem that 420SA mentions. I have only three mods installed (1. Ad Management 3.2    2. Avatars on Board/MessageIndex 1.3  and 3. Simple Audio Video Embedder 3.6.2) and seem to have the same problem:

Some boards do not display all the topics. For example: The board shows only the stickies and no other topics on the first page, while on the second page everything is fine and dandy.

I managed to pinpoint where the problem arises by removing the last post in the last topic displayed on the problematic page. In my case the mod seemed to get stuck at a deleted user's(now "guest") avatar(or post for that matter).

I believe that the mod tries to call on the avatar of the deleted user(last post in the last sticky topic displayed) so that it could be isplayed in the Board topics "last post" column and there it crashes since the user actually doesn't exsist.

@420SA : I suggest you check the last post in the last properly displayed topic(especially if it's a deleted account) and see what happens.

@mod developer
As for your mod - it's very nice - thank you - but could you please look into this problem as it seems taht there are a few people having problems with missing topics. It yould be greatly appreciated.
Title: Re: Avatars on Board and/or MessageIndex
Post by: qc on May 09, 2016, 12:27:29 PM
These questions might help to identify the problem:
1. Check the error log (admin -> logs), any new entries after experiencing the bug?
2. Does the bug also appear on other themes than the one you installed the mod in? If not, it is a problem with the template modification - if yes, it is indeed a problem with the query .
Title: Re: Avatars on Board and/or MessageIndex
Post by: juventusventus on May 10, 2016, 03:12:38 AM
Quote from: qc on May 09, 2016, 12:27:29 PM
These questions might help to identify the problem:
1. Check the error log (admin -> logs), any new entries after experiencing the bug?
2. Does the bug also appear on other themes than the one you installed the mod in? If not, it is a problem with the template modification - if yes, it is indeed a problem with the query .

1. no errors at all
2. I cannot say I have only the default theme installed - the Curve. The Core theme is useless since most of the mods failed to modify it correctly and I wasn't bothered to mod it manually - no need to use it.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 10, 2016, 10:07:42 AM
Quote from: juventusventus on May 09, 2016, 12:04:47 PM
I confirm the problem that 420SA mentions. I have only three mods installed (1. Ad Management 3.2    2. Avatars on Board/MessageIndex 1.3  and 3. Simple Audio Video Embedder 3.6.2) and seem to have the same problem:

Some boards do not display all the topics. For example: The board shows only the stickies and no other topics on the first page, while on the second page everything is fine and dandy.

I managed to pinpoint where the problem arises by removing the last post in the last topic displayed on the problematic page. In my case the mod seemed to get stuck at a deleted user's(now "guest") avatar(or post for that matter).

I believe that the mod tries to call on the avatar of the deleted user(last post in the last sticky topic displayed) so that it could be isplayed in the Board topics "last post" column and there it crashes since the user actually doesn't exsist.

@420SA : I suggest you check the last post in the last properly displayed topic(especially if it's a deleted account) and see what happens.

@mod developer
As for your mod - it's very nice - thank you - but could you please look into this problem as it seems taht there are a few people having problems with missing topics. It yould be greatly appreciated.


thx for finding that out. Fix is on the way.
Title: Re: Avatars on Board and/or MessageIndex
Post by: nfmovil on May 17, 2016, 12:47:19 AM
Hi , I have this error :

(https://i.imgur.com/ui3WOFh.png)

And the problem is in this mod in this line:

(https://i.imgur.com/JVcDTmv.png)

How can I fix it?

// 'Print' the topic info.
$context['topics'][$row['id_topic']] = array(
'id' => $row['id_topic'],
'first_post' => array(
'id' => $row['id_first_msg'],
'member' => array(
'username' => $row['first_member_name'],
'name' => $row['first_display_name'],
'avatar' => $row['avatar_first_poster'] == '' ? ($row['avf_id_attach'] > 0 ? (empty($row['avf_attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['avf_id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['avf_filename']) : '') : (stristr($row['avatar_first_poster'], 'http://') ? $row['avatar_first_poster'] : $modSettings['avatar_url'] . '/' . $row['avatar_first_poster']),
'id' => $row['first_id_member'],
'href' => !empty($row['first_id_member']) ? $scripturl . '?action=profile;u=' . $row['first_id_member'] : '',
'link' => !empty($row['first_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['first_id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_display_name'] . '">' . $row['first_display_name'] . '</a>' : $row['first_display_name']
),
Title: Re: Avatars on Board and/or MessageIndex
Post by: Ian Mc on May 17, 2016, 02:36:13 AM
Excellent mod. Love it. Installed no problems, all boards showing everything fine. The only problem I have is one that's been been touched on in the thread before but I couldn't establish if it had been resolved.

The mod isn't pulling avatars from additional folders in      /public_html/forum/avatars   

For example:

/public_html/forum/avatars/male_faces/
/public_html/forum/avatars/female_faces/

and so on.

I'm hoping that someone could advise me on what code I need to add and where to place it in order to resolve this.The mod is pulling avatars from everywhere else but just not these folders. Would be very grateful if someone could assist.

Many thanks.
Title: Re: Avatars on Board and/or MessageIndex
Post by: d3vcho on June 04, 2016, 07:54:21 AM
Hello Pipke!


I've translated your mod into Spanish_es with some changes from Spanish_latin. Hope it helps!
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on June 09, 2016, 01:04:24 PM
Hi Pipke, thanks for this excellent mod! I experience the exact same problem as @juventusventus (he explained exacltly what I experience on my forum), so great to hear the fix is on it's way!
Cheers!
MM
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on June 19, 2016, 07:40:02 PM
Quote from: Pipke on May 10, 2016, 10:07:42 AM
Quote from: juventusventus on May 09, 2016, 12:04:47 PM
I confirm the problem that 420SA mentions. I have only three mods installed (1. Ad Management 3.2    2. Avatars on Board/MessageIndex 1.3  and 3. Simple Audio Video Embedder 3.6.2) and seem to have the same problem:

Some boards do not display all the topics. For example: The board shows only the stickies and no other topics on the first page, while on the second page everything is fine and dandy.

I managed to pinpoint where the problem arises by removing the last post in the last topic displayed on the problematic page. In my case the mod seemed to get stuck at a deleted user's(now "guest") avatar(or post for that matter).

I believe that the mod tries to call on the avatar of the deleted user(last post in the last sticky topic displayed) so that it could be isplayed in the Board topics "last post" column and there it crashes since the user actually doesn't exsist.

@420SA : I suggest you check the last post in the last properly displayed topic(especially if it's a deleted account) and see what happens.

@mod developer
As for your mod - it's very nice - thank you - but could you please look into this problem as it seems taht there are a few people having problems with missing topics. It yould be greatly appreciated.


thx for finding that out. Fix is on the way.

Hey @Pipke , any news? I'm desperately waiting for this fix ;-)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on June 20, 2016, 01:57:46 AM
Trying to make this mod to a hook only mod, this will take some time.
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on June 20, 2016, 08:21:51 PM
Ok, cool, can't wait! In the meantime do you happen to know what the cause of the behavior described by @juventusventus is? I experience exactly the same.
Is it a missing image file somewhere or do you think the error is in the sql queries fired by the mod?
If I have some pointers where to look maybe I can help solve the problem...
Cheers!! Hope to get this working, I really love this layout!
MM
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 21, 2016, 10:09:28 PM
i have over 95 mods on my 2.0.11 system so as you might expect, my install fails as it conflicts with the "Password Protect Boards" mod

so on my dev system, i uninstalled the aforementioned mod (forcing it off was ok as the change was there on the reinstall) and I then had to make a manual change to .Sources/Subs-BoardIndex.php on the line containing:

b.name AS board_name

and then i forced this mod on and forced the password mod back on too.

it worked and both mods appear to be fine. nice mod !
Title: Re: Avatars on Board and/or MessageIndex
Post by: T3CHN0 on June 26, 2016, 06:27:41 AM
Hello, Any help please.

URL http://www.toyotatarago.net/index.php

I just installed this mod with no errors but it's not showing any Avatars.
No error in the logs
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 28, 2016, 03:02:44 AM
i had to remove this mod to track down a problem where apache became unstable after installing the mod.

i hope that it fixes my problem but have no idea why it would do this.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Sir Osis of Liver on June 28, 2016, 05:00:15 PM
Possible bug in this mod -

http://www.simplemachines.org/community/index.php?topic=546825.msg3880819#msg3880819
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on June 29, 2016, 03:06:07 AM
Quote from: Sir Osis of Liver on June 28, 2016, 05:00:15 PM
Possible bug in this mod -

http://www.simplemachines.org/community/index.php?topic=546825.msg3880819#msg3880819


yes i know that bug, there are more bugs, wich are not found yet by public but i know them and how to solve them, i'm working on it wich will take time.
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 30, 2016, 07:18:29 PM
removing the mod has fixed my webserver stability issues (MaxClients exhausted), if it's not too early to say so.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on July 12, 2016, 04:23:50 PM
mod updated to v1.4 (fully hook), with fixes! So please update if you have earlier version installed and let me know if all went ok for your site or not? thx for testing /using this mod.

Demo: http://nrns-games.com
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Wellwisher on July 13, 2016, 02:44:36 AM
All in all, nice work, a few minor bugs but looks much better:

1. Once installed, mod adds the letters "abm" on last post. Fixed it on the index page and attached the file. Still shows up on child-boards though so have a look.
(http://i.imgur.com/4hQfI8W.jpg)

2. Uninstalling it gives leaves me with this error:
(http://i.imgur.com/066hjRt.jpg)

Here's line 22 from in file message.index.php. I compared to the original message.index.php file so you can see the bug:
(http://i.imgur.com/uKtl6el.jpg)

3. Members with no avatars, this is what happens:

(http://i.imgur.com/wv3QTLI.jpg)
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on July 13, 2016, 07:26:21 AM
Quote from: Wellwisher on July 13, 2016, 02:44:36 AM
All in all, nice work, a few minor bugs but looks much better:

1. Once installed, mod adds the letters "abm" on last post. Fixed it on the index page and attached the file. Still shows up on child-boards though so have a look.
(http://i.imgur.com/4hQfI8W.jpg)

2. Uninstalling it gives leaves me with this error:
(http://i.imgur.com/066hjRt.jpg)

Here's line 22 from in file message.index.php. I compared to the original message.index.php file so you can see the bug:
(http://i.imgur.com/uKtl6el.jpg)

3. Members with no avatars, this is what happens:

(http://i.imgur.com/wv3QTLI.jpg)


Quote from: Wellwisher on April 20, 2016, 03:27:17 PM
Quote from: Pipke on April 20, 2016, 07:38:07 AM
@Wellwisher can you post your site url(with mod installed), so i can take look?

Much respect @Pipke but I always run new mods locally to test against my latest live production set-up.

Seems you dont check on localsite on first, as if you did you would noticed all went ok, now you post bugs from site screenies wich look to me are modified theme templates!
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Wellwisher on July 13, 2016, 11:34:30 AM
Quote from: Pipke on July 13, 2016, 07:26:21 AM
Seems you dont check on localsite on first, as if you did you would noticed all went ok, now you post bugs from site screenies wich look to me are modified theme templates!

I contributed an improved code/ file, which I've attached for you in my previous comment.  :) The rest are my bug findings which I relayed to you.
I own a fairly popular production forum so I always need to test (for a good few days) on local first. I install and then uninstall mod(s) which I plan to use and check to see everything works. I cut out my website name in those screens but the rest is all wysiwyg.  :-\

These are the mods I have on my local test install:

Theme: Inferno by dzinerstudio.com - who are the best smf theme coders in my opinion. I love their work and designs.
Smf version: 2.0.11

01. SimplePortal 2.3.6    
02. GoogAd Mod v.1.4 1.3
03. Ad Managment 3.2
04. @mention members 1.1.2
05. Add Facebook Like, Tweet, and Google +1 1.0.3a
06. Bookmarks 2.5
07. SMF Likes Plus 1.5    
08. Add Social Media Icons To Profiles 1.1.0    
09. Simple Audio Video Embedder 2.1.1
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: br360 on July 14, 2016, 12:59:32 AM
I'm getting the "abm" on last post as well on the board index. Interesting though in that it is only happening to some of the installed themes and not all of them.

Example with one theme where it's fine-

(https://s31.postimg.org/leys12o0b/abm.png)

Same exact site using another theme showing the abm-

(https://s31.postimg.org/6ytfm0qiz/abm1.png)

Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: aegersz on July 14, 2016, 02:49:41 AM
Will the new version stop Apache from maxing out it's  clients ?
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on July 14, 2016, 03:07:04 AM
Quote from: aegersz on July 14, 2016, 02:49:41 AM
Will the new version stop Apache from maxing out it's  clients ?

no idea, you should test that. ive never seen issues with that on my test site.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: aegersz on July 14, 2016, 03:44:59 AM
Thanks. It's my live site that does it but I don't want to risk it just yet ... maybe later.

It was this mod that caused the issue but it may be it's interaction with another mod, also.

Just my luck, dammit. It's a nice mod too.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: MartiMedia on July 14, 2016, 06:18:43 AM
Hi pipke, thanks for the update, it looks amazing! I observed only one problem (on my test forum software): after installing the mod the 'search' functionality of smf doesn't work anymore. When I type in a search query I receive this smf error: An Error Has Occurred!
Wrong value type sent to the database. Array of integers expected. (id).. When I unistall the mod the search function works again. I hope it's helpful I reported this error and of course that you can fix it... I really love the idea of this mod and can't wait to use it on my produtction forum! Cheers mate! MM
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on July 14, 2016, 08:13:08 AM
Quote from: Wellwisher on July 13, 2016, 11:34:30 AM

These are the mods I have on my local test install:

Theme: Inferno by dzinerstudio.com - who are the best smf theme coders in my opinion. I love their work and designs.
Smf version: 2.0.11


I checked on inferno theme and looks ok on my test site(see attachment). just weird?
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on July 14, 2016, 08:38:00 AM
Quote from: br360 on July 14, 2016, 12:59:32 AM
I'm getting the "abm" on last post as well on the board index. Interesting though in that it is only happening to some of the installed themes and not all of them.

Same exact site using another theme showing the abm-

(https://s31.postimg.org/6ytfm0qiz/abm1.png)



br360 wich theme is that? and dl link?
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: coltp45 on July 14, 2016, 12:54:39 PM
On default theme i have the last post problem
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: br360 on July 14, 2016, 02:04:45 PM
Quote from: Pipke on July 14, 2016, 08:38:00 AM
br360 wich theme is that? and dl link?

Not sure it will help because It's a paid theme called Material Forms- http://demo.studiocrimes.com/index.php?theme=29

I can send you a link to my site that is using it if you would like
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on July 14, 2016, 04:57:44 PM
mod updated to v1.5 with serveral fixes.

- Fixed: Last post link icon to topic was unclickable
- Fixed: The 'abm' text in last column on other costum themes! (fingers crossed how it will go from now on?)
- Fixed: Database error, given array of integer values is empty
- Fixed: Some undefined index errors


Another thing is when you see something like 'abm_id=3709' instead of an avatar icon, the avatar attachment is deleted from your attachment folder on your server. To avoid that you can do -> edit te particular users profile and set it to 'No Avatar' or -> Uncomment some code lines in the abm_code.php file wich are:


//Uncomment below lines if you want to check for attachment avatars that are deleted from server, note that this will make the pages load longer!
//if( strpos($avatar, 'type=avatar') !== false)
//{
// if (!@getimagesize($avatar))
// $avatar = $settings['images_url']. '/abm_avatar.gif';
//}


note that this will make the pages load longer!



Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: coltp45 on July 14, 2016, 09:07:33 PM
works great now.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Wellwisher on July 14, 2016, 10:42:56 PM
Installs and uninstalls safely without a problem now so VERY good work Pipke.  :)

Two more bugs remain.

1. Still see "abm" text on index page and on childboards.
2. No avatar problem aka "abm_id=3709"


I think I might be able to help with the abm text problem, I will look into it this weekend. You're getting there mate well done.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Wellwisher on July 16, 2016, 09:27:39 AM
@Pipke fixed the "abm" text issue in index and on child boards.

I've Attached file abm_code.php with new amendments.




Also you could make the mod more compatible on other themes by using $themedir/images in mod file "package-info.xml"




<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>Pipke:Avatars_on_Board_MessageIndex</id>
<name>Avatars on Board/MessageIndex</name>
<version>1.5</version>
<type>modification</type>
<install for="2.0 - 2.0.99">
<readme parsebbc="true">readme.txt</readme>
<code>abm_add_remove.php</code>
<require-dir name="Themes" destination="$boarddir">Theme and Language files</require-dir>
<require-dir name="Sources" destination="$boarddir">Source files</require-dir>
<require-file name="abm_avatar.gif" destination="$themedir/images" />
<redirect url="?action=admin;area=modsettings;sa=abm">redirect.txt</redirect>
</install>
<uninstall for="2.0 - 2.0.99">
<code>abm_add_remove.php</code>
<remove-file name="$sourcedir/abm_code.php" />
<remove-file name="$themedir/languages/abm.english.php" />
<remove-file name="$themedir/languages/abm.english-utf8.php" />
<remove-file name="$themedir/languages/abm.spanish_latin.php" />
<remove-file name="$themedir/languages/abm.spanish_latin-utf8.php" />
<remove-file name="$themedir/images/abm_avatar.gif" />
<redirect url="$scripturl?action=admin;area=packages" timeout="5000"></redirect>
</uninstall>

</package-info>

Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Wellwisher on July 16, 2016, 11:05:14 AM
Now the only bug i see is when members use avatars from broken image links/ urls, then you get the same "abm_id=3709" error.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Raffaele1977 on August 16, 2016, 06:56:06 AM
Tks for the mod! :)

In the board index, i see a bug.
Down the subsection, the mod makes me appear other subsection empty (it doesn't exit).

I attach photo.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on August 16, 2016, 09:19:36 AM
Quote from: Raffaele1977 on August 16, 2016, 06:56:06 AM
Tks for the mod! :)

In the board index, i see a bug.
Down the subsection, the mod makes me appear other subsection empty (it doesn't exit).

I attach photo.

Can you post your forum url, so i can take a peek at it, and maybe help you.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Raffaele1977 on August 16, 2016, 09:56:32 AM
Quote from: Pipke on August 16, 2016, 09:19:36 AM
Quote from: Raffaele1977 on August 16, 2016, 06:56:06 AM
Tks for the mod! :)

In the board index, i see a bug.
Down the subsection, the mod makes me appear other subsection empty (it doesn't exit).

I attach photo.

Can you post your forum url, so i can take a peek at it, and maybe help you.

I just sent a PM
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on August 20, 2016, 11:59:46 AM
mod updated
Version 1.6 - Aug 20, 2016
- Fixed: Mod messed up output template when Board has Child in Child and deeper Child etc.
- Fixed: The 'abm_id={}' text in last column when avatar path is fault or been removed from server
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: JerzyLS on August 23, 2016, 09:24:47 AM
Hey,

How to change last poster info in boards?
I mean delete the "Last post" information, like in IPB:

Original:

<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';


Changed:

<p>', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $board['last_post']['time'],'
</p>';
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Kindred on August 23, 2016, 09:26:52 AM
What does that have to do with the Avatar on board mod?
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: JerzyLS on August 23, 2016, 09:31:02 AM
When I had a 1.2 version the changed last poster information was working (then the mod wasn't hooked).

Now when I changed it again in BoardIndex.template.php after the update it doesn't working.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on August 23, 2016, 11:02:12 AM
i have no clue what you want to ask, screenshot or site url does maybe help me to understand you?
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: JerzyLS on August 23, 2016, 11:08:35 AM
I wanted to delete this:
<strong>', $txt['last_post'], '</strong>  ', $txt['by'], '

Nevermind, I just done it in abm_code.php
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: steve51184 on August 26, 2016, 10:13:05 PM
latest version doesn't work with stickied topics correctly with smf 2.0.11
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: Pipke on August 27, 2016, 09:09:16 AM
Quote from: steve51184 on August 26, 2016, 10:13:05 PM
latest version doesn't work with stickied topics correctly with smf 2.0.11

I can not find that problem on my own forums or test site, can you provide me some more info about 'doesn't work with stickied topics' an example or siteurl or screeny would help the best.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: coltp45 on August 27, 2016, 08:52:14 PM
Works ok with stickied topics in my forum.
Title: Re: Avatars on Board and/or MessageIndex (Now Fully Hook)
Post by: steve51184 on August 31, 2016, 09:32:02 PM
Quote from: Pipke on August 27, 2016, 09:09:16 AM
Quote from: steve51184 on August 26, 2016, 10:13:05 PM
latest version doesn't work with stickied topics correctly with smf 2.0.11

I can not find that problem on my own forums or test site, can you provide me some more info about 'doesn't work with stickied topics' an example or siteurl or screeny would help the best.


image of board with 1 stickied post: http://i.imgur.com/u1duGh4.png

closeup of whatever that text is: http://i.imgur.com/SJIFXeT.png

works fine on some thought: http://i.imgur.com/Wbn520x.png

but not all: http://i.imgur.com/9Ji7YX1.png
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on September 01, 2016, 07:59:00 AM
Quote from: steve51184 on August 31, 2016, 09:32:02 PM
Quote from: Pipke on August 27, 2016, 09:09:16 AM
Quote from: steve51184 on August 26, 2016, 10:13:05 PM
latest version doesn't work with stickied topics correctly with smf 2.0.11

I can not find that problem on my own forums or test site, can you provide me some more info about 'doesn't work with stickied topics' an example or siteurl or screeny would help the best.


image of board with 1 stickied post: http://i.imgur.com/u1duGh4.png

closeup of whatever that text is: http://i.imgur.com/SJIFXeT.png

works fine on some thought: http://i.imgur.com/Wbn520x.png

but not all: http://i.imgur.com/9Ji7YX1.png

This has been fixed, mod is now v1.7
Title: Re: Avatars on Board and/or MessageIndex
Post by: bolubeyi61 on September 21, 2016, 08:57:48 PM
This modification was working well .

But then it caused the error.

as in the picture:
(http://smfdestek.com/images/avatar1.PNG)


To fix:

abm_code.php
Find:
$avatar = preg_replace($find[9], 'class="lastpost" style="width: '. $modSettings['abm_width_board'] .'%;"', $avatar);

Replace:
$avatar = preg_replace($find[9], 'class="lastpost" ', $avatar);

(http://smfdestek.com/images/avatar2.PNG)


This way I can find a solution. What is the problem? Why is this happening?



alternative solutions
Database backups have installed also improving making changes encoding.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on September 22, 2016, 02:44:46 AM
Quote from: bolubeyi61 on September 21, 2016, 08:57:48 PM
This modification was working well .

But then it caused the error.

as in the picture:



This way I can find a solution. What is the problem? Why is this happening?



alternative solutions
Database backups have installed also improving making changes encoding.

That is not an error from the mod, to as i can see you have configurated the mod settings 'increase the last column %' to 49 as on your screeny. Al you had todo was changing that setting back to 1, instead of editting the code on abm_code.php, advice uninstall then install it back?
Title: Re: Avatars on Board and/or MessageIndex
Post by: bolubeyi61 on September 22, 2016, 12:18:10 PM
modification conflict
Avatars on Board and/or MessageIndex (http://custom.simplemachines.org/mods/index.php?mod=4107) and Aeva Media Gallery (http://www.simplemachines.org/community/index.php?topic=294485.0)


I use it in the following code issues:
[smg id=89]

forum home page gives an error

Delete
[smg id=89]
no problem.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on September 22, 2016, 04:48:38 PM
@bolubeyi61

I can not trace/make any sence in your post what actually the problem is, can you be more specific about the problem you have? You post codes where i'm not getting something out and what the purpose of it is?
Title: Re: Avatars on Board and/or MessageIndex
Post by: spidometrs on November 12, 2016, 02:46:40 AM
Hi guys!

Modul for my forum does not work consistently.
Once avatars shows and 20 times does not show.
Now the modul is installed, but does not show the avatars.
See screenshot.

I want to add an avatar just to the left of the list.
See screenshot.

Can you tell me how to do it?

I created the code and add it to MessageIndex.template.php file, but it does not display user avatars.


if ((filter_var($topic['first_post']['member']['avatar'], FILTER_VALIDATE_URL) === false) || (empty($topic['first_post']['member']['avatar'])))
echo'', $topic['first_post']['member']['id'] ? '<a href="' .$topic['first_post']['member']['href']. '">' : '', '<img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'.$settings['images_url']. '/abm_avatar.gif" alt="[?]" />', $topic['first_post']['member']['id'] ? '</a>' : '';
  else
echo'<a href="' ,$topic['first_post']['member']['href'], '"><img style="',$abm_img_style,' border-radius:',$modSettings['abm_avatar_layout'] ? '50' : '0','%;" src="'. $topic['first_post']['member']['avatar'].'" alt="[?]" /></a>';


Can you fix the code?

Thank you very much in advance!
Title: Re: Avatars on Board and/or MessageIndex
Post by: spidometrs on November 12, 2016, 08:50:07 AM
I did everything myself.
And every time you need to clear the cache.
SMF 2.0.11 has a problem with the cache.
For this module, the cache should be turned off.

Wonderful module.
Thanks to the author!
Title: Re: Avatars on Board and/or MessageIndex
Post by: vicente947 on December 07, 2016, 09:47:34 AM
I still having amb text on boardindex:

(https://i.gyazo.com/61fcb86fe1ecfd149fc10df14d3f6107.png)

Im using:

Manas Theme

And this mods:

(https://i.gyazo.com/6808aeb0459de74f0016cacae37297a2.png)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on December 07, 2016, 10:18:46 AM
@vicente947 can you post your forum url with mod installed so i can take a look and maybe solve it for you.
Title: Re: Avatars on Board and/or MessageIndex
Post by: vicente947 on December 07, 2016, 10:19:18 AM
Quote from: Pipke on December 07, 2016, 10:18:46 AM
@vicente947 can you post your forum url with mod installed so i can take a look and maybe solve it for you.

http://teamworkers.co.nf/
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on December 07, 2016, 10:21:38 AM
Quote from: vicente947 on December 07, 2016, 10:19:18 AM
Quote from: Pipke on December 07, 2016, 10:18:46 AM
@vicente947 can you post your forum url with mod installed so i can take a look and maybe solve it for you.

http://teamworkers.co.nf/

ok ill check it later today when i'm home.
Title: Re: Avatars on Board and/or MessageIndex
Post by: vicente947 on December 07, 2016, 10:24:37 AM
Quote from: Pipke on December 07, 2016, 10:21:38 AM
Quote from: vicente947 on December 07, 2016, 10:19:18 AM
Quote from: Pipke on December 07, 2016, 10:18:46 AM
@vicente947 can you post your forum url with mod installed so i can take a look and maybe solve it for you.

http://teamworkers.co.nf/

ok ill check it later today when i'm home.


Thx man :)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on December 07, 2016, 01:41:29 PM
@vicente947, it seems you fixed it yourself? the abm is gone?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Ian Mc on January 10, 2017, 07:55:12 AM
Mod has installed with no problems at all and works perfectly but for one exception. Despite having "Show avatar of last poster on the BoardIndex" disabled, the avatars are still showing there. Have done all the usual refreshes, cache cleared etc but they won't go away! Just wondered if you could give me any pointers?

I'm using a custom responsive theme so I'm wondering if this could be the problem. With having a left hand row of Simple Portal blocks on the Board Index the inclusion of the avatars just squeezes things up a bit too much!

Many thanks.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on January 10, 2017, 08:37:24 AM
Quote from: Ian Mc on January 10, 2017, 07:55:12 AM
Mod has installed with no problems at all and works perfectly but for one exception. Despite having "Show avatar of last poster on the BoardIndex" disabled, the avatars are still showing there. Have done all the usual refreshes, cache cleared etc but they won't go away! Just wondered if you could give me any pointers?

I'm using a custom responsive theme so I'm wondering if this could be the problem. With having a left hand row of Simple Portal blocks on the Board Index the inclusion of the avatars just squeezes things up a bit too much!

Many thanks.

thx for the report ;) I have fixed the issue/bug, mod updated to v1.8

Quote
Version 1.8 - Jan 10, 2017
- Fixed: Admin setting "Show avatar of last poster on the BoardIndex"
Title: Re: Avatars on Board and/or MessageIndex
Post by: Ian Mc on January 10, 2017, 08:49:58 AM
Working perfectly. Thank you.  ;)
Title: Re: Avatars on Board and/or MessageIndex
Post by: AlexanderBrown on January 29, 2017, 05:00:58 PM
I too am having this issue with "abm" issue on my board. I don't see a solution for the person who had it previously, is this a known issue with a solution?

(http://i.imgur.com/FTcAaEw.png)

The link to my forum is http://www.sioncraft.net
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on January 31, 2017, 07:56:12 AM
Quote from: AlexanderBrown on January 29, 2017, 05:00:58 PM
I too am having this issue with "abm" issue on my board. I don't see a solution for the person who had it previously, is this a known issue with a solution?

(http://i.imgur.com/FTcAaEw.png)

The link to my forum is http://www.sioncraft.net


this is caused by that your using other theme then default, the theme your using uses another layout of the last columns, can you uninstall the mod, this way i can watch how this theme is setup in the last columns elements.
Title: Re: Avatars on Board and/or MessageIndex
Post by: caboose014 on February 07, 2017, 11:11:29 PM
the 'abm' text looks like its a mistake in the code. There are lines of code where it looks like abm is suppose to be commented out

abm<!---->

Where I believe this should be

<!--abm-->

I found and replaced this manually in the 'aim_code.php' file (in the sources folder) and the text has gone.
Title: Avatars on Board not work. What to do?
Post by: Argon3000 on February 12, 2017, 10:52:45 AM
Avatars on Board not work. What to do?
Avatars on MessageIndex - ОК.

Theme - default.
qrz.center/community/
Title: Re: Avatars on Board and/or MessageIndex
Post by: Kindred on February 12, 2017, 02:28:29 PM
did you actually install it into your theme?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Argon3000 on February 13, 2017, 12:28:02 AM
Quote from: Kindred on February 12, 2017, 02:28:29 PM
did you actually install it into your theme?

Yes.
Avatars on Board - NOT WORK.
Avatars on MessageIndex - ОК.

SMF Default Theme - Curve. SMF 2.0.13, PortaMx-SEF 1.54.

Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 13, 2017, 02:20:29 PM
Quote from: Argon3000 on February 13, 2017, 12:28:02 AM
Quote from: Kindred on February 12, 2017, 02:28:29 PM
did you actually install it into your theme?

Yes.
Avatars on Board - NOT WORK.
Avatars on MessageIndex - ОК.

SMF Default Theme - Curve. SMF 2.0.13, PortaMx-SEF 1.54.



this is caused by that your theme last column is setup different then its default, can you uninstall the mod, this way i can watch how it is setup in the last columns elements.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Argon3000 on February 13, 2017, 06:59:13 PM
Quote from: Pipke on February 13, 2017, 02:20:29 PM
this is caused by that your theme last column is setup different then its default, can you uninstall the mod, this way i can watch how it is setup in the last columns elements.

Uninstall mod Avatars on Board and/or MessageIndex.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Argon3000 on February 14, 2017, 07:09:02 AM
Quote from: Pipke on February 13, 2017, 02:20:29 PM
...last column is setup different then its default, ...., this way i can watch how it is setup in the last columns elements.

Theme - default.
In advance thank you.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Kindred on February 14, 2017, 07:50:47 AM
That is not the default/Curve theme...
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 14, 2017, 10:13:59 AM
Quote from: Argon3000 on February 14, 2017, 07:09:02 AM
Quote from: Pipke on February 13, 2017, 02:20:29 PM
...last column is setup different then its default, ...., this way i can watch how it is setup in the last columns elements.

Theme - default.
In advance thank you.


Ok i have inspected the code without the mod it seems that it is the same as the deffault theme also i have installed the russian language pack to see if it has todo with that but no and i cannot figure out why the avatars are not showing, did you turned on the checkbox setting "Show avatar of last poster on the BoardIndex" it must be turned on?
Maybe it could be have someting todo with the pretty urls mod? Sorry i dont have any clue how to solve this at the moment, can you post or attach your index.template.php file.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Argon3000 on February 14, 2017, 01:43:48 PM
Quote from: Pipke on February 14, 2017, 10:13:59 AM
Quote from: Argon3000 on February 14, 2017, 07:09:02 AM
Quote from: Pipke on February 13, 2017, 02:20:29 PM
...last column is setup different then its default, ...., this way i can watch how it is setup in the last columns elements.

Theme - default.
In advance thank you.

Maybe it could be have someting todo with the pretty urls mod? Sorry i dont have any clue how to solve this at the moment, can you post or attach your index.template.php file.

index.template.php
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 14, 2017, 01:56:19 PM
sorry i dont need the index.template.php my fault  :-\  but the boardindex.template.php
Title: Re: Avatars on Board and/or MessageIndex
Post by: Argon3000 on February 14, 2017, 06:52:18 PM
Quote from: Pipke on February 14, 2017, 01:56:19 PM
sorry i dont need the index.template.php my fault  :-\  but the boardindex.template.php

OK. BoardIndex.template.php
Title: Re: Avatars on Board and/or MessageIndex
Post by: Rosss on February 15, 2017, 09:29:04 AM
Hello. Thanks so much for the mod, and also for keeping this thread alive to help us newbs :).

So I am having a problem, http://prntscr.com/e92gsc

It works for like 10%, or if you newly post something. The profile id's are off on the broken image ones i click, which i believe is the problem.

Now, this forum was just migrated to SMF though i'm not sure if that is the reason it is messing up, because all the "posted by" links and stuff work to the correct profile.

Thanks for any input!
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 15, 2017, 02:55:40 PM
Quote from: Argon3000 on February 14, 2017, 06:52:18 PM
Quote from: Pipke on February 14, 2017, 01:56:19 PM
sorry i dont need the index.template.php my fault  :-\  but the boardindex.template.php

OK. BoardIndex.template.php

I dont see problems on the boardindex.template file, last try can be to look at the BoardIndex.php file in Sources folder can you attach that file.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 15, 2017, 03:13:35 PM
@ Rosss can you post your forum url with mod installed so i can take a look and maybe solve it for you.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Argon3000 on February 16, 2017, 08:51:55 PM
Quote from: Pipke on February 15, 2017, 02:55:40 PM
I dont see problems on the boardindex.template file, last try can be to look at the BoardIndex.php file in Sources folder can you attach that file.

ОК.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 17, 2017, 07:50:48 AM
@Argon3000
On BoardIndex.php i cant find any wrong things? very weird.

ok install the mod then see if the checkbox of the setting "Show avatar of last poster on the BoardIndex" is turned on, it must be turned on, then go to your BoardIndex.template.php and find around line 86:


echo '
<div id="boardindex_table">


then add above it:

echo'<pre>';
print_r($context['categories']);
echo'</pre>';


then reload boardindex page you will see an array, can you post that complete array here between bbc code tags.

you must see something like this:


Array
(
    [1] => Array
        (
            [id] => 1
            [name] => General Category
            [is_collapsed] =>
            [can_collapse] => 1
            [collapse_href] => http://localhost/smf11/index.php?action=collapse;c=1;sa=collapse;fb6d5c29c71=81649c7f70f21bf634bca2b0dfdf9ef3#c1
            [collapse_image] => -
            [href] => http://localhost/smf11/index.php#c1
            [boards] => Array
                (
                    [1] => Array
                        (
                            [new] =>
                            [id] => 1
                            [name] => General Discussion
                            [description] => Feel free to talk about anything and everything in this board.
                            [moderators] => Array
                                (
                                )

                            [link_moderators] => Array
                                (
                                )

                            [children] => Array
                                (
                                )

                            [link_children] => Array
                                (
                                )

                            [children_new] =>
                            [topics] => 20
                            [posts] => 29
                            [is_redirect] => 0
                            [unapproved_topics] => 0
                            [unapproved_posts] => 0
                            [can_approve_posts] => 1
                            [href] => http://localhost/smf11/index.php?board=1.0
                            [link] => General Discussion
                            [last_post] => Array
                                (
                                    [id] => 29
                                    [time] => March 20, 2016, 12:11:15 pm
[timestamp] => 1458472275 [subject] => Re: Welcome to SMF! [member] => Array ( [id] => 1 [username] => admin [name] => admin [href] => http://localhost/smf11/index.php?action=profile;u=1 [link] => abm
abm_id=1Last post by admin ) [start] => msg31 [topic] => 1 [href] => http://localhost/smf11/index.php?topic=1.msg31#new [link] => Re: Welcome to SMF! ) ) [2] => Array ( [new] => [id] => 2 [name] => New Board [description] => [moderators] => Array ( ) [link_moderators] => Array ( ) [children] => Array ( ) [link_children] => Array ( ) [children_new] => [topics] => 2 [posts] => 2 [is_redirect] => 0 [unapproved_topics] => 0 [unapproved_posts] => 0 [can_approve_posts] => 1 [href] => http://localhost/smf11/index.php?board=2.0 [link] => New Board [last_post] => Array ( [id] => 31 [time] => October 26, 2016, 07:45:52 pm
[timestamp] => 1477507552 [subject] => dwdwdwd [member] => Array ( [id] => 2 [username] => test [name] => test [href] => http://localhost/smf11/index.php?action=profile;u=2 [link] => abm
abm_id=2Last post by test ) [start] => msg32 [topic] => 22 [href] => http://localhost/smf11/index.php?topic=22.msg32#new [link] => dwdwdwd ) ) ) [new] => 0 [link] => General Category [show_unread] => 1 ) )


if posted the code you can remove the edit from BoardIndex.template.php, so the page looks normal agian.


Title: Re: Avatars on Board and/or MessageIndex
Post by: Yariksat on March 25, 2017, 01:01:11 AM
Log
https://yarik-sat.ru/index.php?board=31.0
8: Undefined offset: 104
Файл: /home/admin/web/yarik-sat.ru/public_html/Sources/abm_code.php
Строка: 274

273: // close div p
==>274: if ($context['boards'][$row['id_board']])
275: $context['boards'][$row['id_board']]['last_post']['time'] = $context['boards'][$row['id_board']]['last_post']['time'].'</div><p><!---->';
276:
277: if (isset($context['boards'][$row['id_parent']]))
278: $context['boards'][$row['id_parent']]['last_post']['time'] = $context['boards'][$row['id_parent']]['last_post']['time'].'</div><p><!---->';
279: }
280:
281: $smcFunc['db_free_result']($request);
282: }
283: }
284:

https://yarik-sat.ru/index.php?board=31.0
8: Undefined offset: 104
/home/admin/web/yarik-sat.ru/public_html/Sources/abm_code.php
Строка: 258

243: if (!empty($abm_topic_ids))
244: {
245: $request = $smcFunc['db_query']('','
246: SELECT t.id_member_updated, t.id_topic, t.id_board, b.id_parent
247: FROM {db_prefix}topics AS t
248: LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
249: WHERE id_topic IN ({array_int:ids})',
250: array(
251: 'ids' => $abm_topic_ids,
252: )
253: );
254: while ($row = $smcFunc['db_fetch_assoc']($request))
255: {
256: if ($row['id_member_updated']) //member   
257: {
==>258: if ($context['boards'][$row['id_board']])
259: $context['boards'][$row['id_board']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $row['id_member_updated'] . '"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='.$row['id_member_updated'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_board']]['last_post']['member']['link'];
260:
261: if (isset($context['boards'][$row['id_parent']]))
262: $context['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $row['id_member_updated'] . '"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='.$row['id_member_updated'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_parent']]['last_post']['member']['link'];
263: }
264: else //guest or deleted account
265: {
266: if ($context['boards'][$row['id_board']])
267: $context['boards'][$row['id_board']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='. $row['id_member_updated'] .'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_board']]['last_post']['member']['link'];
268:
269: if (isset($context['boards'][$row['id_parent']]))
270: $context['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='. $row['id_member_updated'] .'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_parent']]['last_post']['member']['link'];
271: }
272:
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on March 26, 2017, 05:35:16 AM
@Yariksat

change line 274
from

if ($context['boards'][$row['id_board']])

to

if (isset($context['boards'][$row['id_board']]))


and line 258
from

if ($context['boards'][$row['id_board']])

to

if (isset($context['boards'][$row['id_board']]))
Title: Re: Avatars on Board and/or MessageIndex
Post by: Yariksat on March 26, 2017, 05:47:20 AM
 @Pipke
I immediately corrected the error
This is for you . For a fix in a future release
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on May 16, 2017, 06:20:30 PM
Hi @Pipke ,

Still loving this mod, again thanks for creating it!
I'm seeing a lot of these errors in my SMF 2.0.14 logs (also saw that in SMF 2.0.13, but had no time yet to dive in deeper):

8: Undefined index: last_post File: forum/Sources/abm_code.php
Line: 308

That only seems to be happening to guests , not to members.
Do you, or any others using this great mod, have any idea? Do I have to give more rights to guests? Or is that solvable by a code change?

Cheers, Marti




Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 17, 2017, 04:54:40 AM
Quote from: MartiMedia on May 16, 2017, 06:20:30 PM
Hi @Pipke ,

Still loving this mod, again thanks for creating it!
I'm seeing a lot of these errors in my SMF 2.0.14 logs (also saw that in SMF 2.0.13, but had no time yet to dive in deeper):

8: Undefined index: last_post File: forum/Sources/abm_code.php
Line: 308

That only seems to be happening to guests , not to members.
Do you, or any others using this great mod, have any idea? Do I have to give more rights to guests? Or is that solvable by a code change?

Cheers, Marti


It is solvable by code. I will update mod soon with the fixes.
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on May 18, 2017, 12:27:02 PM
Aaah that's great @Pipke, looking forward to it!
Cheers, Marti
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 18, 2017, 05:54:07 PM
Mod updated to v1.9

Quote
Version 1.9 - May 18, 2017
- Fixed: More Undefined index and Undefined offset errors
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on May 18, 2017, 06:21:45 PM
You're a hero @pipke, thanks a lot! Tested it locally first and then uploaded to the server. Now all those 'undefined' errors are gone! Yes! Thank you!
Cheers, Marti
Title: Re: Avatars on Board and/or MessageIndex
Post by: dansal on July 31, 2017, 05:36:25 AM
Hi great mod!!,

I want to adapt to me theme, ¿how i can remove the name of user? Only want to see avatar and post link
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on July 31, 2017, 05:34:36 PM
Quote from: dansal on July 31, 2017, 05:36:25 AM
Hi great mod!!,

I want to adapt to me theme, ¿how i can remove the name of user? Only want to see avatar and post link

thx that you like my mod.
about your question why you want to hide the username, i think its a bad idea cos when users dont have avatar set then you see default avatar and then you cant see the difference who is who, but if you want i need to know where you want to hide it, on board and/or on message index.
Title: Re: Avatars on Board and/or MessageIndex
Post by: dansal on August 02, 2017, 06:03:34 PM
I want to minimize my topic, in the list of forums, and in the section of details make a unique link where the avatar, date and title of the message. To make it more comfortable to use with a mobile device.

It is a small community where almost everyone has their full profile
Title: Re: Avatars on Board and/or MessageIndex
Post by: razzy on August 18, 2017, 06:31:12 PM
Hello. I was directed to post my small issue here, as I posted in the wrong place yet again.  :-[

Anyways. It's installed just fine, and is pretty slick. I love it. It's a fantastic mod.

Although once a category has been posted in, it shows 'abm' above the who posted last bit. I could try reading through the code to see if I cant find where that bugger is, but I was hoping someone knew about the issue already and could help.

Thank you. =)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on August 18, 2017, 07:00:20 PM
 
Quote from: razzy on August 18, 2017, 06:31:12 PM
Hello. I was directed to post my small issue here, as I posted in the wrong place yet again.  :-[

Anyways. It's installed just fine, and is pretty slick. I love it. It's a fantastic mod.

Although once a category has been posted in, it shows 'abm' above the who posted last bit. I could try reading through the code to see if I cant find where that bugger is, but I was hoping someone knew about the issue already and could help.

Thank you. =)


As it looks your using an other theme then default, wich theme is that and can you post your forum url with mod installed so i can take a look and maybe solve it for you.
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on August 18, 2017, 07:00:30 PM
this mod ground my system to a halt on numerous occasions but i'm giving it another go because it's a beauty ! fingers crossed.
Title: Re: Avatars on Board and/or MessageIndex
Post by: razzy on August 19, 2017, 01:48:13 PM
I'm using a Dziner theme called Gearbox2.0. Will pm the link. =)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on August 20, 2017, 09:13:11 AM
Quote from: razzy on August 19, 2017, 01:48:13 PM
I'm using a Dziner theme called Gearbox2.0. Will pm the link. =)

note that this fix is only for Gearbox2.0 theme.
open file Sources/abm_code.php

find in that file on line 393

'~<p>abm<!----></p>~',


replace by

'~abm<!---->~',


save file and reupload it.


Title: Re: Avatars on Board and/or MessageIndex
Post by: razzy on August 20, 2017, 02:38:27 PM
Easily located the file and line 393. replaced the code exactly how you said and the 'abm' is still showing where it was before.

I'll open the file to edit again, and see if I'm missing something.


combing through this file, and not really seeing anything outside the ordinary. (given I'm not well versed in .php. i make things pretty. lol)

Only thing around the area that made me wonder, is this...  $abm ='';

// remove the 'abm_id={}' text
$context['html_headers'] .= '
<style type="text/css">
.lastpost img {
color: rgba(0,0,0,0);
font-size: 1px;
}
.subject img {
color: rgba(0,0,0,0);
font-size: 1px;
}
</style>';

  $abm ='';

// Find in messages the outprinted topics
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on August 20, 2017, 03:53:20 PM
@razzy ive tested in chrome and firefox, the fix i posted should do the job, do you use any other browser?
Can you attach the file with the edit you made.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Kindred on August 20, 2017, 08:17:58 PM
Clear your server and browser cache
Title: Re: Avatars on Board and/or MessageIndex
Post by: razzy on August 22, 2017, 02:22:33 PM
I'm going to have to see about working all this out. Something has gone very wrong with me trying to rush through this. The board package manager says the mod isnt there, but the mod settings still show in the Modification Settings.

So I logged into the Cpanel, and it shows the zip file still there. So I downloaded it and unzipped it to magically find it empty...?

the kicker, is the mod still shows up in the board and on display. I'll post again once I figured out wth is going on. Thank you for the help so far and I'm sorry for this as I've been out of designing anything for several years now.
Title: Re: Avatars on Board and/or MessageIndex
Post by: razzy on August 22, 2017, 02:47:40 PM
So the fix suggested by Pipke works flawlessly now. Big huge thank you for everything, including your patience.

Somehow the entire mod's zip was blanked. I havent used .zip in ages, until recently I've always used .rar and because of that I somehow erased everything but the fixed php file. lol

and Also thank you Kindred, that was a very sound suggestion.

<3<3
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on September 26, 2017, 07:09:29 PM
Hi @Pipke, do you still have version 1.4 of the mod available for download? That version produced an error, and it seems to have slipped back into version 1.9 but probably it's my fault manually merging sources. I'd like to compare 1.4 with 1.5 (which I still have a copy of and where the bug was solved).
More detail: it's the 'Wrong value type sent to the database. Array of integers expected. (id)' in function abm_mod_setup (maybe you have the code snippet that changed there with the 1.4->1.5 change?)

Cheers, I hope someone can help me (I'm no PHP coder..)

Marti
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on September 27, 2017, 08:12:27 AM
@MartiMedia i would like to know how you got that error on v1.9 and where.
Title: Re: Avatars on Board and/or MessageIndex
Post by: MartiMedia on September 28, 2017, 06:07:32 PM
Smart me, I just cleared the logs a few days ago (and reported this error), and now I don't seem to be able to reproduce it atm. I recall it had to do with the 'last poster' and having no avatar, but not sure.. Anyway, if you still have the 1.4 package I can compare it with 1.5 to look for that difference. I'm at 1.9 on my production site, but somehow a code snippet from 1.4 seems to have slid back in (my reasoning may be wrong of course) by some manual edits I did. I'll post when the error is raised again, but in the meanwhile, can you post or mail me the 1.4 version? That would be great.. Thanks for always being helpful Pipke..
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on September 29, 2017, 08:00:31 AM
Quote from: MartiMedia on September 28, 2017, 06:07:32 PM
I'll post when the error is raised again

ok ill wait for that then if it happens agian, in meanwhile this is solved.

Quote from: MartiMedia on September 28, 2017, 06:07:32 PM
can you post or mail me the 1.4 version?

i dont have that version anymore.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Mochi on November 19, 2017, 10:37:54 AM
Hello.  :)

How can I hide the avatars from guests?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on November 19, 2017, 12:07:49 PM
Quote from: Mochi on November 19, 2017, 10:37:54 AM
Hello.  :)

How can I hide the avatars from guests?

in file Sources/abm_code.php

Code (find) Select

if (isset($context['current_action']) && !empty($context['current_action']))


Code (replace by) Select

if ($context['user']['is_guest'])
return;

if (isset($context['current_action']) && !empty($context['current_action']))


and

Code (find) Select

if (isset($_REQUEST['xml']))
return $avatar;


Code (replace by) Select

if ($context['user']['is_guest'])
return $avatar;

if (isset($_REQUEST['xml']))
return $avatar;
Title: Re: Avatars on Board and/or MessageIndex
Post by: Mochi on November 19, 2017, 12:56:30 PM
Thank you! It works fine!  :)
Title: Re: Avatars on Board and/or MessageIndex
Post by: maglix04 on December 06, 2017, 02:16:59 PM
Thank you for this beautiful mod, but it do not use proxy in avatar images in the forum's home
Solution?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Dav999 on December 27, 2017, 10:30:45 PM
I've been using this mod for a month now and I like it. :)

It just doesn't seem to be compatible with PHP 7.1. On PHP 7.0.26 the mod works fine, but if I try using PHP 7.1.12, the forum index breaks:

(https://i.imgur.com/JUUNR7p.png)

That particular error message comes with no extra information and is also not logged in either the forum or PHP error logs, but the following one shows up in the forum error log:

2: Illegal string offset 'value'
File: /home/X/public_html/forum/Sources/abm_code.php
Line: 292

Code (Sources/abm_code.php) Select
285: // Find in categories the outprinted boards ¿maybe not found logic?
286: if (isset($context['categories']) && !empty($context['categories']))
287: {
288: if (is_array($context['categories']))
289: foreach ($context['categories'] as $abm_id)
290: {
291: if (is_array($abm_id))
==>292: foreach($abm_id as $abm['value'][]) {}
293: }


(This also causes 3 error messages in index.template.php about the menu buttons not appearing.)

Also, as mentioned in the post above, it does not pass external avatar URLs through the image proxy in SMF 2.0.14+.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on December 28, 2017, 05:36:34 PM
Quote from: maglix04 on December 06, 2017, 02:16:59 PM
Thank you for this beautiful mod, but it do not use proxy in avatar images in the forum's home
Solution?
Quote from: Dav999 on December 27, 2017, 10:30:45 PM
I've been using this mod for a month now and I like it. :)

It just doesn't seem to be compatible with PHP 7.1. On PHP 7.0.26 the mod works fine, but if I try using PHP 7.1.12, the forum index breaks:


Both fixed in updated v2.0, thx for reporting!

Version 2.0 - Dec 28, 2017
- Fixed: Illegal string offset 'value' (due > PHP 7.1)
- Added: Proxy for external avatar urls
Title: Re: Avatars on Board and/or MessageIndex
Post by: maglix04 on December 29, 2017, 06:15:53 AM
You are great! Thank you!
Title: Re: Avatars on Board and/or MessageIndex
Post by: Dav999 on December 29, 2017, 08:33:58 PM
Thanks for the update! :D
Title: Re: Avatars on Board and/or MessageIndex
Post by: coltp45 on April 30, 2018, 02:25:19 AM
Hi, its posible to use SSL with this mods?

Im using a external image proxy.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on April 30, 2018, 03:11:01 AM
Quote from: coltp45 on April 30, 2018, 02:25:19 AM
Hi, its posible to use SSL with this mods?

yes
Title: Re: Avatars on Board and/or MessageIndex
Post by: Wauking on August 16, 2018, 07:41:53 AM
Hey, great mod and I have it working just fine however I get a "by abm" above almost each post on the main index. The picture below shows what I mean, any idea how to fix?

(https://i.imgur.com/HmdjKDY.png)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on August 16, 2018, 12:50:13 PM
Quote from: Wauking on August 16, 2018, 07:41:53 AM
Hey, great mod and I have it working just fine however I get a "by abm" above almost each post on the main index. The picture below shows what I mean, any idea how to fix?

(https://i.imgur.com/HmdjKDY.png)

can you post your site url (with access for guests) or the theme your using with download link or where i can see a preview.
Title: Re: Avatars on Board and/or MessageIndex
Post by: br360 on December 01, 2018, 05:21:13 PM
Hey Pipke.

I just installed the 2.0 version using the DokuzHarf theme.

https://custom.simplemachines.org/themes/index.php?lemma=2870

I have the "abm" on the board index for that theme as well. This theme also has the generic icon profile image in the last post area so not sure if that has anything to do with it. I did try removing that generic icon code from the theme's index.css though and that didn't seem to remove the abm, so not too sure.

Please see attachment
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on December 02, 2018, 10:23:15 AM
Quote from: br360 on December 01, 2018, 05:21:13 PM
Hey Pipke.

I just installed the 2.0 version using the DokuzHarf theme.

https://custom.simplemachines.org/themes/index.php?lemma=2870

I have the "abm" on the board index for that theme as well. This theme also has the generic icon profile image in the last post area so not sure if that has anything to do with it. I did try removing that generic icon code from the theme's index.css though and that didn't seem to remove the abm, so not too sure.

Please see attachment

Replace the attached file in Sources folder, it should fix the issue only for the DokuzHarf theme, if not let me know.
Title: Re: Avatars on Board and/or MessageIndex
Post by: br360 on December 02, 2018, 01:59:30 PM
Worked great Pipke. Thank you :)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Hero2019 on February 14, 2019, 06:42:47 AM
Hi,

Could you please adapt this mod to the RC1?

Thanks in advance.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Arantor on February 14, 2019, 06:46:48 AM
Quote from: Hero2019 on February 14, 2019, 06:42:47 AM
Hi,

Could you please adapt this mod to the RC1?

Thanks in advance.

Given that I think RC1 has most of the code required to do this...
Title: Re: Avatars on Board and/or MessageIndex
Post by: Hero2019 on February 14, 2019, 06:58:10 AM
Unfortunately, I do not see an adjustment option for RC1.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Arantor on February 14, 2019, 09:07:12 AM
I don't have an RC1 install handy, and if it is in RC1 it won't be in the same place and I think it may need a tweak to enable it since I think it is forcibly disabled (but hey, using something that is essentially still pre-release software can mean quite big bugs)
Title: Re: Avatars on Board and/or MessageIndex
Post by: SychO on February 14, 2019, 10:45:19 AM
Quote from: Arantor on February 14, 2019, 09:07:12 AM
I don't have an RC1 install handy, and if it is in RC1 it won't be in the same place and I think it may need a tweak to enable it since I think it is forcibly disabled (but hey, using something that is essentially still pre-release software can mean quite big bugs)

// Set the following variable to true if this theme wants to display the avatar of the user that posted the last post on the board index.
$settings['avatars_on_boardIndex'] = false;


I'm not sure but once you set it to true I believe you still have to edit the template files to output the avatar, setting it to true only loads the data
Title: Re: Avatars on Board and/or MessageIndex
Post by: Arantor on February 14, 2019, 10:51:43 AM
Huh, could have sworn it was functional entirely just for the hack to the theme index. Or maybe I fixed this a year ago in my fork and never realised.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Suki on February 14, 2019, 10:58:57 AM
Quote from: SychO on February 14, 2019, 10:45:19 AM

I'm not sure but once you set it to true I believe you still have to edit the template files to output the avatar, setting it to true only loads the data

Yes, that setting is there to avoid doing source edits, set it to true on your theme's index.template and you will have access to avatars data on board index.
Title: Re: Avatars on Board and/or MessageIndex
Post by: gecitli on February 14, 2019, 11:06:26 AM
index.template.php

find
// Set the following variable to true is this theme wants to display the avatar of the user that posted the last post on the board index.
$settings['avatars_on_boardIndex'] = false;


replace

// Set the following variable to true is this theme wants to display the avatar of the user that posted the last post on the board index.
$settings['avatars_on_boardIndex'] = true;


Boardindex.template.php

find

<p>', $board['last_post']['last_post_message'], '</p>

replace
<p>'.$board['last_post']['member']['avatar']['image'].' ', $board['last_post']['last_post_message'], '</p>
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on March 07, 2019, 01:08:37 PM
Quote from: Hero2019 on February 14, 2019, 06:42:47 AM
Hi,

Could you please adapt this mod to the RC1?

Thanks in advance.

for this info i'm working currently on a update for this mod for SMF 2.1 RC
Title: Re: Avatars on Board and/or MessageIndex
Post by: Hero2019 on March 07, 2019, 01:12:02 PM
Many Thanks Pipke.  :)
Title: Re: Avatars on Board and/or MessageIndex
Post by: cuongvttt 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.


Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on June 13, 2019, 01:12:20 PM
Quote from: cuongvttt on June 13, 2019, 04:29:29 AM
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.
Title: Re: Avatars on Board and/or MessageIndex
Post by: shadav 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 (https://custom.simplemachines.org/mods/index.php?mod=2665)
so that it will show the default avatars on the boards/child boards, instead of the "blank" default avatar
thank you
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on August 31, 2019, 05:48:00 PM
Quote from: shadav 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 (https://custom.simplemachines.org/mods/index.php?mod=2665)
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:

$avatar = preg_replace($find[2], ' src="'.$settings['images_url']. '/abm_avatar.gif"', $avatar);

replace with:

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:

SELECT mem.id_member,

replace with:

SELECT mem.id_member, mem.gender,


find:

if (empty($avatar))
$avatar = $settings['images_url']. '/abm_avatar.gif';

replace with:

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.
Title: Re: Avatars on Board and/or MessageIndex
Post by: shadav on September 01, 2019, 12:39:20 AM
thank you, works perfectly and thanks for the tip about the transparent log off setting
Title: Re: Avatars on Board and/or MessageIndex
Post by: maglix04 on January 01, 2020, 06:18:12 AM
Hello everyone and happy new year! Since I updated the forum to version 2.0.16 and also this morning to 2.0.17 the mod don't integrate well the image proxy function linking to images with http.
Solutions?
Sorry for my bad english
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on January 03, 2020, 05:10:31 PM
Quote from: maglix04 on January 01, 2020, 06:18:12 AM
Hello everyone and happy new year! Since I updated the forum to version 2.0.16 and also this morning to 2.0.17 the mod don't integrate well the image proxy function linking to images with http.
Solutions?
Sorry for my bad english

Mod updated:

Version 2.0.17 - Jan 3, 2020
- Fixed: Script proxy for external avatar urls
Title: Re: Avatars on Board and/or MessageIndex
Post by: maglix04 on January 03, 2020, 05:28:56 PM
Perfect! Thank you  ;)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 16, 2020, 03:34:44 PM
Same mod for SMF 2.1.* can be found here (https://custom.simplemachines.org/mods/index.php?mod=4246)
Title: Re: Avatars on Board and/or MessageIndex
Post by: pocttopus on February 16, 2020, 05:31:47 PM
What's today update changelog?  ???
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on February 17, 2020, 05:12:27 PM
Quote from: pocttopus on February 16, 2020, 05:31:47 PM
What's today update changelog?  ???

Nothing i just added comment where to find same mod for SMF 2.1
Title: Re: Avatars on Board and/or MessageIndex
Post by: pocttopus on February 18, 2020, 09:18:00 AM
Quote from: Pipke on February 17, 2020, 05:12:27 PM
Quote from: pocttopus on February 16, 2020, 05:31:47 PM
What's today update changelog?  ???

Nothing i just added comment where to find same mod for SMF 2.1
Thanks.  :)
Title: Re: Avatars on Board and/or MessageIndex
Post by: jsx on March 24, 2020, 01:56:12 PM
Hi Pipke,

Your modification causes errors in the forum. When I enter a topic and when I want to search the word through the search engine in this topic, an error appears. How to fix it?

(https://i.imgur.com/pXrfiIr.png)

Error log:

(https://i.imgur.com/56jb9Kc.png)

(https://i.imgur.com/Uo7hWv0.png)

(https://i.imgur.com/42nw7Oh.png)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on March 24, 2020, 04:38:29 PM
@jsx to me i wonder how you get these errors on the search page as the mod isn't suppose to run on that action, as my code has 3 conditions wich must be passed:

if ($context['current_action'] == 'forum' ||  $context['current_action'] == 'unreadreplies' || $context['current_action'] == 'unread')

and

if (isset($context['topics']) && !empty($context['topics']))

and

if (!empty($context['abm_user_id']))

At this moment i have no clue and on my test site i'm not getting errors on the search page/results, maybe some other mod conflict with it?
i have a hard fix for you:

in .../Sources/abm_code.php

Code (find line 137) Select

if (isset($context['current_action']) && $context['current_action'] == 'credits')


Code (add before) Select

if (isset($context['current_action']) && $context['current_action'] == 'search2')
return;





Title: Re: Avatars on Board and/or MessageIndex
Post by: jsx on March 25, 2020, 04:12:56 AM
@Pipke

I understand, but after uninstalling your modification, the search engine works properly. This error does not appear:

(https://i.imgur.com/pXrfiIr.png)

After adding this code, the search engine still does not work properly.

Critical Error:

(...)index.php?action=search2

Wrong value type sent to the database. Array of integers expected. (id)

Function: abm_mod_setup

File: /home(...)Sources/abm_code.php

Line: 183

I can uninstall all other modifications and install only your modification and then check if this error still occurs.
Title: Re: Avatars on Board and/or MessageIndex
Post by: jsx on March 26, 2020, 02:23:31 PM
@Pipke

I installed a clean forum and uploaded all the modifications that are used in the official forum and this error is not there. So what can cause this error? Do you have any idea?

Wrong value type sent to the database. Array of integers expected. (id)

As I wrote earlier. When I uninstall the Avatars on Board and/or MessageIndex modification, the search engine works properly.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on March 26, 2020, 07:01:47 PM
@jsx next try to fix your error

in .../Sources/abm_code.php

Code (find ) Select

foreach(array($abm_topics['id']) as $context['abm_user_id'][]) {}


Code (replace by) Select

if (isset($abm_topics['id']))
foreach(array($abm_topics['id']) as $context['abm_user_id'][]) {}


let me know if that works.
Title: Re: Avatars on Board and/or MessageIndex
Post by: jsx on March 27, 2020, 03:15:33 AM
@Pipke

Now this solution has fixed the problem. The search engine works and no errors are generated. Thanks for the help. :) 8)

This solution is only for me, will you make this change for modification?


Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on March 27, 2020, 08:48:26 AM
Quote from: jsx on March 27, 2020, 03:15:33 AM
@Pipke

Now this solution has fixed the problem. The search engine works and no errors are generated. Thanks for the help. :) 8)
Glad it's been sorted now ;)

Quote from: jsx on March 27, 2020, 03:15:33 AM
This solution is only for me, will you make this change for modification?
Hmmm, not sure where the problem is, i still think it comes from another mod wich you have installed, on a clean smf install with only my mod no errors. Ill wait if more users report this issue.
Title: Re: Avatars on Board and/or MessageIndex
Post by: jsx on March 27, 2020, 10:28:04 AM
@Pipke

I understand, but a new error occurred after moving the thread to another board.

index.php?action=movetopic;topic=1370.0
2: array_filter() expects parameter 1 to be array, null given
File: .../Sources/abm_code.php
Line: 316

(https://i.imgur.com/yBommjJ.png)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on March 27, 2020, 11:07:22 AM
@jsx wich mods do you all have installed?
Title: Re: Avatars on Board and/or MessageIndex
Post by: jsx on March 27, 2020, 01:32:28 PM
@Pipke

These mods are installed:

Avatars on Board/MessageIndex 2.0.17
SMF 2.0.17 Update 1.0
Like Posts 2.2    
Download Attachment 1.0    
ShowBannedMessage 1.6    
Ohara YouTube Embed 1.2.10    
AJAX Recent Topics 1.1    
SMFPacks Shoutbox Pro 1.4.5
SimpleColorizer 1.1    
Regbar Warning 1.0.5    
Confirmation message to Mark as Read 1.00    
@mention members 1.1.2    
reCAPTCHA for SMF 2.0.0    
Image Upload 1.0.0    
Medal Honor For Years 1.0
Admin member list registration date 1.2
Tapatalk SMF 2.0 Plugin 4.5.7    
Quick Spoiler 1.2.3    
Yet Another Global Announcements Mod 2.7.5
Ultimate Menu 1.0.3    
Change All Subjects 1.3
Drafts 2.2
TinyPortal 1.6.5    
dQuoteSelection 2.6.4
Title: Re: Avatars on Board and/or MessageIndex
Post by: pocttopus on May 19, 2020, 12:56:35 PM
Hello,

Is there some way to use this mod on 2.1RC2 version?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Horme Gaming on May 19, 2020, 01:38:28 PM
yes :) its under a different name however this mod seems to be similar:

https://custom.simplemachines.org/mods/index.php?mod=4246

Also by same author.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 19, 2020, 01:39:28 PM
yes -> Avatars Display Integration (https://custom.simplemachines.org/mods/index.php?mod=4246)
Title: Re: Avatars on Board and/or MessageIndex
Post by: pocttopus on May 19, 2020, 02:07:36 PM
Quote from: Pipke on May 19, 2020, 01:39:28 PM
yes -> Avatars Display Integration (https://custom.simplemachines.org/mods/index.php?mod=4246)
Thank you. ;)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Sectomy on July 12, 2020, 07:59:45 AM
hi,

i have a little PRoblem with the Sunrise theme, maybe the exact the same issue another guy have here, too.

Title: Re: Avatars on Board and/or MessageIndex
Post by: Sectomy on July 12, 2020, 08:20:43 AM
oh, and the avatar on message are not centered.....maybe a problem of me ?
Title: Re: Avatars on Board and/or MessageIndex
Post by: efk on July 12, 2020, 11:36:04 AM
Quote from: Sectomy on July 12, 2020, 08:20:43 AM
oh, and the avatar on message are not centered.....maybe a problem of me ?
Maybe this can help?
CSS - poster (https://www.simplemachines.org/community/index.php?topic=552727.0)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Sectomy on July 13, 2020, 12:07:56 PM
nope, but i tried anything, but....nope :( nothing happens...) all is centered but not the avatar :(
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on July 13, 2020, 02:13:36 PM
Quote from: Sectomy on July 13, 2020, 12:07:56 PM
nope, but i tried anything, but....nope :( nothing happens...) all is centered but not the avatar :(

Before we give you a lot of code that might help ... it's much easier if you share us your website url so we can take a look at what's going on there and maybe we can help further.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on July 13, 2020, 03:38:51 PM
@Sectomy found your site, add this to your ...Themes/{your_theme}/index.css

div.poster div {
margin: auto;
display: block;
}


result:
(https://i.ibb.co/WBdtHW5/image.png)
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on July 13, 2020, 04:05:46 PM
Quote from: Sectomy on July 12, 2020, 07:59:45 AM
hi,

i have a little PRoblem with the Sunrise theme, maybe the exact the same issue another guy have here, too.



where you want that font awesome user edit icon to be placed?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Sectomy on July 14, 2020, 02:02:48 AM
@pipke thank you for the index.css thing, about the icon, if its possible it looks like this:

so all is more centered and aligned properly.... the same with the abm theme problem in the DokuzHarf theme on page 9
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on July 14, 2020, 04:20:45 PM
Quote from: Sectomy on July 14, 2020, 02:02:48 AM
...about the icon, if its possible it looks like this:

so all is more centered and aligned properly.... the same with the abm theme problem in the DokuzHarf theme on page 9

open file .../Sources/abm_code.php

Code (find) Select

'~<p>abm<!----></p>~',


Code (add after) Select

'~<i class="fas fa-user-edit"></i>~',
'~<b>'.$txt['last_post'].'</b>~',


and

Code (find) Select

$avatar = preg_replace($find[12], '', $avatar);


Code (add after) Select

$avatar = preg_replace($find[13], '', $avatar);
$avatar = preg_replace($find[14], '<i class="fas fa-user-edit"></i><b>'.$txt['last_post'].'</b>', $avatar);


good luck with the edit, make backup of the file before editing!

if you did all right you will get this result:
(https://i.ibb.co/23pF5Wz/image.png)

Title: Re: Avatars on Board and/or MessageIndex
Post by: Sectomy on July 15, 2020, 02:28:46 AM
Perfect ! WOW ! Many Thanks !
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on May 03, 2021, 05:10:25 AM
Getting lots of these errors in 2.0.17 and the latest version of this mod

8: Undefined index: time
File: /var/www/html/Sources/abm_code.php
Line: 353


8: Undefined offset: 32
File: /var/www/html/Sources/abm_code.php
Line: 348


The mod is working fine though. Any ideas ?
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 03, 2021, 03:42:55 PM
Quote from: aegersz on May 03, 2021, 05:10:25 AM
8: Undefined index: time
File: /var/www/html/Sources/abm_code.php
Line: 353

8: Undefined offset: 32
File: /var/www/html/Sources/abm_code.php
Line: 348


try this edit:
Code (find) Select

if ($row['id_parent'])

Code (replace by) Select

if (isset($row['id_parent']))


let me know if that solved the errors.
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on May 03, 2021, 08:02:13 PM
Sorry but that didn't fix the errors and it also lost the avatars.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 04, 2021, 04:41:58 PM
sorry but i dont have a test smf 2.0 setup atm, so maybe this then?
Code (find) Select

if ($row['id_parent'])

Code (replace by) Select

if (!empty($row['id_parent']))
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on May 06, 2021, 08:15:14 PM
That's a little better.

it only happens every time I select the "Forum" app/button to view all the boards from my Simple portal front-end ... it then generates the 2 errors.

It's not a big deal and I can live with it so don't waste too much of your time on it.
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on May 10, 2021, 06:43:53 PM
I think that has worked as I get no more new errors.

Thanks for your help.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on May 11, 2021, 07:40:42 AM
Quote from: aegersz on May 10, 2021, 06:43:53 PM
I think that has worked as I get no more new errors.

Thanks for your help.

(https://media.giphy.com/media/9Ai5dIk8xvBm0/giphy.gif)
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 07, 2021, 05:46:32 AM
Oh no ! for some reason, the same problem has come back again every time i select "Forum" from Simple Portal.

Any more thoughts on this odd issue ?
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 07, 2021, 09:17:00 AM
here is a clue: it only happens when a post on a child of a child board has a date of Today or Yesterday and only when starting at the forum's root board (as you do when selecting "Forum").

Apart from that same couple of errors, it works properly.
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on June 07, 2021, 02:19:11 PM
Quote from: aegersz on May 03, 2021, 05:10:25 AM
Getting lots of these errors in 2.0.17 and the latest version of this mod

8: Undefined index: time
File: /var/www/html/Sources/abm_code.php
Line: 353


8: Undefined offset: 32
File: /var/www/html/Sources/abm_code.php
Line: 348


The mod is working fine though. Any ideas ?

does it still generate these two errors, or only one of it?
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 07, 2021, 03:26:23 PM
It generates both at a time.

I cannot reproduce it on a fresh test system with a few mods but on my "fully moded" systems, it doesn't matter how may posts fit the criteria I mentioned before, only two messages occur at a time.

I don't want to waste your time but if you can think of something easy then that's great.

Remember that I have over 150 mods on so it could be anything really (and not your logic) !

I have been dumping variables to the log but I either get too much data back in the form of huge arrays or very little.

Damn php, it's a tricky language for me.
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 07, 2021, 04:35:43 PM
Can you think of any mods that would interact with your fabulous mod ?

So far I have tried:

1. SimplePortal 2.3.6 [ Uninstall ]
2. Global Topics 2.2 [ Uninstall ]
3. Avatars on Board/MessageIndex 2.0.17 [ Uninstall ]
4. DevCenter 0.4.1 [ Uninstall ]
5. Tidy Child Boards 2.0 [ Uninstall ]
6. SA Chat 1.0b1 Rev120 [ Uninstall ]
7. EmailValidator 1.1 [ Uninstall ]
8. Topic Rating Bar 1.4.1 [ Uninstall ]

Check my signature for the full list of mods that I run, if you wish ...

I have attached the errors in more detail:
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on June 08, 2021, 02:07:59 PM
try this:
Code (find) Select

$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'] = $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'].'</div><p><!---->';


Code (replace by) Select

if (isset($context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time']))
$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'] = $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'].'</div><p><!---->';


Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 11, 2021, 12:18:14 AM
Thanks Pipke,

That got rid of one of the errors but this one still persists:

https://forum.drugs-and-users.org/index.php?8: Undefined offset: 31 File: /var/www/html/Sources/abm_code.php
Line: 350


The offset 31 is the parent and first-level child board, as you probably already know. So I made the following code change to get rid of this:

Find:
                                                if ($context['abm_avatars_value'][$row['id_board']]['last_id_member']) //member
                                                        $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $context['abm_avatars_value'][$row['id_board']]['last_id_member'] . '"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];
                                                else //guest or deleted account
                                                        $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];


Replace with:
                                                if ($context['abm_avatars_value'][$row['id_board']]['last_id_member']) //member
                                                        if (isset($context['categories'][$row['id_cat']]['boards'][$row['id_parent']]))
                                                                $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $context['abm_avatars_value'][$row['id_board']]['last_id_member'] . '"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];
                                                else //guest or deleted account
                                                        if (isset($context['categories'][$row['id_cat']]['boards'][$row['id_parent']]))
                                                                $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];


I was able to adapt your fix logic to the above. The only side effect of this odd error with my system is that there is no avatar displayed on the parent board for the most recent entry on it's child's child board - which is no problem as SMF vanilla (with your mod) doesn't even display the details of it at all.

We are done finally. Thanks again for your guidance.
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 11, 2021, 01:28:58 AM
This is what I mean ... as I said, my "vanilla" SMF 2.0.18 system with your mod doesn't even show the item i have circled, so i guess that it's a bonus  :).

The parent of the child of the child board is rectangled and it's contents are in the second attachment.

Both refer to the latest post in the "Cautions" board.

I know that this is not your bad logic as I have a bug in my "boards" logic and have had it for a for a fair while -  I had an empty board somehow (https://www.simplemachines.org/community/index.php?topic=572140.msg4049034#msg4049034) (?)
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 11, 2021, 04:45:32 AM
BTW, I made a 2.0.18 version to incorporate all these fixes if you are interested ...
Title: Re: Avatars on Board and/or MessageIndex
Post by: Pipke on June 11, 2021, 02:21:36 PM
Quote from: aegersz on June 11, 2021, 04:45:32 AM
BTW, I made a 2.0.18 version to incorporate all these fixes if you are interested ...

no thanks for the offer, then you would have to make a change for every 'own setup change' and that is not an option
Title: Re: Avatars on Board and/or MessageIndex
Post by: aegersz on June 11, 2021, 03:38:23 PM
Quote from: Pipke on June 11, 2021, 02:21:36 PM
Quote from: aegersz on June 11, 2021, 04:45:32 AM
BTW, I made a 2.0.18 version to incorporate all these fixes if you are interested ...

no thanks for the offer, then you would have to make a change for every 'own setup change' and that is not an option

Fair enough.