• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[DS] Auto Lock Threads

Status
Not open for further replies.

DarkSign

Active member
#1
[DS] Auto Lock Threads v2.2 BETA
Let's your threads being auto locked after a limited number of posts, or after a Date/Time, or even after some Interval.
Good for games threads, spam threads and event threads.

It is still a BETA release. Feedbacks are welcomed as always.

Installation

  1. Upload the DS folder to your XenForo's /library folder (ex: /www/html/forum/library).
  2. Go to ACP -> Add-ons -> Install Add-on -> Install from Uploaded File
  3. Select the addon-DSAutoLockThreads-x-x.xml file
  4. Click Install add-on
  5. Wait for the system to finish installing it
Upgrading

  1. Upload the folder as explained on item 1 of Install procedure, overwritting the files
  2. Go to ACP -> Add-ons -> Auto Lock Threads -> Upgrade -> Upgrade from Uploaded File
  3. Select the addon-DSAutoLockThreads-x-x.xml file
  4. Click Upgrade add-on
  5. Wait for the system to finish upgrading it
Observation:

PHP 5 >= 5.3 version required for it to work.
Developed using XenForo 1.0.4. Prior versions were NOT tested by me. It may or may not work on them.

On the file name, x-x corresponds to the released version (1.0, 2.0, etc)

Usage

  1. Every thread now will show a new link, Auto Lock Options
  2. By clicking on this link, it will open a form overlay, where you can set the limit for the thread.
  3. Input the maximum number of posts allowed, or fill the date/time accordingly, or fill the interval
  4. From ACP -> Applications -> Node Tree -> List Limited Threads, you can check which threads have the auto lock feature, and you can clean the limit any time, clicking on the red X button
  5. That ACP section now have the View thread link, that will open the referred thread in another tab/window, and that is now better organized, filtering threads limited by posts or by date/time
  6. Threads with an Interval will be showed as limited by date/time as well
Change log

v2.2
  • Fixed a bug with the Post limit.
  • Added the Limit by Interval feature, as requested
  • Edited the look and feel of the overlay

v2.0
  • Added a lot of phrases to the system, all prefixed with ds_
  • Added new templates, as the form overlay
  • Added the Limit by date/time feature as requested
  • Prevents the Auto Lock Options link to appear, if the thread is already locked
  • Edited the ACP section, now with better readability, and thread link opening in new tab/window
v1.1
  • Added the link to the limited thread on ACP
  • Changed the phrase Delete on the Delete Button to Clear Limit
  • Added the Limit Lower Than Current Posts Count check
Screenshots

v1.0 - 1.1
AutoLockThreads_block.jpg Limited_Threads_List.png Clearing_Limit.png AutoLockThread_1_1_low_limit_exception.png

v2.0
Auto Lock Options link.png Auto Lock Options Edit Overlay.png ACP Limited Threads List.png

v2.2
AutoLockThreads_2_2_Interval_Option.png

Notes

The Date/Time limit is based on the current SERVER time!! So please test it properly.

It's my first add-on. It's here so you can test it, so it may not work so well on your forum as it worked on mine. I know it's not perfect, but got easy on me. If that interests you, then test it and post some feedback. Suggestions and critics are all welcomed. I hope to do more works in the future.
Also, thank you all the development community here, for sharing all your experiences and tips on developing for XenForo. That helps a lot. And a special thanks for Syndol, the one who always listens to my newbies questions.

Donation
The add-on is still on beta stage. But if you want to support it, and the future add-ons, you can donate any value clicking here.

Download
 

Attachments

Mythotical

Well-known member
#7
Gratz on this, you beat me to it though. I was thinking of something similar but using a countdown as well. So thread closing can be done after so many days or posts.
 

Mythotical

Well-known member
#9
Very nice, I noticed that after I posted but figured I would leave it to give some support. Throw up a paypal email in your first post and I'll throw you a donation for doing this.
 

DarkSign

Active member
#16
That depends on which browser you are using.

Anyway, what where you doing when you got this error? So I can try to reproduce it.

And I think I found a bug, so if you guys are using it and are having some weird behaviours, please let me know, while I try to catch that. Thank you.
 

DarkSign

Active member
#18
So, here is how to open the JS console there: Click the wrench button > Tools > Javascript console > On the window, click the Console button (my browser is pt-br, sorry if the instructions is not accurate). Then you input the same value, and check that console window. Post the error founded. I will try to replicate it here too.
 

Mufasa

Active member
#19
Ok done, here is the error i got:

<b>Fatal error</b>: Call to undefined method DateTime::setTimestamp() in <b>/home/ubrggnet/public_html/library/DS/AutoLockThreads/ControllerPublic/AutoLockThreads.php</b> on line <b>197</b><br />
 
Status
Not open for further replies.