9 years, 1 month ago Gaz Lloyd BSc HonsParticipant
Whilst using the userpro message add-on I noticed that when you open the new message dialogue to message a user there was a few issues.
1) Contained within the users display badges there was a message icon which when clicked would open the same dialogue.
2) The view profile button was too close too the username.
3) The text for the username was a little bland and non descriptive and needed some improving.
Well if you are in the same situation I have compiled this little tutorial to help out as this worked for myself.
First you need to login to either cpanel file manager or your FTP client you use to access you main installation and plugin files.
Once you have done this navigate to
wp-content/plugins/userpro-messaging/templates/new-message.phpand open this file.
I shall break down each of the following solutions into mini tutorials in the same numbered order as above according to each issue to make it simpler for you.
1) Removal of the user badges
This can be done by navigating to line number 12 (in my instance) and removing the following code completely:
<?php echo userpro_show_badges($chat_with, $inline=true); ?>That’s it the badges should now be removed. This will stop the message icon appearing and causing confusion whilst improving the general looks of the dialogue.
2) Username and view profile button to close together
Where the view the profile button is too close too the username you simply need to add
<?php echo userpro_profile_data('display_name', $chat_with); ?>on line 12 (in my case). That’s it for part two all done and very simple to do.
3) Enhance the username text area
If you would like to enhance the textual appearance of the username this is also pretty simple. In my instance I wanted it to instead of displaying the username have
Your messaging [Your Username]where
[Your Username]is the name of the user that would be displayed as usual.
This can be achieved by navigating to line 12 (again was line 12 for myself) and replacing the following lines code
<a href="<?php echo $userpro->permalink($chat_with); ?>"><?php echo userpro_profile_data('display_name', $chat_with); ?></a><?php echo userpro_show_badges($chat_with, $inline=true); ?>with
<?php _e('Your '); ?><?php _e('messaging '); ?><?php echo userpro_profile_data('display_name'); ?><?php echo userpro_profile_data('display_name', $chat_with); ?>It’s as simple as that.
As you can see the code
<?php _e('Your '); ?>adds the text
Yourwith a standard space in front of the username and the same with
<?php _e('messaging '); ?>adding the word messaging with a standard space. For further reference purposes the
represents the standard space.
If you would like something different you could change the text within this code however we have to consider space issues if the user say had a long username hence I wanted to improve it but keep it short with this in mind.
If all goes well you should end up with a more better presented window in which people can message one or another.
Well there you have it another tutorial in the hope that it helps others in the same boat. If you find this tutorial useful or have any improvements or comments on this let me know. I always welcome feedback. Good luck and hope it helps!
Gaz9 years ago kreacomParticipant
Great! Thanks for the share!9 years ago Ayesha (UserPro Support )Participant
Thanks so much for sharing these tips 🙂 Much appreciated
You must be logged in to reply to this topic.