Icewind Total Forum Thread Views [Deleted]

Lawrence

Well-known member
Lawrence submitted a new resource:

Icewind Total Forum Thread Views - Adds discussions (thread) views, and displays the total in the Sidebar and on each Forum

This is a complete re-write of this add-on: Icewind Dale RP Total Forum Thread Views

If you have the above add-on installed, uninstall it first, and remove the files from your server. This is not an upgrade, but totally new.

Whats new:
  • New directory structure
  • Cache rebuilding is handled by XenForos deferred method
  • File Health check added
  • No Template Listeners; replaced by...

Read more about this resource...
 
Is there xf_forum table alteration ?

Yes, it is in the read-me (I'll update the Overview). Before the alteration is added, (or removed when un-installing), the script checks for it existence first. The alteration adds one column to xf_forum called iwd_forum_views to store each forums total views count. Any alterations to existing XenForo tables I make I precede the column name with iwd_ to avoid any future conflicts with XF updates or other add-ons.
 
Please can you make a new Option.... Summaries the Message Views on the Main Node and its Sub Nodes (Total Views)

In the current Version it is seperate. Display the Total Views beside the Main Node.
 
@Lawrence I added the code to the wf_widget_stats template. For some reason, I can see the total forum threads views only on the /forums page in the stats block. On all other pages it shows Views: 0. Please help me to fix this. Thanks in advance.
 
@ngn.pw that stat was made to show on the forum list page, the required variable is not available to other pages that uses a sidebar. I have never used the any widget add-on so I can't give much help. It shouldn't be difficult though to create a listener to retrieve that stat for other pages as it is stored in the simple cache, which is loaded on every page load.
 
I'm also using Widget Framework for my forums. I simply made a template callback straight to "Icewind_ForumThreadViews_Model_Views" class with "getTotalThreadViews" methods, and it worked on all pages with sidebars.

UPDATE: It threw warning message about calling non-static function statically. I had to copy the exact function to my globally used Listener file and set it as a static function. But it works fine since then.


Just make your own listener file that will do this:
PHP:
return XenForo_Model::create('Icewind_ForumThreadViews_Model_Views')->getTotalThreadViews();
 
Last edited:
Can someone confirm that this is still working or something? I uninstalled the add-on a few months ago since I couldn't make the total values appear on other pages properly (used widget framework), but now I can, so I reinstalled the add-on again. Though, a few days ago we moved most of the threads on our forum to a Graveyard-like forum, and after I installed the add-on today, it seemed to be using the old counts value (maybe the data was kept on un-installation?):
icewind.webp
I tried rebuilding "Forum Thread Views" caches and manually running "Icewind Forum Views Update" cron entry, but the counts remained like the above :confused:
 
Can someone confirm that this is still working or something? I uninstalled the add-on a few months ago since I couldn't make the total values appear on other pages properly (used widget framework), but now I can, so I reinstalled the add-on again. Though, a few days ago we moved most of the threads on our forum to a Graveyard-like forum, and after I installed the add-on today, it seemed to be using the old counts value (maybe the data was kept on un-installation?):
View attachment 147695
I tried rebuilding "Forum Thread Views" caches and manually running "Icewind Forum Views Update" cron entry, but the counts remained like the above :confused:

Hi, like all my add-ons, when it is uninstalled nothing is left in the DB to indicate the add-on in question was ever installed. When you install this add-on, it is recommended to rebuild the cache: Admin->Tools->Rebuild Caches, and select Rebuild Now for the add-on. When you move threads, the views are not changed for either forum (intentional as those forums were viewed that many times), rebuilding the add-ons cache should update the totals to reflect the moved threads.
 
I'm not sure to be honest. Forum Thread Views has it's own table where it stores the views for each forum, and when the cron runs it then adds them up for each forum and adds the results to the xf_forum iwd_forum_views field.
 
I took a pause from an add-on I was working on to work on another. Forum thread views functionality would fit well with that add-on, so I'll look at adding that into it.
 
Back
Top Bottom