Integrating UserPro with your theme comments! – UserPro Forums https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/feed/ Mon, 29 Apr 2024 13:42:01 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-14211 <![CDATA[Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-14211 Wed, 18 Dec 2013 15:09:48 +0000 admin Hello,

This guide will help you show the user profile picture, profile link, user badges and display name to your comments.

Each theme is different but often you have a comments.php file, open that file and find this part:

The callback will be different for each theme, so you just need to find this function inside your theme files, in my example, I am using the dream-theme and the callback presscore_comment is located in functions.php this can be different for each theme though. The callback function includes your actual comment template.

Once you locate this function, edit the following parts to in the function to replace existing comments and integrate UserPro stuff in it. Here are steps:

=============================================================

STEP 1: DEFINE GLOBAL OF USERPRO

You must define this line global $userpro; just after the callback function has started. In my example, It looks like this:

=============================================================

STEP 2: USE USERPRO PROFILE PICTURE (AVATAR)

Change the part that displays user avatar in your comments to:

This short line will display user avatar, 60 is the size you want. You can customize the comments avatar size using this option. That’s it for the avatar, UserPro avatars now integrated in comments.

=============================================================

STEP 3: DISPLAY USER PROFILE LINK AND NAME

Find the part that displays comment author link or name and replace it with this function:

What did we do? Simply we need to check if the commenter has an ID (profile) by testing $comment->user_id, then we display his permalink, and profile data (display name) that’s all. If he does not have an account, the normal author link will display.

=============================================================

STEP 4: DISPLAY USER BADGES

To display user badges in your comments, simply add this code to your comments function where you want to show the badges (This can be different for your needs) maybe beside commenter name is a good option. So you just need to insert the following snippet to show the badges for any registered user!!

That will show the user badges for comment author. Ofcourse you need to check that he is not a guest using $comment->user_id check.

If anyone has any specific question, or want to extend this tutorial, feel free to write! 🙂

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15876 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15876 Sat, 04 Jan 2014 12:48:09 +0000 Nexnivis Hi !

Excellent guide, but i’m using a plugin (Commentator on CodeCanyon) for my comments.

Here is the code with callback functions :

I’ve tried a lot of things with no succes ! If anybody here can help me it will be really great 🙂 Thx a lot !

There is some mistakes with the copy/past, but I guess you understand where are the functions.

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15917 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15917 Sun, 05 Jan 2014 09:01:18 +0000 admin I see the code has get_avatar() already to display custom thumb. What did you try please, or what exactly do you want to integrate? I am not familiar with that plugin. So I need more info about what you expect, and what code did you try

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15927 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15927 Sun, 05 Jan 2014 10:29:51 +0000 Nexnivis I do not get the correct avatar in the comments, I get the default avatar (male or female) as this user did not upload their own avatar. I also love the avatar and username link to profile! And finally, I would like the verified badge appears next to the user name!

I managed to do it with the native commenting system but I can not do with this addon!

This addon is new, it was launched a few days ago, but already a lot of people are interested and many of us ask the author if the addon is compatible with yours.

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15928 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15928 Sun, 05 Jan 2014 10:52:31 +0000 admin Okay, lets take it one by one. To show the badges for any user. Add this where you want badges to appear (maybe beside username)?

<?php echo userpro_show_badges($idUser); ?>

However, it’s not clear why he use current user info and not commenter info. I’d prefer if he could email me to explain to me how his logic works.

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15929 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15929 Sun, 05 Jan 2014 11:08:35 +0000 Nexnivis Here is the plugin Commentator, if you want more informations about it 🙂

I’m going to try adding the badges !

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15930 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15930 Sun, 05 Jan 2014 11:16:34 +0000 keyhanjun I have just informed the author of the “Commentator WordPress Plugin” via PM in regards to this thread here. Hopefully he will contact Ahmed very soon. I am also interested to combine this plugin with UserPro! 😉

Best regards,
keyhanjun

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15932 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15932 Sun, 05 Jan 2014 11:38:54 +0000 Nexnivis Thanks keyhanjun, great idea 🙂

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15970 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-15970 Sun, 05 Jan 2014 17:51:23 +0000 admin ummh that if UserPro does not release its own elegant like/comment system already 😉

]]>
https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-16229 <![CDATA[Reply To: Integrating UserPro with your theme comments!]]> https://forum.userproplugin.com/forums/topic/integrating-userpro-with-your-theme-comments/#post-16229 Mon, 06 Jan 2014 09:52:15 +0000 keyhanjun Now I am all ears! 😉

]]>