Auto Lock Old Topics

Started by vbgamer45, August 06, 2009, 12:30:14 AM

Previous topic - Next topic

Arantor

I'd consider pricing auto locking old threads for 1.1.10 (same functionality as this mod) at $50. Please PM me if you're interested.

aw06

ok, will contact you if i decide to indulge
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Oh, I've today added a variant mod, Auto Purge Old Topics - same deal as this one, just it removes old topics. It's currently awaiting approval by the Customizer team.

defensieforum

Quote
I'd consider pricing auto locking old threads for 1.1.10 (same functionality as this mod) at $50. Please PM me if you're interested.

Has anyone already ordered a version for 1.1.x? And if so, will this become public available to?
I could realy use this mode but are still using 1.1.10 at this moment. I don't know if it is possible to use this source code and implement it in 1.1.10 by running something like a cron job?
Defensieforum - Ezine -- www.defensieforum.nl
Powered by SMF

Arantor

No one has ordered as yet.

Yes, it could be done through a cron job, which would be ideal, and essentially it would just have to call virtually the same query as in scheduled_autoLock. You're free to use the code but it will need work to change over to the 1.1 database method (or you do it manually with mysql_query)

The reason I'm not prepared to make this for 1.1 without investment is that there is no task scheduler in 1.1 while there is in 2.0, meaning this can be used by people without access to cron on their server.

defensieforum

Okay I will have a look at the code next week and try to make it compatible with de 1.1.x database an run it by cron job.
But I am not sure about the schedule function in 1.1.x. If I am correct there is a setting to optimize the database every xx days in the admin section. This should also use some form of schedule function....

regards,

Peter
Defensieforum - Ezine -- www.defensieforum.nl
Powered by SMF

Arantor

There is - kind of. I suppose you *could* push it into there, but I wouldn't recommend it. Purging posts then optimising tables is suitably blocking that on even a modest forum it would start to get painful.

aw06

Quote from: defensieforum on September 26, 2009, 05:27:59 AM
Okay I will have a look at the code next week and try to make it compatible with de 1.1.x database an run it by cron job.
But I am not sure about the schedule function in 1.1.x. If I am correct there is a setting to optimize the database every xx days in the admin section. This should also use some form of schedule function....

regards,

Peter

What I'm figuring in SMF 1.1.10 and all SMF for that matter, we have the option to display a warning to users when a topic has not been posted in for any amount of days we set. So this auto-lock mod maybe somehow could be added as a trigger of that built in SMF feature, which to me seems like some kinda of scheduler ...

So if i set the forums to warn a user about a topic after 90 days, would be nice to have an option to also lock said topic after 90 days has passed .... And maybe this can be simply hard coded into smf without the use of a mod ...

What do you think king Arantor ??
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Except that the trigger isn't calculated like that at all.

Internally there's just a count of days, and if the topic hasn't had a reply in that long, it just displays the message; it isn't worked out until actually displaying the thread.

You could have it auto lock on viewing the thread, I suppose, but it's not the same.

aw06

Quote from: Arantor on September 28, 2009, 06:23:30 PM
You could have it auto lock on viewing the thread, I suppose, but it's not the same.

Hmmm, this would be useable as well 8) can it be hard coded ? or this needs a mod ?

" Warning: This message has not been replied to in 90 Days and will now be locked "
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

It would have to be a mod.

What I am contemplating doing is waiting until Auto Purge Old Topics is approved and considering making a single 1.1. compatible mod that handles both, since it's easier to do that way as then there's only one central point of task scheduling. I will not commit to doing this, it's just something I had considered as an idle thought.

kiano

hi guys)

u can add this query to your Cron jobs. this query is for SMF 1.1.10 and locks old topics (how old? 90 days)

update smf_topics, smf_messages set smf_topics.locked=1 where smf_messages.id_msg=smf_topics.id_last_msg and (unix_timestamp(now()) - unix_timestamp(from_unixtime(smf_messages.posterTime)) > 60*60*24*90);

where 60*60*24*90 - 90 days in seconds.

Donations: Z444012958716
Thanks))

Arantor

Thanks for that snippet (note that you shouldn't just use smf_ as the prefix; not all users have that).

This mod will shortly be obsolete once I finish the big brother version that has support for 1.1 in it too.

aw06

Quote from: kiano on November 04, 2009, 06:36:20 AM
hi guys)

u can add this query to your Cron jobs. this query is for SMF 1.1.10 and locks old topics (how old? 90 days)

update smf_topics, smf_messages set smf_topics.locked=1 where smf_messages.id_msg=smf_topics.id_last_msg and (unix_timestamp(now()) - unix_timestamp(from_unixtime(smf_messages.posterTime)) > 60*60*24*90);

where 60*60*24*90 - 90 days in seconds.

Donations: Z444012958716
Thanks))

Where exactly to add this ??

Quote from: Arantor on November 04, 2009, 06:44:06 AM
Thanks for that snippet (note that you shouldn't just use smf_ as the prefix; not all users have that).

This mod will shortly be obsolete once I finish the big brother version that has support for 1.1 in it too.

Will the ads be locked regardless .. lets say someone posted in the topic a day before the lock time .. will it still be lock .. the idea we want something to lock 'inactive topics' and not so much topics made x days ago.. and how soon will your mod be ready ?
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Quote from: aw06 on November 04, 2009, 07:28:12 AM
Where exactly to add this ??

In a separate file that starts by loading SSI.php and calling it from cron in your forum control panel.

QuoteWill the ads be locked regardless .. lets say someone posted in the topic a day before the lock time .. will it still be lock .. the idea we want something to lock 'inactive topics' and not so much topics made x days ago.. and how soon will your mod be ready ?

The mod as currently being built allows you to pick on a per board level how many days passed since the last reply to a topic before locking, and optionally ignoring sticky threads. E.g. a thread with no reply in 15 days can be locked, not a topic 15 days old (note that this is actually the same as this mod already does)

As ever, when it's done. I'm temporarily suspending some development due to RL issues and a pretty much total loss of self confidence though. (Which I do not wish to discuss publicly, thanks)

It is in any case a lot of work to backport to 1.1 since there is no scheduled task system in 1.1.

aw06

OK, will wait on your mod ... as doing it the cron job way sounds complicated.. :-[
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

kiano

if u want to add cron job, u must do:

1) make file query.sql (or other name)
2) cron job command: mysql -u mysql_user --password=your_password < path_to_your_sql-file

tderheim

Quote from: kiano on November 04, 2009, 06:36:20 AM
update smf_topics, smf_messages set smf_topics.locked=1 where smf_messages.id_msg=smf_topics.id_last_msg and (unix_timestamp(now()) - unix_timestamp(from_unixtime(smf_messages.posterTime)) > 60*60*24*90);
A simple solution to an annoying problem.  Thank you much - I modified the query a bit and then added it to my scheduler.  Works like a charm.  Maybe my server is especially fast, but I just locked about 6,000 posts in a small fraction of a second so I'm not sure the "heavy blocking" is an issue.  Although naturally it makes more sense to implement it as a cronjob, especially for bigger boards.

Arantor

The query is pretty light all round actually.

Just easier to implement on 2.0 to do it regularly.

smc1979

Would it be possible to make a request? I am using this on my forum and having it auto lock topics over 30 days old with no replies.
What would be nice is if it could add a post to each one saying something like

"Topic Auto Locked Due To No Replies In 30 or more Days"

You can have it pull the number of days from the settings.

Thanks again for this add on :-)

Shane

Advertisement: