- Compatible XF Versions
- 2.1 , 2.2
- Visible Branding
If you have a larger forum with numerous nodes this add-on may not be for you. You could still use it to just display who is viewing a thread.
This add-on keeps track and displays where members are viewing in categories, pages, forums, and threads. On forum home, you may choose to display the members avatar, username, or just the grand total of viewers (clicking the total will open an overlay that displays the members viewing that section of your forum). The data is displayed in a footer within each category, or under each section that does not have a parent category.
For categories, pages, forums, and threads a new row is inserted under the content that displays the viewing members avatar, username, or just the grand total. You may also choose to display members viewing these areas in a widget instead.
What this does: if, for example on forum home you have a setup like this:
no threads, just an empty forum
Thread 1 (Joey is viewing this thread)
Thread 2 (Martin is viewing this thread)
Large dogs (Anna is in this sub forum)
On forum home, you will see in the footer of Pets that Joey, Martin, and Anna are all viewing somewhere within this category. If you enter Cats, no one will be listed as viewing that section. If you go to Dogs, you will see Joey, Martin, and Anna are viewing that sub-forum. If you enter Small dogs you will now just see Joey, and Martin are viewing that sub forum. And so on.
Groups & permissions -> User group permissions -> xxxxxxxxxx -> [EAE] View members viewing forums
Only those with the permission can view who is viewing a category, page, threads, etc. The permission is not set on install. Be sure to give the user group you want to see who is viewing the permission.
The add-on respects user privacy settings and this can be over-ridden by those that have the bypass privacy permission.
Guests will not generate any queries unless they are given the permission to view who is viewing.
Members will generate one write query whenever they move within a forum. This query is to a memory table.
Members will generate one read query to retrieve the list of members viewing. If you elect to use a widget, an additional query is needed to retrieve the list of sibling and child nodes.
Forum home will always generate one query to retrieve the totals, and one additional one if username or avatar is selected to be displayed.
On install one table is inserted: xf_eaevrs_viewers, engine is MEMORY.
You can style the block that lists members viewing: Appearance -> Style properties -> yourStyle -> [EAE] Viewers.
A new widget position is added: [EAE] Page view: Sidenav, that you can also use for other widgets if you like.
Forum home will generate the largest read query as it is the home to all nodes, sub-nodes. If your forum has a large number of nodes it is recommended to set forum home to display totals only. You may even need to set forum home to 0 to disable that feature, select whatever works best for your forum.
Forum home also comes with the option to use a simpler query for retrieving the list of members viewing each section. This is recommended. See the description in the options for more information about it.
A cron job runs once an hour to prune the table used to keep track of members viewing:
[EAE] Prune viewers.