View Single Post
  #26  
Old 28th February 2011, 17:00
gabkoko's Avatar
gabkoko gabkoko is offline
Senior Member
 
Join Date: Aug 2010
P2P
Posts: 33
Default System notice - delete a message board content
Hi,

required for the following file: ../shoutbox/sendshout.php

Find it:
PHP Code:
function execcommand_prune ($Data)
  {
    
$Data trim ($Data[0][1]);
    if (empty (
$Data))
    {
      (
mysql_query ('delete from shoutbox') OR sqlerr (__FILE__284));
      
execcommand_message ();
    } 
    else
    {
      
$query mysql_query ('SELECT id FROM users WHERE username = ' sqlesc ($Data));
      if (
mysql_num_rows ($query))
      {
        
$Userid mysql_result ($query0'id');
        (
mysql_query ('delete from shoutbox where userid = ' sqlesc ($Userid)) OR sqlerr (__FILE__293));
        
execcommand_message ();
      }
    }

    return 
true;
  }

  function 
execcommand_message ($message '<div style="background: #FFECCE; border: 1px solid #EA5F00; padding-left: 5px;"><font color=black>Parancs végrehajtva. (Következő frissítéskor már látszik!)</font></div>'$forcemessage false)
  {
    if ((
mysql_affected_rows () OR $forcemessage))
    {
      echo 
$message;
    }

  } 
and change to:

PHP Code:
function execcommand_prune ($Data)
  {
    global 
$CURUSER;
    
$Data trim ($Data[0][1]);
    if (empty (
$Data))
    {   
      (
mysql_query ('delete from shoutbox') OR sqlerr (__FILE__284));
        
$userid $CURUSER['id'];
        
$uzifaluritbOT "{systemnotice} The content is deleted!  User: - ".$CURUSER['username']." -";
        
$uzifalurit_sql "INSERT INTO shoutbox (userid, namestyle, date, content)
        VALUES ("
.sqlesc('999999999').", ".sqlesc('{username}').", '".TIMENOW."', ".sqlesc($uzifaluritbOT).")" or sqlerr(__FILE____LINE__);
        
mysql_query($uzifalurit_sql) or sqlerr(__FILE____LINE__);

        
write_log ("The content is deleted!");
    } 
    else
    {
      
$query mysql_query ('SELECT id FROM users WHERE username = ' sqlesc ($Data));
      if (
mysql_num_rows ($query))
      {
        
$Userid mysql_result ($query0'id');
        (
mysql_query ('delete from shoutbox where userid = ' sqlesc ($Userid)) OR sqlerr (__FILE__293));

      }
    }

    return 
true;
  } 
Click the image to open in full size.
Reply With Quote
The Following 2 Users Say Thank You to gabkoko For This Useful Post:
Marco (28th February 2011), PAX (3rd August 2011)