Minimum Post in Forum

Started on the old forum in April 2010 · view the original in the archive · old links redirect here

12 replies · 982 views · started 16 years ago · 1 min read

6 participants
sharil Junior · 44 posts #1

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!" 😕

-PeaCe-

sklbd Junior · 47 posts #2

on genproc.php

if((strlen($reptxt)<10)){ echo "U Have 2 Use at lest 10 worls on Post "; }else{

ShaK!L AhammeD

Sklifbd.CoM +88-01730039272

sharil Junior · 44 posts #3

can you tell me where to put the code on genproc.php.. i meant which line?

-PeaCe-

djlee Developer · 224 posts #4

that would be 10 letters,

if( (int)str_word_count($reptxt) < 10 )

would produce what you want

ewanz Developer · 187 posts #5

sharil wrote: can you tell me where to put the code on genproc.php.. i meant which line?

show your script.. i will share it

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
sharil Junior · 44 posts #6

Here the script for posting somewhere in genproc.php

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>";
  
}

-PeaCe-

bluangelo Junior · 19 posts #7

Fatal error: Call to undefined function cleanquery() in /home/a1823097/public_html/web/genproc.php on line 192

8)8)😳

sharil Junior · 44 posts #8

anyone can help me?

-PeaCe-

something else Fellow · 2,296 posts #9
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>";
  
} 
sharil Junior · 44 posts #10

Mr_something else, not working.. error.. i need to define function first or what?

-PeaCe-

ewanz Developer · 187 posts #11

this is 4 u sharil... support malaysian coder,, hehe

    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

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
ewanz Developer · 187 posts #12

just copy all n enjoy mate.... =)

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
something else Fellow · 2,296 posts #13

sharil wrote: Mr_something else, not working.. error.. i need to define function first or what?

Sorry This wasnt ment to be on there:

function antiflood($text){ 
$text = str_replace("%20"," ",$text); 
$words = explode(" ",$text); 
while($word=$words){ 
if(strlen($word)>20){ 
return "AntiFlood Protection"; 
} 
} 
return $text; 
}

it was from a previous topic lol

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close