Advertisement:

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

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #20 on: April 07, 2016, 05:13:01 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 ;)

Brazil Portuguese translation attached.

thank you ;)


Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #21 on: April 07, 2016, 05:16:33 PM »
Okay, here is the solution for child boards.

Themes/default/MessageIndex.template

Find:

Code: [Select]
/* 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:

Code: [Select]
/* 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

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.

Offline DSystem

  • Jr. Member
  • **
  • Posts: 238
  • Gender: Male
  • EletronicaBR - Admin
    • eletronicaBR.com
Re: Avatars on Board and/or MessageIndex
« Reply #22 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


Offline OCJ

  • Full Member
  • ***
  • Posts: 481
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #23 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

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 369
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #24 on: April 20, 2016, 02:03:54 AM »
Okay, here is the solution for child boards.

Themes/default/MessageIndex.template

Find:

Code: [Select]
/* 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:

Code: [Select]
/* 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

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. ???

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #25 on: April 20, 2016, 07:38:07 AM »
@Wellwisher can you post your site url(with mod installed), so i can take look?

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 369
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #26 on: April 20, 2016, 03:27:17 PM »
@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.

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #27 on: April 20, 2016, 04:03:53 PM »
@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?

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #28 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.

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Avatars on Board and/or MessageIndex
« Reply #29 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.

Offline foropimiento

  • Semi-Newbie
  • *
  • Posts: 15
  • PimientosPicantes.com
    • PimientosPicantes
Re: Avatars on Board and/or MessageIndex
« Reply #30 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..

Offline NukeWorker.com

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
  • I love NukeWorker.com
    • Nuclear Jobs Pictures News
Re: Avatars on Board and/or MessageIndex
« Reply #31 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.

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 369
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #32 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

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Avatars on Board and/or MessageIndex
« Reply #33 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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Avatars on Board and/or MessageIndex
« Reply #34 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 369
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #35 on: April 29, 2016, 12:51:16 PM »
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.


Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: Avatars on Board and/or MessageIndex
« Reply #36 on: April 29, 2016, 12:58:43 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

Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Avatars on Board and/or MessageIndex
« Reply #37 on: April 29, 2016, 12:58:56 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.  :-\

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 369
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #38 on: April 29, 2016, 01:31:37 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.

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: Avatars on Board and/or MessageIndex
« Reply #39 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)
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)