PM Report Button

Forum
Last Post
Threads / Messages

Kyttias

Super Moderator
Super Mod
Joined
Jan 26, 2014
Messages
849
Points
18
Mysidian Dollar
58,199
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:
    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:
	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(" "," ",$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:
"HEY PLZ"
*puppy eyes* I'm poor, halp? Ur rich so u have $$$ to spare!!!
 
Last edited:
I see, good question. Well the report button was an afterthought, or more precisely, it was never designed to be a part of core script in the first place. years ago a user called Bloodrun designed a PM box mod with the layout, it looked nice and I took the idea to the core script. This is the page of the original PMBox mod, and as you can see the attachments dont exist anymore, since all attachments were lost as the forum was upgraded from MyBB to VBulletin.
http://mysidiaadoptables.com/forum/showthread.php?t=837

Since his mod's has lost all attachments, I had to simply re-create the PMBox based on the idea from his thread from a screenshot(which you should be able to see from the url above). The PM reporting feature was not in the core script yet, and and I didnt bother making it. At that time, it simply led to a non-existent link that shows 404 not found error page, it caused a lot of confusion back then.

Some time later, I decided to add this basic feature, just so that the button would work. However, it was of the least priority and I didnt want to spend much time on it, so it was done the way it currently is now. I guess this answers your question why the PM reporting feature works strangely, although it does work.

I like your idea for its improvement though, it looks really nice. Maybe I will take your idea for Mys v1.4.0's PM reporting system.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,297
Messages
33,199
Members
1,610
Latest member
qwerty
BETA

Latest Threads

Top