Version: 2.0, by Abe1
Developer Last Online: Jun 2010
Category: Moderators Functions -
Version: 3.7.x
Rating:
Released: 03-04-2008
Last Update: 03-04-2008
Installs: 1468
DB Changes Uses Plugins
Additional Files
No support by the author.
Force Users to Read a Thread 2.0
About this hack:
This hack allows you to set a thread as 'must read' by your members. Right now, if you make a post and want all your members to read it, you have no way of enforcing it. This hack will give an error message similar to the one you get when you need to change you password, saying that the admins want you to read a certain thread before they continue using the forum.
Once a user reads a thread, they wont be bugged to read it again.
You can set all usergroups or just certain onces that must read a thread.
You can set to site wide or just some forums.
Option to Force Guests
This hack added one query to every page on your forum a member goes to.
Files edited: 0
Templates edited: 0
Files to upload: 2 (1 via ACP, 2 via FTP)
Time to install: 1 minute
Updates:
Version 2.0 (03/05/08):
First Release of this Hack for vb3.7
MAJOR update. Hack totally re-writen. You must uninstall old version before upgrading.
Fixed just about all bugs. (like if you delete a thread...)
No more template edit. Everything done in ACP.
Permissions for by who ever has ACP access with threads and posts
Force Guests to read a thread now.
Works for BOTH vb3.6 AND vb3.7
Please post your comments or suggestions for this hack. I read ALL posts.
MAKE SURE YOU CLICK INSTALL! You will get an email when a new version is released.
Just some friendly developer advice, you can chose to look at this and implement or not, but I would suggest either following what I did or the developer may have a better solution I didn't think of. I ran an EXPLAIN query on this SELECT query since it showed up in my slow queries log
PHP Code:
$force_thread = $db->query_first(" SELECT * FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "force_read_users AS force_read_users ON (thread.threadid = force_read_users.force_read_threadid AND force_read_users.force_read_userid = '".$vbulletin->userinfo['userid']."') WHERE thread.force_read = '1' AND (thread.force_read_expire_date = '0' OR thread.force_read_expire_date > '".TIMENOW."') AND (". implode(' OR ', $where_usergroups) .") AND (". implode(' OR ', $where_forums) .") AND force_read_users.force_read_userid IS NULL ORDER BY force_read_order ASC ");
Obviously I entered in some values into it to make the variables work in phpMyAdmin. Here's what i found with my relatively small forum:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE threadALL NULL NULL NULL NULL 11877 Using where; Using filesort
1 SIMPLE force_read_users eq_ref PRIMARY PRIMARY 8 const,temp1.thread.threadid 1 Using where; Using index; Not exists
I added a index to the 'thread.force_read' row (since its boolean and a super small length) and heres the improvement
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE threadref force_read force_read 1 const 18 Using where; Using filesort
1 SIMPLE force_read_users eq_ref PRIMARY PRIMARY 8 const,temp1.thread.threadid 1 Using where; Using index; Not exists
Should give you a MUCH more efficient query, I only have a few threads in my forum that we use the force read for (like for new rules), so I would think a site that uses this all the time with a lot more threads would see a substantial improvement
PS apologize for the terrible formatting of the exlpain query, never could line up columns easy on vbulletin
ok just installed and it isnt working, when i put the info in the fields, and it says saving, the list that should show the threads i want to be viewed keeps showing as empty. Not sure what i did wrong, any help would be appreciated.