Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #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: 88,446
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
  #2  
Old 12-20-2015, 08:47 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,143
Hall of Famer is on a distinguished road
Default

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.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:34 PM.

Currently Active Users: 9835 (0 members and 9835 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636