Edit RecipientID for simple messenger?

I'm trying to find a way to edit the messenger.  I would like the members first name to appear instead of the username.  Any suggestions? 

I looked at my database under the simple_messenger and it says RecipientID equals the members ID#.  Can it be changed to say the FirstName?

Quote · 17 Apr 2012

I have not tested this, but should work.

Edit modules\boonex\simple_messenger\classes\BxSimpleMessengerModule.php

At about line 732 look for this.

            if ( $aMessages && is_array($aMessages) ) {
                foreach( $aMessages as $iKey => $aItems )
                {
                    $iKey = (int) $iKey;

                    $iCountMessages++;
                    $iLastMessageId   = $aMessages[$iKey]['ID'];
                   
                    $aTemplateKeys = array(
                        'message'           => $aMessages[$iKey]['Message'],
                        'sender_nickname'   => getNickName($aMessages[$iKey]['SenderID']),
                        'date_add'          => $aMessages[$iKey]['Date'],

                        'owner_nick_extra'  => ($aMessages[$iKey]['SenderID'] == $this -> iLoggedMemberId)
                            ? 'sender'
                            : 'recipient',
                    );

                    $sOutputMessages .=  $this -> _oTemplate
                            -> parseHtmlByName( 'message.html', $aTemplateKeys );
                }
            }



Change to this.

            if ( $aMessages && is_array($aMessages) ) {
                foreach( $aMessages as $iKey => $aItems )
                {
                    $iKey = (int) $iKey;

                    $iCountMessages++;
                    $iLastMessageId   = $aMessages[$iKey]['ID'];

                    $arr = getProfileInfo($aMessages[$iKey]['SenderID']);
                    $sFirstName = $arr['FirstName'];
                   
                    $aTemplateKeys = array(
                        'message'           => $aMessages[$iKey]['Message'],
                        'sender_nickname'   => $sFirstName,
                        'date_add'          => $aMessages[$iKey]['Date'],

                        'owner_nick_extra'  => ($aMessages[$iKey]['SenderID'] == $this -> iLoggedMemberId)
                            ? 'sender'
                            : 'recipient',
                    );

                    $sOutputMessages .=  $this -> _oTemplate
                            -> parseHtmlByName( 'message.html', $aTemplateKeys );
                }
            }






https://www.deanbassett.com
Quote · 17 Apr 2012

Deano...  once again... you are a genious!  It works great, thanks!

Quote · 17 Apr 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.