View Single Post
  #1  
Old 12-20-2015, 05:00 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 127,238
Kyttias is on a distinguished road
Default PM Report Button

What does it actually do?

From what I can tell all its doing is sending a copy of the reported message to the admin. It doesn't say who sent the spam to the person reporting it and appears in the admin's inbox as being sent from the person who reported it. And though asked to supply a reason for the report, that information is also not included in the report I get in my inbox.

So basically it just looks like the person trying to report spam is spamming the the the admin. Or worse, if they're reporting harassment or begging, then it looks like the victim is doing that to the admin! What on earth?

I'm working on a rewrite of this, presently... but was this feature just up and forgotten about halfway through development?

.

Alright, I'm back with some edits I've made to get this system working nicely.

Replace the report() function inside classes/class_privatemessage.php:
PHP Code:
    public function report(){
        
$mysidia Registry::get("mysidia");
        
$date = new DateTime;     
        
$this->messagetitle "<b>⚠️</b> ".$mysidia->input->post("reason");
        
$this->messagetext "<b>Offender:</b> ".$mysidia->input->post("mfrom")."<br><b>Reason For Report:</b> ".$mysidia->input->post("reason")."<br><b>Message Being Reported:</b><br><blockquote><b><i>\"".$mysidia->input->post("mtitle")."\"</i></b><br>".$this->messagetext."</blockquote>";
        
$mysidia->db->insert("messages", array("id" => NULL"fromuser" => $mysidia->user->username"touser" => $mysidia->input->post("recipient"), "status" => "unread""datesent" => $date->format("M d, Y \a\t h:i A"), "messagetitle" => $this->messagetitle"messagetext" => $this->messagetext));     
        return 
TRUE;     
    } 
And the report() function of view/messagesview.php, I modified a bit (and added a formatter function to strip apostrophes out of the messages so it doesn't gum up the page rendering and the form):
PHP Code:
    public function report(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;        
        if(
$mysidia->input->post("submit")){        
            
$document->setTitle($this->lang->reported_title);
            
$document->addLangvar($this->lang->reported);
            return;
        }                
        
$message $this->getField("message");
        
$admin $this->getField("admin");
        
        
$reportForm = new Form("reportform""""post");
        
$reportForm->add(new Comment("<b>Report To:</b> "FALSE));
        
$reportForm->add(new TextField("recipient"$admin->username)); 
        
$reportForm->add(new Comment("<b>Reason:</b> "FALSE));
        
$reportForm->add(new TextField("reason""Spam"50));
        
$reportForm->add(new PasswordField("hidden""mfrom"$message->fromuser));  
        
$reportForm->add(new PasswordField("hidden""mtitle"$this->format($message->messagetitle)));
        
$reportForm->add(new PasswordField("hidden""mtext"$this->format($message->messagetext)));
        
$reportForm->add(new Button("Report""submit""submit"));    
        
        
$document->setTitle($this->lang->report_title);
        
$document->addLangvar($this->lang->report);
        
$document->add($reportForm); 
    }

    public function 
format($text){
        
$text html_entity_decode($text);
        
$text stripslashes($text);
        
$text str_replace("&nbsp;"," ",$text);
        
$text str_replace("'","'",$text);
        return 
$text;
    } 
Basically all I did was add who sent the message to the data being sent, and included both that and the reason in the report that's messaged to the admin. The PM the admin gets will be formatted something like this:
Offender: SomePerson12
Reason For Report: Begging
Message Being Reported:
Quote:
"HEY PLZ"
*puppy eyes* I'm poor, halp? Ur rich so u have $$$ to spare!!!
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 12-23-2015 at 12:13 AM.
Reply With Quote