Peter Porker
02-19-2001, 11:57 AM
I don't know if this exists already, or even if it's included in v2.0, but here it is in any case:
(this wasn't hard to come up with, but still, not bad for a dude who doesn't know php, eh? ;) )
To add banning by ICQ Number, AIM Handle, Yahoo Handle: (only tested in version 1.1.4)
-------------------------------------------------------
################################################## ###########
Files to edit -> member.php
admin/options.php
-> need to add 3 new templates (VERY SIMPLE!)
################################################## ###########
######## IN "member.php" FIND: (should be around line 153)
(FOUND UNDER THIS HEADING: // ############################### start add member ###############################)
if (strstr(" ".$banemail." "," ".$email." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banemail")."\");");
exit;
}
if ($emaildomain=substr(strstr($email,"@"),1)) {
if (strstr(" ".$banemail." "," ".$emaildomain." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_bademail")."\");");
exit;
}
}
------- DIRECTLY UNDER THAT, ADD:
if (strstr(" ".$banicq." "," ".$icq." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banicq")."\");");
exit;
}
if (strstr(" ".$banaim." "," ".$aim." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banaim")."\");");
exit;
}
if (strstr(" ".$banyahoo." "," ".$yahoo." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banyahoo")."\");");
exit;
}
------- THAT BLOCK OF CODE SHOULD NOW LOOK LIKE THIS:
if (strstr(" ".$banemail." "," ".$email." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banemail")."\");");
exit;
}
if ($emaildomain=substr(strstr($email,"@"),1)) {
if (strstr(" ".$banemail." "," ".$emaildomain." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_bademail")."\");");
exit;
}
}
if (strstr(" ".$banicq." "," ".$icq." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banicq")."\");");
exit;
}
if (strstr(" ".$banaim." "," ".$aim." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banaim")."\");");
exit;
}
if (strstr(" ".$banyahoo." "," ".$yahoo." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banyahoo")."\");");
exit;
}
}
####################################
####### IN "admin/options.php" FIND: (should be around line 537)
<td><p><b>banemail</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banemail]\" value=\"".htmlspecialchars($banemail)."\"></p></td>
</tr>
<tr><td colspan=2><p>Email Ban Lists: You may ban certain email addresses from registering on your forums. To ban a specific email, type the full email address (as in, waldo@whereiswaldo.com). To ban all email addresses from certain domains, such as hotmail, simply type the domain name (as in hotmail.com)- that will prevent anyone using a hotmail address from registering. Put a space between each banned email.<br></p></td></tr>
<tr><td colspan=2><p><hr></p></td></tr>
------ ABOVE THE LAST LINE ( <tr><td colspan=2><p><hr></p></td></tr> ), ADD:
<tr>
<td><p><b>banicq</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banicq]\" value=\"".htmlspecialchars($banicq)."\"></p></td>
</tr>
<tr><td colspan=2><p>ICQ Ban Lists: You may ban certain ICQ numbers from registering on your forums. To ban a specific ICQ number, type the full number. Put a space between each banned ICQ number.<br></p></td></tr>
<tr>
<td><p><b>banaim</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banaim]\" value=\"".htmlspecialchars($banaim)."\"></p></td>
</tr>
<tr><td colspan=2><p>AIM Ban Lists: You may ban certain AIM Handles from registering on your forums. To ban a specific AIM Handle, type the full handle. Put a space between each banned AIM Handle.<br></p></td></tr>
<tr>
<td><p><b>banyahoo</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banyahoo]\" value=\"".htmlspecialchars($banyahoo)."\"></p></td>
</tr>
<tr><td colspan=2><p>Yahoo Ban Lists: You may ban certain Yahoo Handles from registering on your forums. To ban a specific Yahoo Handle, type the full handle. Put a space between each banned Yahoo Handle.<br></p></td></tr>
####################################
####### NOW CREATE 3 NEW TEMPLATES (Control Panel --- Templates/Add)
------- Title them "error_banicq", "error_banaim", "error_banyahoo".
------- In the main body of each new template, add this:
Sorry. The administrator has banned you. To contact the administrator click <a href="mailto:$webmasteremail">here</a>
################################################## ################################
NOTE: You may also want to edit your "error_banemail" and "error_banip" templates
to display the same message as the new one above...why tell them HOW they've
been banned? Let them guess!!! :)
That's it, you're done!
You can now ban new registrations based on ICQ number, AIM Handle, and Yahoo Handle!
(this wasn't hard to come up with, but still, not bad for a dude who doesn't know php, eh? ;) )
To add banning by ICQ Number, AIM Handle, Yahoo Handle: (only tested in version 1.1.4)
-------------------------------------------------------
################################################## ###########
Files to edit -> member.php
admin/options.php
-> need to add 3 new templates (VERY SIMPLE!)
################################################## ###########
######## IN "member.php" FIND: (should be around line 153)
(FOUND UNDER THIS HEADING: // ############################### start add member ###############################)
if (strstr(" ".$banemail." "," ".$email." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banemail")."\");");
exit;
}
if ($emaildomain=substr(strstr($email,"@"),1)) {
if (strstr(" ".$banemail." "," ".$emaildomain." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_bademail")."\");");
exit;
}
}
------- DIRECTLY UNDER THAT, ADD:
if (strstr(" ".$banicq." "," ".$icq." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banicq")."\");");
exit;
}
if (strstr(" ".$banaim." "," ".$aim." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banaim")."\");");
exit;
}
if (strstr(" ".$banyahoo." "," ".$yahoo." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banyahoo")."\");");
exit;
}
------- THAT BLOCK OF CODE SHOULD NOW LOOK LIKE THIS:
if (strstr(" ".$banemail." "," ".$email." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banemail")."\");");
exit;
}
if ($emaildomain=substr(strstr($email,"@"),1)) {
if (strstr(" ".$banemail." "," ".$emaildomain." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_bademail")."\");");
exit;
}
}
if (strstr(" ".$banicq." "," ".$icq." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banicq")."\");");
exit;
}
if (strstr(" ".$banaim." "," ".$aim." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banaim")."\");");
exit;
}
if (strstr(" ".$banyahoo." "," ".$yahoo." ")!="") {
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banyahoo")."\");");
exit;
}
}
####################################
####### IN "admin/options.php" FIND: (should be around line 537)
<td><p><b>banemail</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banemail]\" value=\"".htmlspecialchars($banemail)."\"></p></td>
</tr>
<tr><td colspan=2><p>Email Ban Lists: You may ban certain email addresses from registering on your forums. To ban a specific email, type the full email address (as in, waldo@whereiswaldo.com). To ban all email addresses from certain domains, such as hotmail, simply type the domain name (as in hotmail.com)- that will prevent anyone using a hotmail address from registering. Put a space between each banned email.<br></p></td></tr>
<tr><td colspan=2><p><hr></p></td></tr>
------ ABOVE THE LAST LINE ( <tr><td colspan=2><p><hr></p></td></tr> ), ADD:
<tr>
<td><p><b>banicq</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banicq]\" value=\"".htmlspecialchars($banicq)."\"></p></td>
</tr>
<tr><td colspan=2><p>ICQ Ban Lists: You may ban certain ICQ numbers from registering on your forums. To ban a specific ICQ number, type the full number. Put a space between each banned ICQ number.<br></p></td></tr>
<tr>
<td><p><b>banaim</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banaim]\" value=\"".htmlspecialchars($banaim)."\"></p></td>
</tr>
<tr><td colspan=2><p>AIM Ban Lists: You may ban certain AIM Handles from registering on your forums. To ban a specific AIM Handle, type the full handle. Put a space between each banned AIM Handle.<br></p></td></tr>
<tr>
<td><p><b>banyahoo</b></p></td>
<td><p><input type=\"text\" size=\"35\" name=\"newoption[banyahoo]\" value=\"".htmlspecialchars($banyahoo)."\"></p></td>
</tr>
<tr><td colspan=2><p>Yahoo Ban Lists: You may ban certain Yahoo Handles from registering on your forums. To ban a specific Yahoo Handle, type the full handle. Put a space between each banned Yahoo Handle.<br></p></td></tr>
####################################
####### NOW CREATE 3 NEW TEMPLATES (Control Panel --- Templates/Add)
------- Title them "error_banicq", "error_banaim", "error_banyahoo".
------- In the main body of each new template, add this:
Sorry. The administrator has banned you. To contact the administrator click <a href="mailto:$webmasteremail">here</a>
################################################## ################################
NOTE: You may also want to edit your "error_banemail" and "error_banip" templates
to display the same message as the new one above...why tell them HOW they've
been banned? Let them guess!!! :)
That's it, you're done!
You can now ban new registrations based on ICQ number, AIM Handle, and Yahoo Handle!