News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Hide Signatures from Guests

Started by All Colours Sam, March 04, 2010, 11:01:45 PM

Previous topic - Next topic

All Colours Sam

Hide Signatures from Guests





Written by: Miss All sunday
Current version: 2.0
Suitable for: SMF 1.1.x, SMF 2.0 x

Link to Mod





Summary

Hide Signatures from Guests hides all signatures from guests. Members still see signatures.

Installation

Just install the mod with the packager manage, no settings, no text strings, just install and enjoy ^^

Support

Questions should be address to the mod support topic.



Changelog

1.0 - 26 January 2011
-The mod is now source edit only, it will work with all themes.

1.0 - 22 January 2010
First release of Hide Signatures from Guests

Files modified by Hide Signatures from Guests
./Sources/Load.php
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Arantor

Well done, you managed to make this a theme edit, so extra support requests, as well as breaking the "Hide signatures" option in look and layout.

Better solution would have been to put this in Load.php where the signature is parsed.

Find:
// Set things up to be used before hand.

Add Before:
global $user_info;
if (empty($user_info['id']))
$profile['signature'] = '';


Plus this gives you a performance boost since you're not calling the behemoth that is parse_bbc with data it doesn't have to actually parse. It's even the same edit in both versions, too.
Holder of controversial views, all of which my own.


altdot

This didn't work for my forum (running 1.1.11). However, this did:

   if ($user_info['is_guest'])
      $profile['signature'] = '';


Is there any reason not to code it that way?

Arantor

Depends where you're doing it.

There's no major reason why not - just depends on making sure you call it in the right place.
Holder of controversial views, all of which my own.


altdot

Ah-- I did it where you recommended, in Load.php. global $user_info; was already defined and populated at that point. I'm not sure why checking empty($user_info['id']) didn't work, unless the id is 0 instead of empty for guests, which it looked like might be the case.

Arantor

id is 0 for guests, or empty, either way empty() on the id should have worked, since empty checks for not defined/0/'0'/''/array()
Holder of controversial views, all of which my own.


altdot

Weird. I don't know why it didn't work, then. No matter, the code's working fine now. Thanks!

Cal O'Shaw

Any chance this can be given the extra ability to disable the display of signatures for selected membergroups? We have a few people who we'd rather they could not create signatures, or if they create them, no one sees them (effectively the same result).

Grazie,

Cal

All Colours Sam

Hi, I just recently got this mod,  this can be done however, theres already another mod that does what you want.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Cal O'Shaw

I'm running 1.1.12.  Could you point me to that MOD (I searched on "signature" and the closest was one limiting links but I want to prevent a class of members from being able to display signatures).

Grazie!

All Colours Sam

Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Cal O'Shaw

Grazie.  I posted asking if the author would consider 1.1.12, but I'm not counting on him doing so.

Any chance your MOD could provide a way to add to the logic "if membergroup X don't display signature to anyone" when you check if the viewer is a guest?  If you already read from the AdminCP to see if the MOD is enabled, perhaps add a field asking for the membergroup number? (Trying to suggest as easy a way as possible to implement).

I appreciate your help.  Grazie mille!

Cal

All Colours Sam

I'll see about it, my goal for now is to make this mod sources edit only so it can work with every theme.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

MaXiForum.cz


All Colours Sam

this mod is now updated, will work with 2.0 Rc4 or 1.1.x,  no theme edits.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

odtukmt

Mod link returns to SMF community website homepage, is there a problem about the modification?

Matthew K.

No...it's just the link was not setup. Click [Here].
Quote from: odtukmt on February 05, 2011, 11:16:54 AM
Mod link returns to SMF community website homepage, is there a problem about the modification?

odtukmt

Quote from: Labradoodle-360 on February 05, 2011, 11:48:55 AM
No...it's just the link was not setup. Click [Here].
Quote from: odtukmt on February 05, 2011, 11:16:54 AM
Mod link returns to SMF community website homepage, is there a problem about the modification?


Thank you so much :)

Matthew K.

Not a problem.
Quote from: odtukmt on February 05, 2011, 01:32:50 PM
Quote from: Labradoodle-360 on February 05, 2011, 11:48:55 AM
No...it's just the link was not setup. Click [Here].
Quote from: odtukmt on February 05, 2011, 11:16:54 AM
Mod link returns to SMF community website homepage, is there a problem about the modification?


Thank you so much :)

All Colours Sam

Quote from: odtukmt on February 05, 2011, 11:16:54 AM
Mod link returns to SMF community website homepage, is there a problem about the modification?

I fixed it.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

All Colours Sam

This mod is now updated for SMF 2.0 and 1.1.x
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

antoniosaucedo

This mod is great! 

Can I change to "Hide Signatures from regular members"  because I'm using your mod: Hide Topics from Guests and then I not need hide signatures from Guests  ;)

Thank you

All Colours Sam

do you want to hide the signatures from all your users?  or for certain user groups only?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

antoniosaucedo

Thanks.

Actually I want to separate in to categories

Suscription members (Miembro Gold)     and   free members  (regular users)

Administrator       
Global Moderator      
Moderador      
Colaborador      
Miembro Gold      

Post count based groups (regular users)
Nuevo      1953   
10 mm      70   
18 mm      78   
24 mm      88   
35 mm      41
50 mm      33
85 mm      27
100 mm      9   
135 mm      8   
200 mm      6   



I don't want  the free members (regular users and Post count based groups) can see the signatures, only the Suscription members (Miembro Gold)

Thanks

All Colours Sam

you will need the ID of those user groups who cannot see the signature then do an array:

$groups = array(1,2,3,4,5);

global $user_info;   
      if (in_array($user_info['groups'][0], $groups) || in_array($user_info['groups'][1], $groups))      
      $profile['signature'] = '';



where 1,2,3,4,5  are the group IDs you don't want to show the signature to.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

antoniosaucedo

Thanks for answer:

The Post count based groups (regular users) are:  4,6,7,8,9,10,12,13,14,19

I supposed that I do something wrong because didn't work

I paste the following between:

// Hide signature from guest and groups mod

::::::::::::::::::::::::::::::::::::

$groups = array(4,6,7,8,9,10,12,13,14,19);

global $user_info;   
      if (in_array($user_info['groups'][0], $groups) || in_array($user_info['groups'][1], $groups))     
      $profile['signature'] = '';

::::::::::::::::::::::::::::::::::::

// Set things up to be used before hand.]]></add>

But now anyone can see the signatures.

All Colours Sam

did you do the file edit on Sources/Load.php ?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Douglas

In theory, this should also work for SMF 2.1, though you can now achieve this via membergroup permissions as well, I believe.
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* HBCUAC.org Web Developer, the NAIA's only HBCU Athletic Conference
* Former Sports Photographer and Media Personality and Former CFB Historian
* Tech Admin for one 2.9M+ post and one 11.6M+ post sites. Used to own a 1M+ post site.
* WordPress Developer (Junkie / Guru / Maven / whatever)

All Colours Sam

Thank you for letting me know, will keep this mod compatibility with 2.0 only.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Advertisement: