📄 banned_words.php
字号:
<?
include "logincheck.php";
include "myconnect.php";
///////////////////////////////////////////////////////////////////////////////
/// THE CODE OF THIS SCRIPT HAS BEEN DEVELOPED BY SOFTBIZ SOLUTIONS /////
/// AND IS MEANT TO BE USED ON THIS SITE ONLY AND IS NOT FOR REUSE, /////
/// RESALE OR REDISTRIBUTION. /////
/// IF YOU NOTICE ANY VIOLATION OF ABOVE PLEASE REPORT AT: /////
/// admin@softbizscripts.com /////
/// http://www.softbizscripts.com /////
/// http://www.softbizsolutions.com /////
///////////////////////////////////////////////////////////////////////////////
/////////add new code
if(count($_POST)>0)
{
$errcnt=0;
if(strlen(trim($_POST["word"]))==0)
{
$errcnt++;
}
else
{
if (!get_magic_quotes_gpc()) {
$word=str_replace('$', '\$',addslashes($_REQUEST["word"]));
}
else
{
$word=str_replace('$', '\$',$_REQUEST["word"]);
}
$rst=mysql_fetch_array(mysql_query("select * from sbbleads_banned_words where sb_word='$word'"));
if($rst)
{
$errcnt++;
}
}
if($errcnt==0)
{
if (!get_magic_quotes_gpc()) {
$word=str_replace('$', '\$',addslashes($_REQUEST["word"]));
}
else
{
$word=str_replace('$', '\$',$_REQUEST["word"]);
}
mysql_query("insert into sbbleads_banned_words (sb_word,sb_type) values ('$word',".$_POST["type"].")");
if(mysql_affected_rows()>0)
{
header("Location: "."banned_words.php?msg=".urlencode("Word has been added to the list"));
die();
}
else
{
header("Location: "."banned_words.php?msg=".urlencode("Some error occurred. Please try again."));
die();
}
}
}
/////////////////////
function main()
{
$word="";
$errcnt=0;
$errmsg="";
//////////////////////////////////
////////////////////////////////
?>
<script language="JavaScript1.1">
function Validator()
{
if ( frm1.word.value=='' )
{
alert("Please specify word");
document.frm1.word.focus();
return (false);
}
return (true);
}
</script>
<?
if(count($_POST)>0)
{
$word=$_POST["word"];
if(strlen(trim($_POST["word"]))==0)
{
$errmsg[$errcnt]="Please specify word";
$errcnt++;
}
else
{
if (!get_magic_quotes_gpc()) {
$word1=str_replace('$', '\$',addslashes($_REQUEST["word"]));
}
else
{
$word1=str_replace('$', '\$',$_REQUEST["word"]);
}
$rst=mysql_fetch_array(mysql_query("select * from sbbleads_banned_words where sb_word='$word1'"));
if($rst)
{
$errmsg[$errcnt]="Word already exists in the list.";
$errcnt++;
}
}
if($errcnt<>0)
{
?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="errorstyle">
<tr>
<td colspan="2"><strong> Your request cannot be processed due to following
reasons</strong></td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<?
for ($i=0;$i<$errcnt;$i++)
{
?>
<tr valign="top">
<td width="6%"> <?php echo $i+1;?></td>
<td width="94%"><?php echo $errmsg[$i]; ?></td>
</tr>
<?
}
?>
</table>
<?
}
}
?>
<table width="90%" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top"> <div align="center">
<table width="100%" border="0" cellspacing="10" cellpadding="2">
<form action="banned_words.php" method="post" name="frm1" id="frm1" onSubmit="return Validator();" >
<tr align="left" class="row1">
<td height="25" colspan="3" bgcolor="#004080"><font size="3" face="Arial, Helvetica, sans-serif"><font color="#FFFFFF" size="2"><strong> Add
Word</strong></font></font></td>
</tr>
<tr class="row1">
<td width="40%" align="right" bgcolor="#F5F5F5"> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Word:</strong></font></div></td>
<TD align=left valign="top" class="onepxtable"><font color=red
size=2 face="Arial, Helvetica, sans-serif">*</font></TD>
<td width="60%"> <input name="word" type="text" class="box" id="word" value="<? echo $word;?>">
</td>
</tr>
<tr valign="top" class="row1">
<td align="right" bgcolor="#F5F5F5"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2" face="Arial, Helvetica, sans-serif">Match
by:</font></strong></font></td>
<TD align=left class="onepxtable"><font color=red
size=2 face="Arial, Helvetica, sans-serif">*</font></TD>
<td> <input name="type" type="radio" value="1" checked> <font size="2" face="Arial, Helvetica, sans-serif">
Exact Word Matching<br>
<input type="radio" name="type" value="2">
Containning Specified Word</font></td>
</tr>
<tr class="row1">
<td width="40%" align="right" bgcolor="#F5F5F5"><font size="2" face="Arial, Helvetica, sans-serif"> </font></td>
<td width="6"> </td>
<td width="60%"> <input name="Submit" type="submit" class="submit" value="Add New"></td>
</tr>
</form>
</table>
</div></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"><table width="100%" border="0" cellspacing="10" cellpadding="2">
<tr>
<td height="25" colspan="3" bgcolor="#004080"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong> Banned
Words </strong></font></td>
</tr>
<tr valign="top">
<td height="25" colspan="3"><font size="1" face="Arial, Helvetica, sans-serif">All
the Postings will be checked for these words. If any posting contain
any of these words then that posting will be blocked. If any user
message contains these words then message will be posted after replacing
bad word with a series of *. </font></td>
</tr>
<?
$loc_query=mysql_query("select * from sbbleads_banned_words order by sb_word");
while($loc=mysql_fetch_array($loc_query))
{
?>
<tr>
<td width="50%" valign="top"><font size="2" face="Arial, Helvetica, sans-serif"> <? echo $loc["sb_word"];?></font></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">
<?
if($loc["sb_type"]==1)
{ echo "Banned Exact Matching";}
else
{ echo "Banned Partial Matching";}?>
</font></td>
<td valign="top"><a href="delete_banned_word.php?id=<? echo $loc["sb_id"];?>" onClick="javascript: return confirm('Do you really want to remove the word from banned list?');"><font size="2" face="Arial, Helvetica, sans-serif">Delete</font></a></td>
</tr>
<?
}
?>
</table></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif"><strong> </strong></font></div></td>
</tr>
</table>
<br>
<?
}//end main
include "template.php";
///////////////////////////////////////////////////////////////////////////////
/// THE CODE OF THIS SCRIPT HAS BEEN DEVELOPED BY SOFTBIZ SOLUTIONS /////
/// AND IS MEANT TO BE USED ON THIS SITE ONLY AND IS NOT FOR REUSE, /////
/// RESALE OR REDISTRIBUTION. /////
/// IF YOU NOTICE ANY VIOLATION OF ABOVE PLEASE REPORT AT: /////
/// admin@softbizscripts.com /////
/// http://www.softbizscripts.com /////
/// http://www.softbizsolutions.com /////
///////////////////////////////////////////////////////////////////////////////
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -