Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Threads that lock themselves... Details »»
Threads that lock themselves...
Version: 1.00, by Zzed Zzed is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-12-2002 Last Update: Never Installs: 13
 
No support by the author.

Note: There is a 1.1 version of this hack that also checks
the message body of the first post. Scroll down to download the
updated zip file or click here to go to the post containing the attachment.

************************************************** **

We have an off topic forum in our site and sometimes users post useless
topics to bump up their post count or to start a flame war. A lot of
these threads have specific keywords or phreases in them that makes
them stand out. A few examples of these threads are, free post, sig test,
avatar test, etc...

This hack works only with new threads whose title contains the above mentioned
phrases.

This hack works with a database table of known substrings that a forbidden
thread title may contain. And if any of the table contents are detected as
a substring within the thread title, that thread will automatically get
locked with a note in the bottom of the subject, and the thread title
will also be prefixed with the words "Auto Lock".

Interestingly enough, the "meningless" thread posting has been significantly
reduced on our site.


I have created an interface through the Admin CP to add/edit/delete
these phrases.

Affected templates: none
Affected tables: 1 new table is created
Affected source files: newthread.php admin/index.php
New files: topics.php admin/topics.php

First create the following table:

create table topic (topicid smallint(5) unsigned not null auto_increment,title varchar(100) not null, primary key (topicid));

In admin/index.php
Look for the following code:
PHP Code:
// ***
makenavoption("New Posts","../mod/moderate.php?action=posts","<br>");
makenavoption("New Attachments","../mod/moderate.php?action=attachments");
makenavselect("Moderation","<hr>"); 
Add the following directly below it:
PHP Code:
// ***
makenavoption("Add Forbidden Topics","topics.php?action=add","<br>");
makenavoption("Modify Forbidden Topics","topics.php?action=modify");
makenavselect("Automatic Moderation","<hr>"); 
In newthread.php
Look for the following code:
PHP Code:
    // check for subject and message
    
if (trim($subject)=="" or trim($message)=="") {
      eval(
"standarderror(\"".gettemplate("error_nosubject")."\");");
      exit;
    }

    
$username $HTTP_POST_VARS['username'];
    
$password $HTTP_POST_VARS['password']; 
Add the following ddirectly below it:
PHP Code:
    $bad_topic 0;
    require(
"./topics.php");
    if(
isbadtopic($subject)) {
      
$bad_topic 1;
      
$subject "Auto Lock: $subject";
      
$message "$message\n\n[b]<<<<< This thread has been Auto Locked. >>>>>[/b]";
    } 
In newthread.php
Look for the following code:
PHP Code:
      if ($enableemail) {
        
$moderators=$DB_site->query_first("SELECT CONCAT(newthreademail,' ',newpostemail) AS newthreademail FROM forum WHERE forumid='$forumid'");

        
$modtable=$DB_site->query("SELECT DISTINCT user.email FROM moderator,user WHERE moderator.userid=user.userid AND forumid IN ($foruminfo[parentlist]) AND (newthreademail=1 OR newpostemail=1)");
        while(
$thismod=$DB_site->fetch_array($modtable)) {
          
$moderators['newthreademail'].=$thismod[email]";
        }

        if (
$moderators['newthreademail']!="") {
          
$mods=explode(" ",trim($moderators['newthreademail']));
          while (list(
$key,$val)=each($mods)) {

            if (
trim($val)!="") {
              
$toemail=$val;
              
$forumtitle $foruminfo['title'];
              
$threadinfo['title'] = $subject;

              eval(
"\$emailmsg = \"".gettemplate("email_moderator",1,0)."\";");
              eval(
"\$emailsubject = \"".gettemplate("emailsubject_moderator",1,0)."\";");
              
mail($toemail,$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
            }
          }
        }
      } 
Add this directly below it:
PHP Code:
      if($bad_topic==1) {
    
$DB_site->query("UPDATE thread SET open=0 where threadid=$threadid");
      } 
That's it.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-27-2003, 12:53 AM
spaceb spaceb is offline
 
Join Date: Sep 2002
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can you post it please
and i wanted to ask i can choose in what forum the threads going to lock himselfs
Reply With Quote
  #23  
Old 01-27-2003, 06:20 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL

Funny man.

Yes, and yes to both questions...

I can't do it rigtht this minute. I'll do it in the next day or so. Hope you don't mind.
Reply With Quote
  #24  
Old 01-31-2003, 02:03 AM
spaceb spaceb is offline
 
Join Date: Sep 2002
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you very much very usefull hack
Reply With Quote
  #25  
Old 02-13-2004, 10:13 PM
94DROPTOPZ 94DROPTOPZ is offline
 
Join Date: Dec 2003
Location: Arizona
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack is awesome!

I have actually seen it used on your web-site, and I think it's great

Do you have any plans to make this available for 3.0 ? :ermm:
Reply With Quote
  #26  
Old 05-08-2007, 05:47 AM
dpatel304 dpatel304 is offline
 
Join Date: Apr 2007
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see this is an extremely old mod. Would it be wise to us it on 3.6.5?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04357 seconds
  • Memory Usage 2,282KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete