Notifications
Clear all

[Closed] Add forum signature through Ultimate Member profile

20 Posts
9 Users
7 Reactions
11.1 K Views
Posts: 38
Topic starter
(@annabwashere)
Trusted Member
Joined: 6 years ago

I'm using Ultimate Member to replace the profile pages on the forum and everything is working well except I don't know how to let people add a signature to their forum posts.

I know how to create custom fields in UM profile form but how do I connect it to the forum signature?

@anonymous3542, maybe you are familiar with this?

 

19 Replies
Posts: 393
(@anonymous3542)
Honorable Member
Joined: 7 years ago

@annabwashere this isn't something I've tried. My thought here would be to create a function that replaces the wpForo signature with the custom field in UM. @robert - any thoughts on this ?

Thanks

Sofy
Posts: 4900
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @annabwashere@anonymous3542,

We'll take this into consideration for future releases. 

Posts: 63
(@hshah)
Trusted Member
Joined: 5 years ago

I've just managed to do this with Ultimate Member.  I created a custom field on my UM Profile page (entitled "um_forum_signature" and then have this function.  I know there are a number of unnecessary lines of code, but I have done that for the benefit of the less technical people I have also working on the website.

add_action('um_user_after_updating_profile', 'my_user_updating_profile_signature', 10, 2);
function my_user_updating_profile_signature($user_id, $args)
{
$userid = $args;
$signature = $user_id['um_forum_signature'];
global $wpdb;
$table = 'wpforo_profiles';
$data = array(
'signature' => $signature,
);
$wpdb->update($table, $data, array('userid' => $userid));
}
5 Replies
(@hshah)
Joined: 5 years ago

Trusted Member
Posts: 63

@Sofy 

If you guys think this is a viable option, could you publish this as a guide or something? 

Moderator
(@martin)
Joined: 8 years ago

Support Team
Posts: 992

Thank you @hshah,

This looks good but need lots of testing. wpForo user signatures are under hard control of HTML tags. With this code you allow adding anything in signature area. This is not secure for sure. 

Also, this is one direction solution. If user changed signature in wpForo Profile Page the new signature will not be displayed in UM Profile page.

 

BigBatT
(@bigbatt)
Joined: 5 years ago

Eminent Member
Posts: 12

@hshah

Where do you add this code?

Thanks

 

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

@bigbatt,

In your active WordPress theme functions.php file, if you have a child theme, in the child functions.php file. How to Easily Add Custom Code in WordPress (without Breaking Your Site).

 

Sapere Aude
(@sapere-aude)
Joined: 7 years ago

Trusted Member
Posts: 56

@hshah

 

Can you tell me the specific settings for the custom field in UM?

Posts: 63
(@hshah)
Trusted Member
Joined: 5 years ago

@martin

It works in terms of functionality but I have not really looked into it from a security perspective. 

However, I think you are making this sound more complicated than it actually is. It would probably take me all of 15 minutes (I barely know this stuff and have been figuring it out by Googling, along with repeated trial and error attempts) to:

  1. ensure that my signature field editor has the same properties as the wpForo signature field
  2. run the field contents through all the "hard controls" you have in function wpforo_signature

 

That makes it as secure as using the wpForo field, and with a little more time could probably improve on this by actually using your function directly. 

 

Am I missing something obvious with regards to this being a one direction solution? This solution is only really needed when Replace Forum Profile with Ultimate Member Profile is enabled because the existing integration doesn't support this field. 

 

If for some reason people wanted two profiles at the same time, there is no reason why you couldn't update the other way as well. 

 

7 Replies
(@hshah)
Joined: 5 years ago

Trusted Member
Posts: 63

@martin - You never replied to this.  The points you raised don't seem as significant as you made them out to be, so can you please provide further clarification?  I would just like to make sure I have not overlooked something here.

Moderator
(@martin)
Joined: 8 years ago

Support Team
Posts: 992

@hshah,

I have nothing to add here. I'm sorry but I can't find time for debugging the code and approving it. if you have an exact question please ask it. 

 

(@hshah)
Joined: 5 years ago

Trusted Member
Posts: 63

@martin

My last post had nothing to do with debugging or approving the code. I don't actually need you to do any of that since there is nothing wrong with it.

 

My last post was regarding what you said in this post:

https://wpforo.com/community/wpforo-integration/add-forum-signature-through-ultimate-member-profile/#post-35864

 

What you said is essentially wrong and I have explained why, so I think you do actually have more to add, unless you are agreeing that what I'm saying is correct. 

 

Moderator
(@martin)
Joined: 8 years ago

Support Team
Posts: 992

@hshah,

Ok, if I wrong you can use it without any worry. Just make sure that the HTML is filtered from wpForo side on displaying. Also make sure if you change the signature from wpForo side it'll also be changed in UM profile page.

 

(@hshah)
Joined: 5 years ago

Trusted Member
Posts: 63

@martin

 

Can you please actually read what I posted here, because you've clearly haven't already done so:

https://wpforo.com/community/wpforo-integration/add-forum-signature-through-ultimate-member-profile/#post-36680 

 

 

Moderator
(@martin)
Joined: 8 years ago

Support Team
Posts: 992

@hshah,

I've already read it. And again I have nothing to add. If you're going to use it with disabled wpForo profile it'll work and you'll not worry about two-way update. Is this what you want to hear?

 

(@hshah)
Joined: 5 years ago

Trusted Member
Posts: 63

@martin

I already know it works... I just wanted clarification on why you thought that the reverse update was even necessary? 

 

This "mod" is only required when you have the UM integration enabled and the wpForo profile disabled, because that's when the usual signature field is not available.

 

The reverse update is something that wouldn't even be required because you wouldn't have both profiles enabled at the same time. 

 

Page 1 / 2