Advertisement:

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

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 #40 on: April 29, 2016, 01:39:01 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/

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.  ;)
« Last Edit: April 29, 2016, 01:54:07 PM by nend »

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,119
  • Gender: Male
    • Kindred-999 on GitHub
Re: Avatars on Board and/or MessageIndex
« Reply #41 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 369
  • Gender: Male
Re: Avatars on Board and/or MessageIndex
« Reply #42 on: April 29, 2016, 02:13:20 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).

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,051
    • Arantor on GitHub
Re: Avatars on Board and/or MessageIndex
« Reply #43 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.
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 420SA

  • Semi-Newbie
  • *
  • Posts: 46
Re: Avatars on Board and/or MessageIndex
« Reply #44 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?

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #45 on: May 06, 2016, 11:32:08 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?

Offline 420SA

  • Semi-Newbie
  • *
  • Posts: 46
Re: Avatars on Board and/or MessageIndex
« Reply #46 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 ]

Offline juventusventus

  • Newbie
  • *
  • Posts: 2
Re: Avatars on Board and/or MessageIndex
« Reply #47 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.

Offline qc

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

Offline juventusventus

  • Newbie
  • *
  • Posts: 2
Re: Avatars on Board and/or MessageIndex
« Reply #49 on: May 10, 2016, 03:12:38 AM »
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.

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #50 on: May 10, 2016, 10:07:42 AM »
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.

Offline nfmovil

  • Semi-Newbie
  • *
  • Posts: 40
Re: Avatars on Board and/or MessageIndex
« Reply #51 on: May 17, 2016, 12:47:19 AM »
Hi , I have this error :



And the problem is in this mod in this line:

 

How can I fix it?

Code: [Select]
// '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']
),

Offline Ian Mc

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

Offline d3vcho(void)

  • On Hiatus
  • SMF Hero
  • *
  • Posts: 2,245
  • Gender: Male
  • Be prepared for hell
    • d3vcho on GitHub
    • @SMF_ES on Twitter
Re: Avatars on Board and/or MessageIndex
« Reply #53 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!

Offline MartiMedia

  • Semi-Newbie
  • *
  • Posts: 25
Re: Avatars on Board and/or MessageIndex
« Reply #54 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

Offline MartiMedia

  • Semi-Newbie
  • *
  • Posts: 25
Re: Avatars on Board and/or MessageIndex
« Reply #55 on: June 19, 2016, 07:40:02 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 ;-)

Offline Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: Avatars on Board and/or MessageIndex
« Reply #56 on: June 20, 2016, 01:57:46 AM »
Trying to make this mod to a hook only mod, this will take some time.

Offline MartiMedia

  • Semi-Newbie
  • *
  • Posts: 25
Re: Avatars on Board and/or MessageIndex
« Reply #57 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

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,117
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Avatars on Board and/or MessageIndex
« Reply #58 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:

Code: [Select]
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 !
« Last Edit: June 21, 2016, 11:09:32 PM by aegersz »
SMF 2.0: 135+ mods installed (the full list can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline T3CHN0

  • Full Member
  • ***
  • Posts: 630
  • Gender: Male
  • knowledge is power
    • Tarago Pravia Estima
Re: Avatars on Board and/or MessageIndex
« Reply #59 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