Support Forum

Any way for users to hide signatures?

MO mike olson
mike olson
Member

Some users don’t like viewing people’s signatures. Is there anyway to hide other people’s sigs? 

18 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Well – there is a question we have most certainly never been asked before!

And currently – I am afraid not. The best I can point you to is to disallow users the right to create and use signatures which is a standard permission you can grant and revoke.

MO mike olson
mike olson
Member

H

Yellow Swordfish said
Well – there is a question we have most certainly never been asked before!
And currently – I am afraid not. The best I can point you to is to disallow users the right to create and use signatures which is a standard permission you can grant and revoke.  

Huh that’s a pretty standard feature on a lot of boards. 

 

Wonder if I could create a custom profile field for users to set and then use some logic in the post display to turn off that section based on the custom profile field? 

MP Mr Papa
Mr Papa
Member

sorry, you want users to be able to selectively hide other user signatures? user by user?  never seen that before… not even sure what that UI would look like… for large user systems, could be quite cumbersome…

a bit messy, but you could use the filter on display of signatures, ‘sph_PostIndexUserSignature’, to remove it when you like… so yes, you could use a custom profile field, and check that field using the above signature and remove it if you like…  but that will only allow a user to turn off display of all signatures, not each user by user..

MO mike olson
mike olson
Member

Mr Papa said
sorry, you want users to be able to selectively hide other user signatures? user by user?  never seen that before… not even sure what that UI would look like… for large user systems, could be quite cumbersome…

a bit messy, but you could use the filter on display of signatures, ‘sph_PostIndexUserSignature’, to remove it when you like… so yes, you could use a custom profile field, and check that field using the above signature and remove it if you like…  but that will only allow a user to turn off display of all signatures, not each user by user..  

Yes on ip.board you can do it on a user by user basis and some other software as well. However I’d settle for all sigs or nothing. 

MO mike olson
mike olson
Member

I am wondering if I would just do something like this in the spTopicViewDesktop.php template. 

if(custom_profileField==0){
sp_PostIndexUserFlexSignature(‘tagClass=spPostUserSignature’);
}

 

How would I call the user’s (viewer) custom profile field? 

YS Yellow Swordfish
Yellow Swordfish
Member

If you wanted to go down that route you can access the user who made the post (in the spTopicView template) using the global variable:

$spThisPostUser

so… that would be:

$spThisPostUser->yourCustomnFieldName

If you go to the forum admin > toolbox > data inspector – look over on the right at the Topic View Data section you will see the checkbox to show the thisPostUser data. If you check it, save and then open a topic page it will display all the data that is available for use which includes custom fields. Only you will see this by the way. But it is useful to check what data is available and can be used.

if you prefer to just not show signaures then just turn off the permissions to use them.

MO mike olson
mike olson
Member

I think what I want to do is get the value of the custom profile field for the user that is viewing the forum. If that person has a custom field named “Hide Signatures” then all signatures should no longer be displayed in the topic view. 

MO mike olson
mike olson
Member

Ok so I see where the custom profile field for the person viewing can be seen by ticking the spGlobals box in the data inspector. 

 

here is what it outputs:

 

[customProfileFields] => Array ( [data] => Array ( [0] => Array ( [name] => Hide Signatures [slug] => hidesignatures [type] => checkbox [values] => [form] => edit-profile ) ) )
MO mike olson
mike olson
Member

Going off of that would it be as simple as replacing 

 

sp_PostIndexUserFlexSignature(‘tagClass=spPostUserSignature’);

with

if($spUser->hidesignatures==1){
sp_PostIndexUserFlexSignature(‘tagClass=spPostUserSignature’);
}

YS Yellow Swordfish
Yellow Swordfish
Member

The current user of the system can be accessed using the $spThisUser data object, Also available in the data inspector.

MO mike olson
mike olson
Member

Ok but I need to know how to get at the data to make an conditional statement. 

 

How do I get the value of $spThisUser’s custom profile field named hidesignatures to evaluate it’s value? 

YS Yellow Swordfish
Yellow Swordfish
Member

Exactly as I described in post #7 previously:

$spThisUser->hidesignatures

MO mike olson
mike olson
Member

Yellow Swordfish said
Exactly as I described in post #7 previously:

$spThisUser->hidesignatures

  

Damn I apologize I didn’t see that. 

 

Ok so this si what I did in case anyone else wants to do it. 

Create a custom profile checkbox field called Hide Signatures 

 

Then in 

/desktop/spTopicViewDesktop.php (do similarly in the mobile template as well)

 

Replace this:

sp_PostIndexUserFlexSignature(‘tagClass=spPostUserSignature’);

 

with this:

if($spThisUser->hidesignatures==”){sp_PostIndexUserFlexSignature(‘tagClass=spPostUserSignature’);}