• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Add-on PM viewer?

DarkGizmo

Active member
#1
Is there a PM viewer/reader for admins out there? This would be very helpful to me on my forum since I get a few spam PMs to my members from time to time...
 

Chris D

XenForo developer
Staff member
#8
You should post a request in the add-on's thread. If the developer is still active then he might consider implementing it for you.
 

Sumo

Active member
#9
I've actually modified it to search however you have to edit the php file each time. I hope the author doesn't mind me posting this.

In /library/tikibey/model/ReadPc.php

On line 96 replace the getConversations function with this replacing "xxx" with the users member id. (This can be found in the url of their profile).

Code:
public function getConversations(array $conditions = array(), array $fetchOptions = array())
{
$joinOptions = $this->prepareConversationFetchOptions($fetchOptions);
$whereClause = $this->prepareConversationConditions($conditions, $fetchOptions);
 
$limitOptions = $this->prepareLimitFetchOptions($fetchOptions);
 
return $this->fetchAllKeyed($this->limitQueryResults(
'
SELECT conversation_master.*,
conversation_user.*,
conversation_starter.*,
conversation_recipient.recipient_state, conversation_recipient.last_read_date
' . $joinOptions['selectFields'] . '
FROM xf_conversation_user AS conversation_user
INNER JOIN xf_conversation_master AS conversation_master ON
(conversation_user.conversation_id = conversation_master.conversation_id)
INNER JOIN xf_conversation_recipient AS conversation_recipient ON
(conversation_user.conversation_id = conversation_recipient.conversation_id
AND conversation_user.owner_user_id = conversation_recipient.user_id)
LEFT JOIN xf_user AS conversation_starter ON
(conversation_starter.user_id = conversation_master.user_id)
' . $joinOptions['joinTables'] . '
WHERE conversation_user.owner_user_id = xxx
ORDER BY conversation_user.last_message_date DESC
', $limitOptions['limit'], $limitOptions['offset']
), 'conversation_id');
}