News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Banned

Started by sooki5, May 28, 2009, 11:00:25 AM

Previous topic - Next topic

sooki5

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


sooki5

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

Eliana Tamerin

#3
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.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

perplexed

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

Advertisement: