is there anyway to add this to SMF?
i would like to restrict topic size to around 500-600 posts per topic and then it get automatically locked.
to be more specific, i would rather have it happen by board. but the above is fine.
is there a way to do this? :)
thanks in advance.
*sits waiting for neptune_tp* ;)
This is definately something you should ask at the SMF forums.
Most likely it will be a mod.
But..maybe, if Post.php have info on how many replies the thread has, the Post.template could choose to NOT show the posting screen, just a message saying "topic is full" or something. No messing with the database.
I will check.
In fact - it does. ;D
cool :)
how do i do that? and is there a way to make the topic auto lock?
Locking is harder..but to do what I meant...maybe change Display.template - and Post.template too - to NOT show reply/quote button and quick-reply when number of replies goes over a set value. (That could be in current theme settings). Instead it will show a small note above the post "This thread have over x posts, and cannot be replied too" for example. Sam thing in Post.tempalte, just in case someone tries a "action=post" link even if the thread has no button. ;) It could also be only for non-admins.
well, i guess that's perfectly fine :)
how do i do that?
Open up Display.template first..then insert this right after the "global $context, $settings, $option..." line:
// check if topic is over x number of replies, admin CAN reply regardless
$max_replies=2;
if($context['num_replies']>$max_replies && !$context['user']['is_admin']){
$context['can_reply']=false;
}
Then the same spot in Post.template.php, just in case someone does a manual link:
// check if topic is over x number of replies, admin CAN reply regardless
$max_replies=2;
if($context['num_replies']>$max_replies && !$context['user']['is_admin']){
fatal_error('This topic has reached its maximum number of replies.');
}
This should take away reply,quote and quick-reply unless you are an admin, and give a error if someone does a manual link instead. That way you will have those attempts in your error log too.
I have just made number of replies a very small number - 2 - to test things. Change them to your liking in both places.
thanks bloc!!
is it right though? the global $context, $settings, $option.. line appears 2x in display.template and 3x in post.template
:)
the top one in all of them. :)
ah only the top one xD
i did it in all of them :P
It may not matter..but best to just put it once there..to easy find it again. ;)
k :) it seems that after i put it in all 2 or 3 of them, i got a nice flood of errors.
soimething about num_replies.
i'll remove the others. :)
thanks Bloc!