Version: 1.00, by Zzed
Developer Last Online: Feb 2012
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));
// check for subject and message
if (trim($subject)=="" or trim($message)=="") {
eval("standarderror(\"".gettemplate("error_nosubject")."\");");
exit;
}
$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;