View Single Post
  #9  
Old 12-23-2015, 01:43 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 128,810
Kyttias is on a distinguished road
Default

Well, no... the id the file is looking for is the message id of an message being sent as a reply, not a user id.

By default the url is:
.../messages/newpm
And originally the reply button linked to a page with a url like this:
.../messages/newpm/Kyttias
(A new message is created going to Kyttias, but no information about the old message itself is being sent.)

Now, we have it sending the message id number instead so we can extract the message title and text:
.../messages/newpm/25
(A reply is sent to the sender of message id #25. The message and title of message id #25 are being used to pre-fill reply information.)

The profile link still wants to create a new pm to a particular user, so it still tries to sends you here:
.../messages/newpm/Kyttias
(But this won't work with the modifications we've made, even though it's how it worked previously. If there's a 'get' value (the last end of the url) at all, it's now automatically assuming it's the message id #. The file is trying to figure out what to do with a message id #Kyttias. It's looking for a message id #, not a username, and definitely not a user id. It screams and cries and throws and error.)

I'm hoping for a way to detect whether the value is numerical only (it's definitely receiving a message id #, so go through with the new modifications) or not (it's receiving a username instead, so set the message up how it was before the mod). But everything I've tried so far has come up not working.
.
.
.

Or, and this could get messy fast, with the reply button url we could add the substring "reply_" before the message id, and on the user profile we could add the substring "user_". We could preg_match to check which substring is prefixed to the get value, and decide what to do based on if that substring exists... but then we also have to then remove that substring we attached before we can continue on. So... messy, but doable. There's got to be a better way, right?
__________________
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 10:22 AM.
Reply With Quote