Who is viewing this topic [Deleted]

Looking much better @RisteD well done.

I would now make one simple change. Rough example:

PHP:
public function actionIndex(ParameterBag $params)
{
    $view = parent::actionIndex($params);

    if(!($view instanceof \XF\Mvc\Reply\View)){
        return $view;
    }

    // now do all your stuff

    return $view;
}

This way if the reply object is not valid you can essentially return early and not do all of that work and run queries.

It's a micro optimisation but worth doing rather than running queries that can't be used.
 
Looking much better @RisteD well done.

I would now make one simple change. Rough example:

PHP:
public function actionIndex(ParameterBag $params)
{
    $view = parent::actionIndex($params);

    if(!($view instanceof \XF\Mvc\Reply\View)){
        return $view;
    }

    // now do all your stuff

    return $view;
}

This way if the reply object is not valid you can essentially return early and not do all of that work and run queries.

It's a micro optimisation but worth doing rather than running queries that can't be used.
Thank you @Chris for providing me support. I'm still learning the XenForo framework but it's nice to learn something new. isn't that hard for class extensions. I'll post another update in few minutes with the given suggestion. We everyone want well good optimisation so users can be satisfied
 
1) This will be implemented in next update
2) What do you mean by moderator of this thread?

for example: I have set node moderator in admin panel
moderatorset.webp

after that setted moderator is shown at the bottom right

modview.webp

there are 2 option I guess, to show node moderator & thread moderator

would be good if you add thread moderator only, otherwise will be dublicated
 
In description on first page you say this:

I've added option to display members currently watching the thread. Just install and enjoy.

But, it doesn't work just out of the box, as I had to read and found that you added usergroup permissions, which is great, but you should mention that we have to setup them, so we can see add-on working.

So far, it works, thanks.
 
As requests, if it can be done (I have this on vB):

1) Time of last reading thread, when I hover over user name.
2) Ability to reset reading stats completely, per thread and/or globally.
2b) Maybe to setup cutoff time, like, who has read thread in last 30 day, 60 days... (ie time value is defined by us).

This first would be pretty useful, if it's possible.
 
A few things that IMHO will improve your Add-on
  1. Although not a rule, but a convention obeyed to by many Add-ons:
    Put code event listeners in class AddOnId\Listener
  2. Although not a rule, but a convention obeyed to by many Add-ons:
    Prefix class extensons with the original class name, eg. if you extend XF\Entity\User name your class AddOnId\XF\Entity\User
  3. Als per resource standards rule # 20 you should use code event entity_structure to modify the structure of an entity if that is all you need to do
  4. You most likely want to use templater function username_link instead of re-inventing the wheel and doing all the username markup manually (in a kinda inefficient way ;))
  5. Do not store timestamps as formatted dates, just store the timestamp \XF::$time as an integer - templater functions date, date_from_format, date_dynamic and date_time will take care of properly formatting this according to the visitors timezone (which you currently do not take into account at all).
  6. Setting phrases for views within the controller PHP code is possible, however it yould be much easier from a customization perspective to just have them in the template - this would alos allow them to be hard-compiled into the templates possibly avoiding a DB query.
    Just use templater function phrase to call them, eg. {{ phrase('who_is_viewing_a_thread') }}
  7. As per resource standards rule # 25 you should prefix your phrases so it is easy to distinguish them from core phrases and to avoid name clashes with other Add-ons
  8. The Add-on does not seem to respect user privacy setting Show your current activity
    By displaying all users that are currently viewing a thread (or that have read a thread in the past) it is being revealed to everyone what those users were doing exactly if the visitor has permission to view the block(s).
    IMHO only users that have this setting enabled should be shown unless the visitor has permission to bypass user privacy.
 
Last edited:
@RisteD
I've added option to display members currently watching the thread. Just install and enjoy.
Please feel free to ask for any ideas you might want to see in this product. If you found any bug(s) feel free to discuss in support topic.

Love this addon my friend! I have one recommendation and one question

Recommendation: I think the phrase is incorrect "display members currently watching the thread" doesn't really mean 'watching' which is when a user gets notified of an update to the thread.

I believe it means who is currently viewing the thread. If I'm incorrect I am very sorry. Otherwise I'd recommend changing it. Or if not, add a blurb in the addon that if they want to make that switch, they can use phrases to change it.

Not a big deal, just something I noticed

Now on to my question. in the settings the 'who has read and who's viewing' divs just before the quick reply (see the screenshot and note the red box)

I have another addon that does part of what yours does, but I will be dumping it.

we need the option to move the divs below the quick reply. Based on member input they're saying it looks like the thread ends where those two are.

Was this placed where it is by design? if so, info on moving it below would be helpful

whosviewing2.webp
 
who has read means - past perfect & past indefinite, all who has & had
watching - stands for who clicked on watch this thread
who is viewing - in real time

if author change phrases like you want, others will have a problem

regarding position, you have to tick Below quick reply
 
Top Bottom