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-23-2015, 10:50 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 129,034
Kyttias is on a distinguished road
Default

Got it: It wasn't checking if it was a numeric value or not until I applied trim() to it to remove whitespace/linebreaks. I had no idea there were even there until I decided to echo the value to see what was going on.

Inside view/messagesview.php, my newpm() function now looks like this:
PHP Code:
$message = new PrivateMessage
// CHANGES START HERE

$title "(no subject)"// this way it'll never be blank
if($mysidia->input->get("id")){ // if there's an get value
    
$where trim($mysidia->input->get("id")); // trim the value
     
if (!ctype_digit($where)) { // if its not numeric only
        
$user $where// create a message to this user
    
} else if (ctype_digit($where)){ // if it IS numeric only then it's a reply, so pull data        
        
$oldMessage = new PrivateMessage($where); 
        
$js "<script>$('.content h2').text('Reply To Message');</script>"// optional
        
$user $oldMessage->fromuser;            
        
$title "RE: ".$oldMessage->messagetitle;    
        
$msg "› {$user} wrote: ".$oldMessage->messagetext;
    }
}

// CHANGES END HERE
$editor $message->getEditor(); 
Added in some optional javascript in the $js variable that should work if you have jQuery included. It'll change the title of the page to indicate it's a reply page, rather than continue to say its a new message page (assuming you're still using the h2 size for page titles, else change it).

Let me clarify that you should leave the url that sends a PM to a user alone in classes/class_userprofile.php. Keep it as it was - sending a username. Do NOT change it to send a user id.
__________________
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 11:06 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:08 AM.

Currently Active Users: 3314 (0 members and 3314 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636