wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

[Solved] Add Comment History


Rox1
Posts: 35
 Rox1
Topic starter
(@rox1)
Eminent Member
Joined: 6 months ago

At the moment clicking on the Avatar of a commenter sends people to the profile page of that person, but I’d like it to take you to their comment history instead.  

I’m sure it must be possible as WPDiscuz is linked to the comment histories, so is it possible you can give me an idea of how it may be done?

6 Replies
Rox1
Posts: 35
 Rox1
Topic starter
(@rox1)
Eminent Member
Joined: 6 months ago

To try and help, the posting history link on our site is like this:

 

/author-comment-archive/?user=(user number)

 

So if this can be inserted into the link for the username or when clicking on the avatar, that would be brilliant.

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 4131

Hi @rox1,

You can use the wpdiscuz_profile_url hook:  https://wpdiscuz.com/docs/codex/filters/wpdiscuz_profile_url/

Rox1
Posts: 35
 Rox1
Topic starter
(@rox1)
Eminent Member
Joined: 6 months ago

I'm a bit of a novice, I'm afraid.  The HTML on the old system for it was (if I've figured it out right!):

<a href="<?php echo site_url(), '/author-comment-archive/?user=',$comment->user_id; ?>"><div class="comment-avatar">

How would I use this information with the code you've given, and where would I put that code? 

Rox1
Posts: 35
 Rox1
Topic starter
(@rox1)
Eminent Member
Joined: 6 months ago

Also, is it possible to change the colour and size of the 'Reply' lettering and logo?  I can't find that option in the settings.

 

Plus, is it possible to change the username colour where, when you have replied, it shows who you replied to ... "reply to... Username"

Thanks for your time, I do appreciate it. 🙂

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 4131

@rox1,

How would I use this information with the code you've given, and where would I put that code?

You should customize the code provided in the doc then put the code in your active theme functions.php file.

The developers have changed the hook-code for you. Now you'll just need to add the following code in the active theme functions.php file: 

add_filter("wpdiscuz_profile_url", function ($profile_url, $user) {
    if ($user->ID) {
        $profile_url = site_url() . "/author-comment-archive/?user=" . $user->ID;
    }
   return $profile_url;
}, 10, 2);

Also, is it possible to change the colour and size of the 'Reply' lettering and logo? I can't find that option in the settings.
Plus, is it possible to change the username colour where, when you have replied, it shows who you replied to ... "reply to... Username"

Please note, that we don't provide support for style customization. We can not help you customize the components of website style, these are custom requirements and should be done by website owners. We only help with general questions and issues.

Thank you for your understanding.

You can find all classes by pressing F12 on the browser and opening Chrome or Firefox Console, it'll help you easily write CSS rules you need to customize. 

CSS

This website should help you to write CSS rules:  https://www.w3schools.com/cssref/default.asp

Rox1
Posts: 35
 Rox1
Topic starter
(@rox1)
Eminent Member
Joined: 6 months ago

Thank you very much for that, it worked like a charm.  🙂

 

I didn't know if the reply function had an option in settings, but I was just missing it.  Thanks for your response though, I really appreciate your help.

Share: