Minimum Post in Forum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Minimum Post in Forum

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

    #2
    on genproc.php

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

    Comment


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

      Comment


        #4
        that would be 10 letters,

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

        would produce what you want

        Comment


          #5
          Originally posted by sharil View Post
          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
          PHP Code:
          $output="i am NOoob....";
          $newfile="ewanz.txt";
          $file fopen ($newfile"w");
          fwrite($file$output);
          fclose ($file); 

          Comment


            #6
            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&amp;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&amp;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&amp;sid=$sid&amp;tid=$tid&amp;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&amp;sid=$sid&amp;fid=$fid\">$fname</a><br/>";
                  echo 
            "<a href=\"index.php?action=main&amp;sid=$sid\">© $sitename</a>";    
                  echo 
            "</p>";
                  echo 
            "</body>";
              

            Comment


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


              Comment


                #8
                anyone can help me?

                Comment


                  #9
                  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&amp;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&amp;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&amp;sid=$sid&amp;tid=$tid&amp;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&amp;sid=$sid&amp;fid=$fid\">$fname</a><br/>";
                        echo 
                  "<a href=\"index.php?action=main&amp;sid=$sid\">© $sitename</a>";    
                        echo 
                  "</p>";
                        echo 
                  "</body>";
                    

                  Comment


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

                    Comment


                      #11
                      this is 4 u sharil... support malaysian coder,, hehe
                      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&amp;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&amp;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&amp;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&amp;sid=$sid&amp;tid=$tid&amp;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&amp;sid=$sid&amp;fid=$fid\">$fname</a><br/>";
                            echo 
                      "<a href=\"index.php?action=main&amp;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


                        #12
                        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


                          #13
                          Originally posted by sharil View Post
                          Mr_something else, not working.. error.. i need to define function first or what?
                          Sorry This wasnt ment to be on there:
                          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

                          it was from a previous topic lol

                          Comment

                          Working...
                          X