[EAE Add-ons] Thread Participants [Deleted]

Lawrence

Well-known member
Lawrence submitted a new resource:

[EAE Addons] Thread Participants - View who has participated in a thread, view their posts, and post count.

This add-on allow members, with the permission, to view who has participated in a thread. Clicking the avatar/user name of a listed participant will display all posts that member has made in the thread. When viewing the users posts, the thread title can be clicked which take you back to the normal thread view. In forum view, the threads reply count can now be clicked to open an overlay that lists who has participated in the thread, clicking the user's post count on the right will take you to...

Read more about this resource...
 
Hello Lawrence (from Arabia?)! Just kidding...

:)

I'm very interested in buying your add-on.

Do you have any comments about the performance impact in a live Forum or bugs?

It's my only concern.

Thanks for your job.
 
Hello Lawrence (from Arabia?)! Just kidding...

lol, I heard that a few times... and it doesn't bother me, :)

I'm very interested in buying your add-on.

Do you have any comments about the performance impact in a live Forum or bugs?

It's my only concern.

Thanks for your job.

If you leave the default settings as is, 2 queries will be generated on thread view, both on this table: xf_thread_user_post. The first query retrieves the count for the '...x more link', and can be turned off to save a query. If it is turned off and there are more participants than is displayed a 'view more' link is used.

The second query pulls the participants from the xf_thread_user_post (the number you selected in options plus one more participant (for the view more link check), that inner joins the xf_user table. So this query should have little to negligible performance impact.

As for bugs, I haven't experienced any since I finished it and began testing it, so you may want to give it some more time as it was just released. I don't anticipate any, but... you never know.
 
Thank you very much for replying, Lawrence.

Just bought your add-on, but is returning a error in my log (194 pages of the same error and counting, a new error by second, the same one):

Code:
ErrorException: Template error: Cannot call method canViewParticipants on a non-object (string) src/XF/Template/Templater.php:984
Generated by: some_user 1/10/19 at 18:34

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Cannot call met...', '/usr/share/ngin...', 984, Array)
#1 src/XF/Template/Templater.php(984): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l3/s9/public/thread_list_macros.php(463): XF\Template\Templater->method('', 'canViewParticip...', Array)
#3 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l3/s9/public/widget_new_posts.php(25): XF\Template\Templater->callMacro('thread_list_mac...', 'item', Array, Array)
#5 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array)
#6 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('widget_new_post...', Array)
#7 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#8 src/XF/Template/Templater.php(1634): XF\Widget\WidgetRenderer->__toString()
#9 internal_data/code_cache/templates/l3/s9/public/whats_new.php(21): XF\Template\Templater->widgetPosition('whats_new_overv...', Array)
#10 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array)
#11 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('whats_new', Array)
#12 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#13 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:WhatsNew\\Ove...', 'public:whats_ne...', Array)
#14 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#17 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#18 src/XF.php(390): XF\App->run()
#19 index.php(20): XF::runApp('XF\\Pub\\App')
#20 {main}

Request state

array(4) {
  ["url"] => string(11) "/whats-new/"
  ["referrer"] => string(38) "https://forum.politz.com.br/whats-new/"
  ["_GET"] => array(1) {
    ["/whats-new/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

You know better than me, because I'm not a coder, but is something with the user clicking in "Whats New" link on the Forum.
 
Thank you very much for replying, Lawrence.

Just bought your add-on, but is returning a error in my log (194 pages of the same error and counting, a new error by second, the same one):

Code:
ErrorException: Template error: Cannot call method canViewParticipants on a non-object (string) src/XF/Template/Templater.php:984
Generated by: some_user 1/10/19 at 18:34

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Cannot call met...', '/usr/share/ngin...', 984, Array)
#1 src/XF/Template/Templater.php(984): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l3/s9/public/thread_list_macros.php(463): XF\Template\Templater->method('', 'canViewParticip...', Array)
#3 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l3/s9/public/widget_new_posts.php(25): XF\Template\Templater->callMacro('thread_list_mac...', 'item', Array, Array)
#5 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array)
#6 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('widget_new_post...', Array)
#7 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#8 src/XF/Template/Templater.php(1634): XF\Widget\WidgetRenderer->__toString()
#9 internal_data/code_cache/templates/l3/s9/public/whats_new.php(21): XF\Template\Templater->widgetPosition('whats_new_overv...', Array)
#10 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array)
#11 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('whats_new', Array)
#12 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#13 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:WhatsNew\\Ove...', 'public:whats_ne...', Array)
#14 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#17 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#18 src/XF.php(390): XF\App->run()
#19 index.php(20): XF::runApp('XF\\Pub\\App')
#20 {main}

Request state

array(4) {
  ["url"] => string(11) "/whats-new/"
  ["referrer"] => string(38) "https://forum.politz.com.br/whats-new/"
  ["_GET"] => array(1) {
    ["/whats-new/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

You know better than me, because I'm not a coder, but is something with the user clicking in "Whats New" link on the Forum.

Sorry about the error. It's fixed now, I'll release an update later today. The reason there are so many errors thrown is because its template related, and it generated one non-object error per thread as it was looped through for each user viewing the what's new page.

Thank you for reporting this bug, it's appreciated.
 
When you show the list of all posts of a user in a thread, you should add a noindex robots meta tag to the <head> area.

I'd also add a rel="nofollow" attribute to these links:

HTML:
<a href="/threads/thread-participants-paid.17/participant/?user=2" class="avatar avatar--xxs avatar--default avatar--default--dynamic" data-user-id="2" img="true" title="Posts: 3" style="background-color: #339999; color: #061313">

One more suggestion: Add a better visible notice, that indicates that the user-post-lists only contain 1 user's posts (and not the whole thread), because the last line in this screenshot can easily be overseen:

Bildschirmfoto 2020-02-05 um 07.41.45.webp

Source: https://eaeaddons.com/threads/conversation-tools-paid.7/participant?user=2
 
Good morning, and thank you for the suggestions. I will add in the no follow attributes and no index tags.

As for viewing the posts by a user, adding a style property should suffice?
 
Thank you for considering to implement my suggestions!

As for viewing the posts by a user, adding a style property should suffice?
I'd suggest a block like this:

HTML:
<dl class="blockStatus blockStatus--standalone">
    <dt>Notice</dt>
    <dd class="blockStatus-message">
        This is a list of all X posts by Y in this thread. <a href="#">View whole thread</a>.
    </dd>
</dl>
 
Update: I added the noindex tag for that template above. I'm not sure why I missed it as I had it already added to another template. Thank you for pointing that out. I'll look at adding the noFollow either today or tomorrow.

Below is a screen shot of the notice I added. It looks really good in my opinion and I am glad you suggested it. I left the stats above the notice as I think it is useful (to see the ratio, for example). Odd thing though, I had to add the phrase for the word Notice (even though it is not displayed, I added it. .blockStatuse > dt is set to display none). I thought it would be a Xenforo standard phrase, but it is not.

thread_view_user_posts_notice.webp
 
Purchased. Looks nice (y)

Why don't you use a phrase for the participant list title? Instead you use a (not translatable) admin option named tptipParticipantsTitle (default: "Participants"):

Bildschirmfoto 2020-02-10 um 23.49.57.webp

It would be cool, if the FA Icon would have a size that matches the avatar sizes:

Bildschirmfoto 2020-02-10 um 23.50.58.webp

And 1 more suggestion: Split the permissions; 1 for "view participants list" ad 1 for "view participant's posts" (the latter one would be new; for the list of all posts made by a user; I'd like to limit these lists to staff members).
 
@nocte your suggestions came at a good time, there is another suggestion I am going to implement when I am finished with the newest add-on I am currently working on, and I'll look into adding yours as well.

Lawrence
 
@nocte I've added a style property for the fa-icon, so size, weight, and color can be changed. I also split the permissions as you suggested as well.

Also added/implemented members viewing a thread, :) I have that list defaulted to user names below the list of posts, this can be changed via options.

I set the title in the options for convenience sake. Can't the title, for example Participants, just be replaced there in another language?
 
Also added/implemented members viewing a thread,
That's nice, indeed. But I'd outsource this into another addon. Speaking for me: I am using Xon's User Activity addon, which is using redis (for better performance).
So I would not need that functionality.

I set the title in the options for convenience sake. Can't the title, for example Participants, just be replaced there in another language?
Sure, but that does not work for multi-language forums ;)
 
Lawrence updated [EAE Add-ons] Thread Participants with a new update entry:

New feature and new permissions added.

Bug fixes:
  • nil

Features:
  • added a new style property to allow changing the fa-icon size, color, and weight.
  • added a new permission group, and moved the view thread participants permission from forum permissions to the new [EAE] Thread participants permissions group.
  • added a new permission to view participants posts. With this added permission, members can be set to view who participated in the thread but not view their number of posts or list...

Read the rest of this update entry...
 
Thank you for the update!

In EAEAddons\ThreadParticipants\XF\Pub\Controller\Thread you have this code in the actionParticipantList method:

PHP:
        if (!$thread->canViewParticipants() || !$thread->canViewParticipantsPosts() || !$this->options()->tptipThreadViewMax)
        {
            throw $this->exception($this->noPermission());
        }

Why do you check for !$thread->canViewParticipantsPosts()? This will prevent also users who have permission to view participants form viewing the list.

Also in the template modification with the key eae_tptip_thread_list_macros: You should check for $thread.canViewParticipants(), and not for $thread.canViewParticipantsPosts().

This is untested, but I think my suggestions should fix the behavior in a way, that is correct in my opinion.
 
Good morning, and thank-you for the inquiries. Your first question: that is a check to ensure if an admin decided to temporarily turn off the add-on, that it is actually turned off.

For the second question, that is done to allow members to view the list of thread participants, but not allow them to view all the posts made by the member, unless the admin gives them the permission to do so.

What behaviour (I'm Canadian, therefore the 'u') are you referring to?
 
Well, there are 2 permissions now:
  1. View thread participants
  2. View participants posts
When I want to look at the participants list a check for the 1st permission should be sufficient. But You check for both permissions and return a noPermission error unless both permissions are true.

Regarding the template modification eae_tptip_thread_list_macros:
For the second question, that is done to allow members to view the list of thread participants, but not allow them to view all the posts made by the member, unless the admin gives them the permission to do so.
Yeah, but you do the opposite (you check for the wrong permission).
 
Well, there are 2 permissions now:
  1. View thread participants
  2. View participants posts
When I want to look at the participants list a check for the 1st permission should be sufficient. But You check for both permissions and return a noPermission error unless both permissions are true.

Regarding the template modification eae_tptip_thread_list_macros:
Yeah, but you do the opposite (you check for the wrong permission).

I think something went wrong with your update to the add-on. I checked my dev site and my live site for the template modification, and this is the template permission check:

<xf:if is="{$thread.canViewParticipantsPosts()} && {$thread.reply_count} && {$xf.options.tptipThreadViewMax}">

Notice the permission ends with Posts().

Also I tested the permissions, and could not reproduce the throwing of the error if either, or both of those permissions are set to yes or no. With that said, thank-you because I found an error where you could not view those viewing a thread without having the view participants set to yes. This is now fixed, so now you can set the permissions to view both thread participants and those viewing a thread, or view just the thread participants, or view just those viewing the thread (the way this add-on was intended to work). I'll release an update when I know for sure that the permission issue you reported in the first quote of this post is due to a problem when updating, and not due to a bug undiscovered.

Lawrence.
 
Back
Top Bottom