Lock thread after x replies

Started by ScousePete, September 30, 2006, 02:03:53 PM

Previous topic - Next topic

ScousePete

Is it possible to lock a thread after x number of replies? x would need to be variable per thread.

I have a board that I use as a kind of sign-up site for volunteering shifts. We only need a specific number of people per project. Once the alloted number of people have signed up, the thread would close. I saw something similar for phpbb, but it  could only be configured on a per forum basis, not per thread.

Anyone up for the challenge?

codenaught

Do you mean after a topic has x replies it will be locked automatically or more like a moderator clicks a button such as "Lock this topic after x more replies have been made"?
Dev Consultant
Former SMF Doc Coordinator

ScousePete

Quote from: akabugeyes on September 30, 2006, 10:08:57 PM
Do you mean after a topic has x replies it will be locked automatically or more like a moderator clicks a button such as "Lock this topic after x more replies have been made"?

Thanks for replying. Either way would work. Initially I thought it would be best to select the option when the post is first made, but a moderator button would work as long as x could be variable.

codenaught

Okay, well it would really simple if you wanted a topic to be locked after x amount of posts were made to it. But if that is something you would want, do you want the x to be configurable per board or make it configured to a forum wide setting? Perhaps I can make the mod work so that it can be both. "0" would be used for a board to use the default setting limit, and if a specfic board uses an number other than 0, it would use a custom number of posts for a topic to be locked in that particular board.
Dev Consultant
Former SMF Doc Coordinator

ScousePete

Quote from: akabugeyes on October 01, 2006, 11:38:28 AM
Okay, well it would really simple if you wanted a topic to be locked after x amount of posts were made to it. But if that is something you would want, do you want the x to be configurable per board or make it configured to a forum wide setting? Perhaps I can make the mod work so that it can be both. "0" would be used for a board to use the default setting limit, and if a specfic board uses an number other than 0, it would use a custom number of posts for a topic to be locked in that particular board.

The option to switch it on and off would be in the ACP. The variable (x) would need to be selected per thread. Kind of like this...


codenaught

Oh okay. That could be done too. I will take a look into this when I get the chance to.
Dev Consultant
Former SMF Doc Coordinator

ScousePete

Thanks so much, I appreciate your help.

ScousePete

Quote from: akabugeyes on October 01, 2006, 01:19:32 PM
Oh okay. That could be done too. I will take a look into this when I get the chance to.

Any update on this?

codenaught

I started work on the mod. Hopefully it won't take me too long to finish.
Dev Consultant
Former SMF Doc Coordinator

ScousePete

Quote from: akabugeyes on October 06, 2006, 04:09:03 PM
I started work on the mod. Hopefully it won't take me too long to finish.

Do you need any help beta testing? I have set up a test forum using easyPHP and would be happy to help any way I can.

MoreBloodWine

I'll gladly help beta test myself as I think this to be a very nice mod if made to work like the pic above shows heh...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

I am afraid I don't anticipate having the time to do this until the weekend. But when that comes hopefully I can release something that you guys can test.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

Quote from: akabugeyes on October 18, 2006, 06:07:00 PM
I am afraid I don't anticipate having the time to do this until the weekend. But when that comes hopefully I can release something that you guys can test.
I dont know about anyone else but I'm not really in any rush... but if I may are you implementing or will be implementing a permission for this so it can be set on a group basis...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

Frankly I figured that using the current lock topic permission would do just fine. You feel it needs a separate permission?
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#15
Quote from: akabugeyes on October 18, 2006, 06:20:43 PM
Frankly I figured that using the current lock topic permission would do just fine. You feel it needs a separate permission?
It might when you think about it bec there would probably conflicting issues with the permissions...

1. Lock Topic
2. Lock Topic after x replies

Some might not see it but I see that without seperate permissions meaning a new one for this specific mod might cause some problems for some people...

Edit : Some people might wana lock it after the reply thing but some might wana just lock it outright... and theres your issues... but ya I personally feel a new / seperate permission for this would be a good idea... as I'm hoping you and others will as well...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


ScousePete

Quote from: akabugeyes on October 18, 2006, 06:20:43 PM
Frankly I figured that using the current lock topic permission would do just fine. You feel it needs a separate permission?

