Support Forum

Content of Private Message Not Displaying

JB jbaldwin
jbaldwin
Member

Good Morning,

I’m having an issue with Private Messaging.  For some reason the content of each message is not displaying.  Several of the members are displaying as Guest and they are not since they have an account.  Not sure what’s going on here.  

Any suggestions would be very appreciated.  

Thanks, Jody 

pm_not_displaying.PNG

18 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Well the most curious thing here is that the three ’empty’ messages are all labelled as being sent by a ‘Guest’. Yet non-registered users should not be able to access PMs. Can you shed any light on that for me – see if I can replicate this…?

JB jbaldwin
jbaldwin
Member

That is what is odd because everyone that responded is a registered member.  I ran the following query to review the data in MySQL:

SELECT m.*, display_name FROM `wp_sfpmmessages` as m JOIN wp_sfmembers as u ON m.user_id = u.user_id WHERE thread_id = 2976

Below are the results (exported in CVS) that I get:

Capture.JPG

I’m at a lose as to why this would happen…

YS Yellow Swordfish
Yellow Swordfish
Member

Most strange.

As you are a SQL man could you try this query below? This is basically what is run to populate a thread.

I have set table prefix to ‘wp_’ and you will need to replace the thread ID (XXXX)  with your thread (which I now see is 2976). Am interested to see if you get the correct members showing up in the results.

SELECT wp_sfpmrecipients.thread_id, wp_sfpmmessages.user_id AS sender, mem1.display_name AS sender_display_name, wp_sfpmrecipients.user_id AS recipient, mem2.display_name AS recipient_display_name, wp_sfpmrecipients.message_id, read_status, pm_type, sent_date, attachment_id, title, message_count, thread_slug, message 
FROM wp_sfpmrecipients 
JOIN wp_sfpmmessages ON wp_sfpmrecipients.message_id = wp_sfpmmessages.message_id 
JOIN wp_sfpmthreads ON wp_sfpmrecipients.thread_id = wp_sfpmthreads.thread_id 
JOIN wp_sfmembers AS mem1 ON wp_sfpmmessages.user_id = mem1.user_id 
JOIN wp_sfmembers AS mem2 ON wp_sfpmrecipients.user_id = mem2.user_id WHERE wp_sfpmrecipients.thread_id = XXXX 
ORDER BY sent_date ASC
JB jbaldwin
jbaldwin
Member

I just run the query and the sender_display_name and recipient_display_name are both populated with the correct names.  If you need me to upload the results just let me know.

MP Mr Papa
Mr Papa
Member

no caching plugins, right?

perhaps you can make a quick edit to the spPMMessagesView.php file (its in sp-resources/forum-plugins/private-messaging/template-files

around line 30, after

            $spPmMessageList = new spPmMessageList($spVars[‘thread’]);

lets go ahead and add

ashow(spPmMessageList);

and see what is reported in a blue box when you load up the thread… that will be what is actually loaded form the db… a starting place for debugging if you will…

JB jbaldwin
jbaldwin
Member

Correct, no caching plugins installed.  I updated spPMMessagesView.php as requested but no additional data was displayed when I opened the thread.  I check in Chrome, Firefox and IE and deleted my browser cache as well.

MP Mr Papa
Mr Papa
Member

are you sure you changed the actual sp theme you are using? not at computer to check my code, but it should output info on the thread… be sure you are viewing the actual pm thread (list of messages) not the inbox (list of threads)…

MP Mr Papa
Mr Papa
Member

and to be sure, the code should be:

ashow($spPmMessageList);

JB jbaldwin
jbaldwin
Member

I must not have been fully awake this morning!  I have updated the code and this is what I get:

Capture-1.JPG
YS Yellow Swordfish
Yellow Swordfish
Member

Did you leave the dollar sign from the front of the array name?

JB jbaldwin
jbaldwin
Member

I did, when I add it the $ the message list will not load.  Here is my code:

Capture-2.JPG

Here is the forum:

Capture-3.JPG
YS Yellow Swordfish
Yellow Swordfish
Member

You have put the dollar sign on the ashow function command when it should be on the spPmMessageList object variable… :)

JB jbaldwin
jbaldwin
Member

Now we’re getting somewhere… (I’m a SQL Server guy just know enough about other stuff to be dangerous!)

MP Mr Papa
Mr Papa
Member

No, not really getting anywhere… :(

that php object you are displaying contains the information that is output in the pm message list…  and it appears to contain all the right info – certainly the display names and content…

so not sure how its getting any other data but what is in that object???

what is the url to your site?