How to make minimum post in forum? let say min post is 10 words, so if the user post in the forum less than 10 words, it will display " Min Post are 10 Words!"
Minimum Post in Forum
Collapse
X
-
Originally posted by sharil View Postcan you tell me where to put the code on genproc.php.. i meant which line?our lfe is simple words....
http://mygenkz.net
ewanz06@yahoo.com
PHP Code:$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
Comment
-
Here the script for posting somewhere in genproc.php
PHP Code:else if($action=="post")
{
$tid = cleanQuery($_POST["tid"]);
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
if(istrashed(getuid_sid($sid)))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot create post!<br/>please try again later...<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$reptxt = cleanQuery($_POST["reptxt"]);
$qut = cleanQuery($_POST["qut"]);
addonline(getuid_sid($sid),"Posted A reply","");
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
if(!isblocked($reptxt,$uid))
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}else{
$bantime = time() + (30*24*60*60);
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
echo "Can't Post Reply<br/><br/>";
echo "You just tried posting a reply with a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
$user = getnick_sid($sid);
mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>Cactus</b> auto banned $user for spamming forums', actdt='".time()."'");
mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
echo "</body>";
echo "</html>";
exit();
}
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+5;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully<br/>";
echo "You Got 5Plusses";
echo "<br/><br/><a href=\"forum.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">View Topic</a>";
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"forum.php?action=viewfrm&sid=$sid&fid=$fid\">$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
echo "</p>";
echo "</body>";
}
Comment
-
PHP Code:function antiflood($text){
$text = str_replace("%20"," ",$text);
$words = explode(" ",$text);
while($word=$words){
if(strlen($word)>20){
return "AntiFlood Protection";
}
}
return $text;
}
if(trim($reptxt)!=""&&strlen($reptxt)>9)
else if($action=="post")
{
$tid = cleanQuery($_POST["tid"]);
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
if(istrashed(getuid_sid($sid)))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot create post!<br/>please try again later...<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$reptxt = cleanQuery($_POST["reptxt"]);
$qut = cleanQuery($_POST["qut"]);
addonline(getuid_sid($sid),"Posted A reply","");
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!=""&&strlen($reptxt)>9)
{
if(!isblocked($reptxt,$uid))
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}else{
$bantime = time() + (30*24*60*60);
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
echo "Can't Post Reply<br/><br/>";
echo "You just tried posting a reply with a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
$user = getnick_sid($sid);
mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>Cactus</b> auto banned $user for spamming forums', actdt='".time()."'");
mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
echo "</body>";
echo "</html>";
exit();
}
}else{
echo "<b>You Have To Use at least 10 words on Post </b><br/>";
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+5;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully<br/>";
echo "You Got 5Plusses";
echo "<br/><br/><a href=\"forum.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">View Topic</a>";
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"forum.php?action=viewfrm&sid=$sid&fid=$fid\">$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
echo "</p>";
echo "</body>";
}
Comment
-
this is 4 u sharil... support malaysian coder,, hehePHP Code:else if($action=="post")
{
$tid = cleanQuery($_POST["tid"]);
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">? $sitename</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
if(istrashed(getuid_sid($sid)))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot create post!<br/>please try again later...<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">$sitename</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$reptxt = cleanQuery($_POST["reptxt"]);
$qut = cleanQuery($_POST["qut"]);
if(strlen($reptxt)<10)
{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Min Post are 10 Words!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">$sitename</a>";
echo "</body>";
echo "</html>";
exit();
}
addonline(getuid_sid($sid),"Posted A reply","");
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
if(!isblocked($reptxt,$uid))
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}else{
$bantime = time() + (30*24*60*60);
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
echo "Can't Post Reply<br/><br/>";
echo "You just tried posting a reply with a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
$user = getnick_sid($sid);
mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>Cactus</b> auto banned $user for spamming forums', actdt='".time()."'");
mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
echo "</body>";
echo "</html>";
exit();
}
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+5;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully<br/>";
echo "You Got 5Plusses";
echo "<br/><br/><a href=\"forum.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">View Topic</a>";
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
}
$fname = getfname($fid);
echo "<br/><br/><a href=\"forum.php?action=viewfrm&sid=$sid&fid=$fid\">$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">? $sitename</a>";
echo "</p>";
echo "</body>";
}
our lfe is simple words....
http://mygenkz.net
ewanz06@yahoo.com
PHP Code:$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
Comment
-
just copy all n enjoy mate.... =)our lfe is simple words....
http://mygenkz.net
ewanz06@yahoo.com
PHP Code:$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
Comment
-
Originally posted by sharil View PostMr_something else, not working.. error.. i need to define function first or what?
PHP Code:function antiflood($text){
$text = str_replace("%20"," ",$text);
$words = explode(" ",$text);
while($word=$words){
if(strlen($word)>20){
return "AntiFlood Protection";
}
}
return $text;
}
Comment
Comment