vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Threads that lock themselves... (https://vborg.vbsupport.ru/showthread.php?t=37363)

Zzed 04-12-2002 10:00 PM

Threads that lock themselves...
 
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. :D


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. :)

TECK 04-13-2002 10:10 AM

very useful hack. i will test it later on.

Velocd 04-13-2002 02:55 PM

So...let me get this straight. If a member starts a thread called "Flame Everybody", automatically that thread will be locked? Or..is it just key words, or key sentences or what?
Sounds good :D

It would also be cool to have a hack that auto-locks specific members out of a thread if they swear too much or flaming somebody. That would be lengthy though..

Either way, both hacks make it easier for the moderators. :D

Zzed 04-13-2002 05:08 PM

Yes.

Let's say for example, you have the word poop in the topic table. Any thread title containing the word poop as a substring will automatically get locked.

poop
poop thread
let's have a pooper smilie

All the titles above will cause the new thread to be locked. ;)

hypedave 04-13-2002 05:50 PM

installed easy but when I go to add a Forbidden Topic
all I get is a white screen

Zzed 04-14-2002 03:31 AM

Did you create the new table in your MySql database?

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

hypedave 04-14-2002 03:33 AM

Quote:

Originally posted by Zzed
Did you create the new table in your MySql database?

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

yes I sure did

Zzed 04-14-2002 08:21 AM

Hmm :(

This is strange. I backed ou tof the hack and resintalled it. No problems. :confused:

Maybe if you can make me admin on your board for a brief moment, I'll be able to troubleshoot this. You can either PM me or Email me at edwink@seebeyond.com.

GeorgeofCS 04-15-2002 11:11 PM

Great hack. However just curious if there's a way to add certain things mentioned in the message, or replies. I say this because site's like mine could put words like xxx, hardcore action, etc. And it would immediately lock that thread.

Zzed 04-16-2002 07:26 AM

I have an extended version that also checks the message content of the first post.

If you make the auto lock work with the replies, your users will abuse it and can potentially get every thread in your forums locked.

If you are interested I will post the revised version to check the contents of the first post. :)

GeorgeofCS 04-16-2002 09:07 AM

Never thought of that with replies. I am interested though in check the first message body :)

Jawelin 04-16-2002 09:22 AM

Quote:

Originally posted by Zzed
I have an extended version that also checks the message content of the first post.

If you make the auto lock work with the replies, your users will abuse it and can potentially get every thread in your forums locked.

If you are interested I will post the revised version to check the contents of the first post. :)

YAH! I'm very interested in.... Yes.
I have many users that post ofter something like
'try'... 'don't read'... etc.

It could be possible even to check the length of the message body to evaluate if it's to be locked... or not?
(just in case of sensitive words put in long and interesting threads...)

I'm very ansious to see your next version!
I'm planning to modify it to 'freeze' the author's post counter.... :)

Thanks

Zzed 04-16-2002 04:31 PM

Ok, here is the revised version that also checks for the first message body.

Neo 05-07-2002 06:08 PM

Question Zzed. Does this auto close it if there is these certain words in a post?

Zzed 05-08-2002 05:28 AM

neo, the hack checks the title and contents of the initial post in the thread.

If the hack were to be extended to the replies, any member can get a thread locked. You can potentially have every thread locked.

Smoothie 05-08-2002 06:37 AM

Nice hack, just added it. Question for ya. How can I get it to display the same as your forums? With the padlock.gif and autolock.gif

Those are very cool! :classic:

spaceb 01-22-2003 12:50 AM

Very usefull hack, thanks alot.

I was wondering if you could make this hack move threads with the "bad" words to a specific forum, like "Garbage forum" so we could always see those posts and warn the posters , and for other meanings too :p

Zzed 01-22-2003 08:26 PM

I can post a one liner for you that will do this for you. ;)

You can just add it to the existing hack.

geniuscrew 01-24-2003 08:26 AM

Does this work with 2.2.9?

Sounds cool!

Zzed 01-24-2003 09:26 AM

Yes. :)

I am currently running 2.2.9 in my forums.

spaceb 01-27-2003 12:53 AM

can you post it please :)
and i wanted to ask i can choose in what forum the threads going to lock himselfs

Zzed 01-27-2003 06:20 AM

LOL :D

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. :)

spaceb 01-31-2003 02:03 AM

thank you very much :p very usefull hack :)

94DROPTOPZ 02-13-2004 10:13 PM

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:

dpatel304 05-08-2007 05:47 AM

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


All times are GMT. The time now is 04:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01324 seconds
  • Memory Usage 1,815KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete