• Welcome to Simple Machines Community Forum. Please login or sign up.
October 18, 2021, 12:16:06 PM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


Avatars on Board and/or MessageIndex

Started by Pipke, April 05, 2016, 06:27:00 PM

Previous topic - Next topic

nend

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

Kindred

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.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Wellwisher

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

Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

420SA

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?

Pipke

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?
"If something is wrong, fix it if you can. But train yourself not to worry. Worry never fixes anything."
My Mods for SMF:
Avatars Display Integration
Avatars on Board and/or MessageIndex
Recent Forum Topics on Boardindex
Relative Time Formats

420SA

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 ]

juventusventus

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.

qc

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 :)

juventusventus

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.

Pipke

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.
"If something is wrong, fix it if you can. But train yourself not to worry. Worry never fixes anything."
My Mods for SMF:
Avatars Display Integration
Avatars on Board and/or MessageIndex
Recent Forum Topics on Boardindex
Relative Time Formats

nfmovil

Hi , I have this error :



And the problem is in this mod in this line:



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']
),

Ian Mc

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.

d3vcho

Hello Pipke!


I've translated your mod into Spanish_es with some changes from Spanish_latin. Hope it helps!
"Greeting Death as an old friend, they departed this life as equals"

MartiMedia

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

MartiMedia

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 ;-)

Pipke

Trying to make this mod to a hook only mod, this will take some time.
"If something is wrong, fix it if you can. But train yourself not to worry. Worry never fixes anything."
My Mods for SMF:
Avatars Display Integration
Avatars on Board and/or MessageIndex
Recent Forum Topics on Boardindex
Relative Time Formats

MartiMedia

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

aegersz

June 21, 2016, 10:09:28 PM #58 Last Edit: June 21, 2016, 11:09:32 PM by aegersz
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 !
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

T3CHN0

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

Advertisement: