Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Any way for users to hide signatures?
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 13, 2017 - 2:51 pm

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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 13, 2017 - 3:52 pm

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.

andy-signature.png
YELLOW
SWORDFISH
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 13, 2017 - 4:32 pm

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? 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 14, 2017 - 12:21 am

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..

Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 14, 2017 - 11:21 am

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. 

Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 14, 2017 - 11:29 am

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? 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 14, 2017 - 2:17 pm

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.

andy-signature.png
YELLOW
SWORDFISH
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 14, 2017 - 3:14 pm

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. 

Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 14, 2017 - 3:23 pm

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 ) ) )
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 14, 2017 - 4:01 pm

Going off of that would it be as simple as replacing 

 

sp_PostIndexUserFlexSignature(‘tagClass=spPostUserSignature’);

with

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

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10118
Posts: 79603