Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 06:45 am EST

Geeklog Forums

Suggestion Blcok - spam related to anonymous users


Status: offline

jordydme

Forum User
Full Member
Registered: 11/03/05
Posts: 135
Hi,

I would like to set up this block so that only registered users can use the suggestion block. I am now getting a ton of spam and it's driving me crazy. I wonder if I can set it up so that no urls would be allowed. That would probably take care of it as the submitted messages usually contain urls. Here is the code for the suggestion block.

Suggest.php code:
Text Formatted Code
<?php
   include('lib-common.php');
   global $_CONF;  
   $email="anonymous@anonymous.com";
   $adminemail = $_CONF['site_mail'];
   // Suggestion Box phpBlock created by Mr.GxBlock of http://www.gxblock.com Please don't remove this message.    
   echo COM_siteHeader();
   if($suggest != ''){
     if(strlen($suggest) < 10){
          echo COM_startBlock('Error');
          printf("Please go back and enter insert at unique message with at least 10 characters.");
          echo COM_endBlock();
          echo COM_siteFooter(true);
          exit();
          }
         if($suggest == '$textareamessage'){
          echo COM_startBlock('Error');
          printf("Please go back and enter insert a unique message with at least 10 characters.");
          echo COM_endBlock();
          echo COM_siteFooter(true);
          exit();
          }
          $suggest = str_replace(array("&gt;", "&lt;","&quot;", "&amp;"), array(">","<", "\"", "&"), $suggest);
          $suggest = stripslashes($suggest);
          $suggest = COM_checkWords($suggest);
      mail
      (
      "$adminemail",
      "From Your Suggestion Box - A New Request",
      "Name : $username from $REMOTE_ADDR
       Email : $useremail
       Note:
       $suggest
       ",
       "From: $useremail\n"
      );
         echo COM_refresh($HTTP_REFERER);
         echo COM_startBlock('Your suggestion has been proccessed');
         printf("Thank you $username, you are now being transferring back to previous page. You may also <A HREF=\"$HTTP_REFERER\">click here</A>.");
         echo COM_endBlock();
         echo COM_siteFooter(true);
         exit();
   }else{
         echo COM_startBlock('Error');
         printf("Please try again.");
         echo COM_endBlock();
         echo COM_siteFooter();
         exit();
   }
 ?>


Function PHP block code:

Text Formatted Code
function phpblock_suggest(){
   global $_TABLES, $_CONF, $_USER;
   $message="what would you like to see here?";
   $siteurl = $_CONF['site_url'];  
   $display .="<CENTER>";
   if($_USER['username'] != ''){
   $display .="<B>$_USER[username], $message<B><BR>";
   }elseif($_USER['username'] == ''){
   $username = 'Guest';
   $useremail = 'anonymous@anonymous.com';
   $display .="<B>Hello Guest, $message<B><BR>";
   }
   if($_USER['username'] != ''){
        $result = DB_query("SELECT * FROM {$_TABLES['users']} WHERE username = '{$_USER['username']}'");
        $U = DB_fetchArray($result);
                $username = "$U[username]";
                $useremail = "$U[email]";
                if($useremail == ''){
                  $useremail = 'anonymous@anonymous.com';
                }
    }
   $display .="<FORM ACTION=\"$siteurl/suggest.php\" METHOD=\"POST\">";
   $display .="<TEXTAREA ROWS=\"3\" COLS=\"15\" NAME=\"suggest\"></TEXTAREA><BR>";
   $display .= "<INPUT TYPE=\"hidden\" NAME=\"username\" VALUE=\"$username\">";
   $display .= "<INPUT TYPE=\"hidden\" NAME=\"useremail\" VALUE=\"$useremail\">";
   $display .= "<INPUT TYPE=\"submit\" NAME=\"\" VALUE=\"Send!\">";
   $display .= "</FORM>";
   $display .="</CENTER>";
   return $display;
}
 Quote

All times are EST. The time is now 06:45 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content