The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello,
Do you think it is possible make a limitation for the replies for all the threads under a certien forum or for the whole forums ? ( Example : After reaching reply number 100 in a thread it should close its self or no one can add more replies ) hmmm, what do you think dear friends ? Best regards, |
#2
|
||||
|
||||
![]()
it shouldn't be hard at all, I think. Just a hack in newreply.php.
Maybe something like this: Open newreply.php and find: [code] if ($visible) { if ($threadinfo[replycount]%10==0) { $replies=$DB_site->query_first("SELECT COUNT(*)-1 AS replies FROM post WHERE threadid='$threadid'"); $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'"); } else { $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,last poster='".addslashes($postusername)."' WHERE threadid='$threadid'"); } } [/php] Change it to (changes hilighted): Code:
if ($visible) { [high]if ($threadinfo[replycount]=="98") { $closethread = ",open='0',notes='Thread automatically closed on 100th post'"; } else { $closethread = ""; }[/high] if ($threadinfo[replycount]%10==0) { $replies=$DB_site->query_first("SELECT COUNT(*)-1 AS replies FROM post WHERE threadid='$threadid'"); $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."'[high]$closethread[/high] WHERE threadid='$threadid'"); } else { $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."'[high]$closethread[/high] WHERE threadid='$threadid'"); } } If you want to do this to only specific forums, the the code should be (addition marked in highlight AND bold): Code:
if ($visible) { [high]if ($threadinfo[replycount]=="98" && ($threadinfo[forumid]=="XX" || $threadinfo[forumid]=="XX")) { $closethread = ",open='0',notes='Thread automatically closed on 100th post'"; } else { $closethread = ""; }[/high] if ($threadinfo[replycount]%10==0) { $replies=$DB_site->query_first("SELECT COUNT(*)-1 AS replies FROM post WHERE threadid='$threadid'"); $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."'[high]$closethread[/high] WHERE threadid='$threadid'"); } else { $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."'[high]$closethread[/high] WHERE threadid='$threadid'"); } } Hope that helps. |
#3
|
|||
|
|||
![]()
Hello bira,
Thanks for your help and so much appreciated ![]() Best regards & wishes, Rythem |
#4
|
|||
|
|||
![]() |
#5
|
||||
|
||||
![]()
is there a way that i can set the number of replys when i start it in the thread?
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|