Is it possible to auto-lock a topic when nobody replies to that topic for 20 days orso?
at the moment: No!
however I was personally considering doing a mod for it... maybe when things cool of at uni i will...
the biggest problem is the actual chore of locking the topics after a certain amount of time.. but I'd figured out a reasonably quick way of doing it...
I dont spend much time at these forums anymore, but this topic caught my eye ;)
so dont expect me to read many if any replies ;) (if you get no other positive replies maybe message me)...
after this monday I'll maybe see what I can do ;)
this mod can be easily done !!
I am just waiting for the final/stable release of SM 1.0 and I will start working on light mods like this one ..
Okay, let's hope the stable will be released soon then :) Thanks in advance Nevermind.
Lainaus käyttäjältä: Tyris - huhtikuu 21, 2004, 06:33:15 AP
the biggest problem is the actual chore of locking the topics after a certain amount of time
Crontab is your friend ;D You just need a script that runs daily, hourly, or at whatever interval you want
hmm... what is crontab -_-;; and does it work on windows machines? (obviously it would run daily)
There's a windows port... basically it is like "Task Scheduler" but more powerful and lightweight.
-[Unknown]
aa, ok, cool ^_^
but will this work with a default php + mySQL install? or does it need addons?
Sorry to resurect an old topic, but I have search on this and found nothing.
Is now-a-days any mod available to auto-lock a topic based on age?
Can I just ask why lock old topics? Allowing people to reply to older topics reduces spam.
how do you use cron tabs? what are the commands for it?
Lainaus käyttäjältä: Prasad007 - helmikuu 01, 2006, 01:26:27 IP
how do you use cron tabs? what are the commands for it?
Plenty of resources on cron available on the web.
http://www.htmlcenter.com/tutorials/tutorials.cfm?id=155&type=PHP
http://www.modwest.com/help/kb5-125.html
http://www.webmasterworld.com/forum88/6102.htm
Plus you can ask your host for cron assistance.
Lainaus käyttäjältä: kegobeer - helmikuu 01, 2006, 01:32:56 IP
Lainaus käyttäjältä: Prasad007 - helmikuu 01, 2006, 01:26:27 IP
how do you use cron tabs? what are the commands for it?
Plenty of resources on cron available on the web.
http://www.htmlcenter.com/tutorials/tutorials.cfm?id=155&type=PHP
http://www.modwest.com/help/kb5-125.html
http://www.webmasterworld.com/forum88/6102.htm
Plus you can ask your host for cron assistance.
Thanks a million! :)
Anyone know the query to auto-lock non-sticky topics that haven't had a reply in six months?
huwnet: that's what I was was looking for. Even crappy phpbb has a mod to do that...
You could just write a few lines of PHP to do this, saves working out complex queries.
The topic table has the ID of the last message posted so it's easy to find out the date of the last message. If it is over 6 months ago run another query to lock that topic.
Lainaus käyttäjältä: jcoleuk - helmikuu 05, 2006, 09:26:00 AP
You could just write a few lines of PHP to do this, saves working out complex queries.
The topic table has the ID of the last message posted so it's easy to find out the date of the last message. If it is over 6 months ago run another query to lock that topic.
This is exactly what I am looking for. I would rather not have a bulky mod that adds to the admin centre and may not get updated.
Anyone volunteer to write the code / query?
Something like this might work:
TOPIC=1
for TOPIC=1 to count(ID_TOPIC) {
LASTMSG= SELECT smf_topics.ID_LAST_MSG from smf_topics where smf_topics.ID_TOPIC=TOPIC
LASTMSGTime = SELECT smf_messages.posterTime from smf_messages where smf_messages.ID_MSG=LASTMSG
If (LASTMSGTime-now>6 month) set ID_TOPIC.locked = 1
ID_TOPIC=ID_TOPIC+1
}
run on cron? or everytime someone visits the page?
PHP pro needed thought. 8)
Running as a cron would be better for server performance