For me, anyone who can lock a topic would be permission enough.

Thanks

MoreBloodWine

But my whole point on this was some people might wana lock a topic outright without waiting for replies whhile others would wana lock a topic after x amt of relies... so thats why I feel a seperate permission for this would be a good idea... like seen in the pic someone posted where you se both options to lock topic and lock topic after x replies...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

Sorry about the long wait. I have been pretty busy lately and haven't had so much time to work on this. I also got a bit stuck on some javascript I was going to use for the mod (basically including javascript, but making the mod still work if javascript was disabled on the browser). I may just abort the javascript idea if I can't find another way. It was to have it look like this:

[ ] Lock this topic. After [  ] more replies.
Where the "After" part you would enter the number you wanted but it would be disabled through a simple html disabled="disabled" until the Lock this topic was checked. Although now that I think about this more, that wouldn't work so well, because if the topic was already locked from beforehand you wouldn't really want to input the "After [   ]" unless you were to unlock the topic. Maybe I can check the topic's lock status prior to showing the "After [  ] more replies" part of it and if the topic is already locked to not show it.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#19
Quote from: akabugeyes on October 27, 2006, 09:44:05 PM
Sorry about the long wait. I have been pretty busy lately and haven't had so much time to work on this. I also got a bit stuck on some javascript I was going to use for the mod (basically including javascript, but making the mod still work if javascript was disabled on the browser). I may just abort the javascript idea if I can't find another way. It was to have it look like this:

[ ] Lock this topic. After [  ] more replies.
Where the "After" part you would enter the number you wanted but it would be disabled through a simple html disabled="disabled" until the Lock this topic was checked. Although now that I think about this more, that wouldn't work so well, because if the topic was already locked from beforehand you wouldn't really want to input the "After [   ]" unless you were to unlock the topic. Maybe I can check the topic's lock status prior to showing the "After [  ] more replies" part of it and if the topic is already locked to not show it.
Just make it so it looks / works like this... individual permissions so all you'd be doin is make a mod that just adds a new permission to lock after x replies...

Edit : Personally I think that would be the best way to do it... just make a mod that adds the new permission... so youll see something like the below pic... assumin you have the permission to ... lock after x replies...

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


ScousePete

Quote from: MoreBloodWine on October 19, 2006, 06:47:02 PM
But my whole point on this was some people might wana lock a topic outright without waiting for replies whhile others would wana lock a topic after x amt of relies... so thats why I feel a seperate permission for this would be a good idea... like seen in the pic someone posted where you se both options to lock topic and lock topic after x replies...

I think we have some confusion over the word "permission" :)
Maybe I should rephrase. I believe there should be two separate "options" One to lock the thread outright, one to lock the thread after x number of replies.
Whoever is "allowed" to lock threads (ie has that permission or power) would also be able to lock threads after x replies. If they weren't allowed to lock threads, that option would not appear.

Does that make sense? Just like the picture that I posted.

AKAbugeyes, thanks for all your hard work - don't make it any more complicated than it needs to be!

ScousePete


codenaught

ScousePete, I am sorry about the really long delay. I would like to let you know I have spent time on it today, and a mod should be available really soon.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

Quote from: akabugeyes on November 10, 2006, 05:01:19 PM
ScousePete, I am sorry about the really long delay. I would like to let you know I have spent time on it today, and a mod should be available really soon.
I'm actually gettin excited hehe... but I have to ask since it seems as your almost done you most likely have the overall look done... so lemme ask will it be modled to look like this... where it has a seperate permission from the lock topic as seen in this pic...

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

I decided against including it in the post page. Instead it is a mod button (next to other mod buttons such as Lock Topic/Move Topic), and the button won't show if the topic is currently locked.

As for the additional permission .... I think I will probably include an admin option to let the admin configure the permissions separate from the usual lock topic permission, but only if they want to. ;)
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#25
Quote from: akabugeyes on November 10, 2006, 05:21:32 PM
I decided against including it in the post page. Instead it is a mod button (next to other mod buttons such as Lock Topic/Move Topic), and the button won't show if the topic is currently locked.

As for the additional permission .... I think I will probably include an admin option to let the admin configure the permissions separate from the usual lock topic permission, but only if they want to. ;)
Guess that means I have to make another new button... can you please supply me with the text the buton will have so I can least get that much out of the way on my end ? Thx

Edit : What made you decide against it being on the post page... I kinda like the idea of havin it there ;-P
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

Maybe something like "Set Lock Time" or "Set Pending Lock"? I haven't really made a decision exactly what to call it, so I am open to suggestions.

I decided to do this because it is not that noticeable if it is just on the posting page. All moderation actions should be available where the other moderation buttons are. Maybe I can include it on the posting page as well, but it may not be until a future version of the mod.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

Well either way I'd be willing to pay for a version of this mod that has it on the posting page similar to the pics above... but naturally an agreed upon price would be required hehe... I mean the mod buton if you will is fine but like you said maybe you can make a version that has it on the posting page as well... so later on down the progression road you could maybe just have one version that has the mod button with the posting page option as well or just release two versions one with mod button one with posting page option , who knows hehe... that road can be crossed when its time to cross it ... either way I look forward to a production of this mod ;-)

Half the time I forget those buttons are there but I always look at posting options ;-P
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

#28
You will be happy to know that I am going to include the feature on the posting page under additional options as well as the button. :) The functionality on my test forum is nearly complete and soon I will be able to work on packaging it all up. ;)

Since both of you guys offered to help beta test, I think I will accept the offer and attach a package in this topic before I post it to the mod site to make sure everything works fine.

Edit: Would anyone like a feature where there is a box on the top of the topic saying something like This topic will be locked after X more replies are made?
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#29
Quote from: akabugeyes on November 11, 2006, 01:40:47 PM
Edit: Would anyone like a feature where there is a box on the top of the topic saying something like This topic will be locked after X more replies are made?
Actually that might not be a bad idea... I mean if it turns out to not be so good it can always be pulled out or something... but ive got my producton forum and my test forum so im open to beta test almost anything lol...

Edit : Not that im not grateful lol... bec i am but what made u decide to go with the post page as well...

Edit : On that note thing your considering maybe you could also add this... spamming a topic to lock it wil NOT be tolerated...

Edit : Something just hit me... the uote above like I said is a good idea but that number would have to have the functionality to be able to change as that number would minus one after each reply made... hope that can be worked out...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


ScousePete

Quote from: akabugeyes on November 11, 2006, 01:40:47 PM
You will be happy to know that I am going to include the feature on the posting page under additional options as well as the button. :) The functionality on my test forum is nearly complete and soon I will be able to work on packaging it all up. ;)

Since both of you guys offered to help beta test, I think I will accept the offer and attach a package in this topic before I post it to the mod site to make sure everything works fine.

Edit: Would anyone like a feature where there is a box on the top of the topic saying something like This topic will be locked after X more replies are made?

I would be happy to help in any way I can. The box at the top of the topic would be a nice touch!

MoreBloodWine

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

I got most of  the beta packaged, but as usual ran into some problems with it trying to install a particular file. Hopefully not too much longer though. ;)
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

K , just wanted to check in... im all for beta testing it still... just wnated to make sure we didnt lose ya hehe...
Edit : Just out of curiosity what sort of peoblems we lookin at ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

#34
Attached is Beta 1 of the mod - Lock Topic After Certain Number of Replies

Known issues:
  • When changing the number of replies needed to lock a topic when editing a post, the number is unchanged.
  • Has not been optimized for compatibility with other mods. Expect it not to work with a number of mods.
  • Does not use a separate lock permission (as requested). An additional permission should be added by the final release of 1.0 of this mod.
  • Logic may be a bit confusing. If you make a reply and set the number to 30 (for example), after the post is submitted it will then be at 29.
    Feel free to test it. :) Preferably on a test forum until you are comfortable of how well it works.

    Notice: This release is now outdated. You should download and install this release instead.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

Woot... I'll give it a run through and post any errors if I find any...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

#36
Set Pending Lock 1.0 Beta 2 has been released.

The changelog for this release is as follows:

Quote! Editing a post didn't update the number of replies to lock count when it was changed. (Subs-Post.php)
! The linktree when on the "Set Pending Lock" page now contains the current position. (LockTopic.php)
! Those with proper permission could adjust the pending lock number even when topic was locked on "Set Pendng Lock" page. (LockTopic.php)
+ A notice is now shown in a topic if a pending lock has been set, with number of replies shown. (Display.php, Display template)
! The name of this mod has been changed to "Set Pending Lock" to allow for future expansion of different pending locks. (install.xml, package-info.xml)
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

Hey aka question for ya... most people like me have chosen not to upgrade to 1.1 final, but for me its bec I run three forums and dont wana hand code alot of mods back in... so can you keep a 1.1 RC3 version of this out for DL for those that choose not to go 1.1final ? Thx ;-)

Also I'll test the new version and post any errors ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

I will continue support for RC3 with all of mods for a certain amount of time, but eventually will stop once RC3 has been out for awhile. You really should upgrade sooner than later. Are you waiting for mod authors to update their mods? One idea is to set up a test forum using 1.1 final and see what mods work without any changes needed. I found every single mod of mine that is currently released is compatible with SMF 1.1 final already without any changes needed.

If you have a lot of custom code that doesn't come from a mod, you might want to look at making personal mod packages for them so it is easy to reapply the changes you made after an upgrade.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

Quote from: akabugeyes on December 03, 2006, 08:55:23 PM
I will continue support for RC3 with all of mods for a certain amount of time, but eventually will stop once RC3 has been out for awhile. You really should upgrade sooner than later. Are you waiting for mod authors to update their mods? One idea is to set up a test forum using 1.1 final and see what mods work without any changes needed. I found every single mod of mine that is currently released is compatible with SMF 1.1 final already without any changes needed.

If you have a lot of custom code that doesn't come from a mod, you might want to look at making personal mod packages for them so it is easy to reapply the changes you made after an upgrade.
Im holding back on upgrading bec I run three forums I dont wana have to hand code some mods into bec i use custom themes on every single one... I just dont like the fact that if I upgrade all my work gets wiped out... and its alot of damn work **sighs**
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


ScousePete

I think I am a bit dense, but where do you "switch it on"?


codenaught

Just change the value of 0 to whatever you want. Or click on the mod button "Set Pending Lock" and set the number there.
Dev Consultant
Former SMF Doc Coordinator

ScousePete

#42
Quote from: akabugeyes on December 04, 2006, 12:54:45 AM
Just change the value of 0 to whatever you want. Or click on the mod button "Set Pending Lock" and set the number there.

Ok, now I get it, but I am having an issue with quick-reply

Using regular reply, the mod works like a charm, but when I use quick-reply it seems to delete the auto-lock and the alert disappears. Most of my users use quick reply.

Any suggestions?

codenaught

Quick reply is indeed something I need to address. I'll try to get out another release soon with support of quick reply.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

As far asI can tell everythings fine for me except for the quick reply like the guy above... but so far so good...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

Glad it is working okay. :)

I have released Beta 3 which includes a fix for quick reply.

Changelog:

Quote1.0 Beta 3
-------------
! When posting with quick reply, the replies to lock number wasn't decreasing. (Display template)
+ Added some padding to the display of replies until topic is locked at the top and made the number bold. (Display template)
+ Started implementation of disabling the indicator at the top of topic, although the interface is not yet there. (Display template)
& Changed some language strings with some rewording and to make it easier to translate. (Modifications language file)
Dev Consultant
Former SMF Doc Coordinator

ScousePete

Quote from: akabugeyes on December 04, 2006, 06:02:26 PM
Glad it is working okay. :)

I have released Beta 3 which includes a fix for quick reply.

Changelog:

Quote1.0 Beta 3
-------------
! When posting with quick reply, the replies to lock number wasn't decreasing. (Display template)
+ Added some padding to the display of replies until topic is locked at the top and made the number bold. (Display template)
+ Started implementation of disabling the indicator at the top of topic, although the interface is not yet there. (Display template)
& Changed some language strings with some rewording and to make it easier to translate. (Modifications language file)

No bugs so far! Thanks for all your hard work.

Advertisement: