Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: sooki5 on May 28, 2009, 11:00:25 AM

Title: Banned
Post by: sooki5 on May 28, 2009, 11:00:25 AM
I want a mod which gives the user the custom title of banned when there banned but automatically removes the banned custom title once there unbanned
Title: Re: Banned
Post by: perplexed on May 28, 2009, 11:28:48 AM
create a group called banned and put them in it?
Title: Re: Banned
Post by: sooki5 on May 29, 2009, 10:19:34 AM
Quote from: sooki5 on May 28, 2009, 11:00:25 AM
I want a mod which gives the user the custom title of banned when there banned but automatically removes the banned custom title once there unbanned
But tht wouldent remove them from the grp when there unbanned
Title: Re: Banned
Post by: Eliana Tamerin on May 30, 2009, 11:36:02 AM
Assuming that is_banned is loaded in the $message['member'] array, you could try this:

SMF 1.1.x
Open Display.template.php and find this:
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['title'], '<br />';


Replace with this:
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['is_banned'] ? $txt['banned'] : $message['member']['title'], '<br />';



SMF 2.x
Open Display.template.php, find this:
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
<li>', $message['member']['title'], '</li>';


Replace with this:
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
<li>', $message['member']['is_banned'] ? $txt['banned'] : $message['member']['title'], '</li>';


For both SMF 1.1.x and SMF 2.x:

Then open your Modifications.english.php (or the Modifications file for your language, translate below as needed) and add to the end:
$txt['banned'] = 'Banned!';

BTW, I only coded this for the Display.template.php, but the coding should be similar for PersonalMessage.template.php and Profile.template.php. I just didn't want to show you all of them, since they're mostly the same.

EDIT: I suppose there's an easier way to do this in Load.php which would be global. Let me know if you want that method, if the above isn't enough for you.
Title: Re: Banned
Post by: perplexed on May 30, 2009, 12:37:03 PM
Quote from: sooki5 on May 29, 2009, 10:19:34 AM
Quote from: sooki5 on May 28, 2009, 11:00:25 AM
I want a mod which gives the user the custom title of banned when there banned but automatically removes the banned custom title once there unbanned
But tht wouldent remove them from the grp when there unbanned

no you would have to remove them from the group yourself if you did it this way