News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Show "Banned" in a users profile and posts when a user is banned

Started by ArkServer, December 26, 2006, 12:20:23 PM

Previous topic - Next topic

ArkServer

Is it possible to add a "banned" status in a users profile and below the avatar in a post so other people can see that person is banned?

sawz

can you create a new group called 'banned' and adjust the permissions accordingly? then when you ban a certain individual, move them to that group.
keep smiling, they'll always wonder what your up too.....


127.0.0.1

Quote from: ArkServer on December 26, 2006, 12:20:23 PM
Is it possible to add a "banned" status in a users profile and below the avatar in a post so other people can see that person is banned?


Yes. I added this on the profile and some other places in my forum.

Use $context['member']['is_banned'] to check if a member is banned.

For example:


if ($context['member']['is_banned'])
     echo 'This user is banned';


127.0.0.1

Well, you said you wanted it on their profile page and under their posts.

So you'd edit Profile.template.php, Display.template.php and PersonalMessage.template.php.

Profile.template.php

Find this code:
// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />
', $context['member']['blurb'], '
</td>
</tr>';


Change it to:
// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />',
($context['member']['is_banned'] ? '<div><b>This user is banned.</b></div>' : ''),
$context['member']['blurb'], '
</td>
</tr>';


Display.template.php and PersonalMessage.template.php

Find this code:
// Show their personal text?

Add before it:

// Show ban status?
if ($message['member']['is_banned'])
     echo '<div><b>This user is banned!</b></div>';



Please backup those three files before you modify them. I did this quickly and it's possibly I made a syntax error.


lonrot

Thanks here either, it's strange this feature is not implemented on SMF by default.

elfishtroll

Quote from: lonrot on August 20, 2007, 11:43:23 PM
Thanks here either, it's strange this feature is not implemented on SMF by default.

actually most decent sites dont do the "wall of shame" thing :P

I think the consensus is...'they're banned, who gives a shiite? (or Sunni)'


also, you open up yourself for a 'disparagement lawsuit' -

Just deny them access and to hell with them I say.

Of course, for those special ones, they get redirected to their OWN PAGE with their picture! mmmwwwhhhaaaahh!!

HunterP

Quote from: lonrot on August 20, 2007, 11:43:23 PM
Thanks here either, it's strange this feature is not implemented on SMF by default.

Indeed, very weird. I've just used this modification and it's much easier than adding an extra membergroup, just for banned members.
No plans to add this in a future SMF release?


HunterP

Quote from: Illori on March 28, 2011, 04:35:39 PM
there are no plans to add this at this time, see http://www.simplemachines.org/community/index.php?topic=424618.0

IMHO that is a very different request. I just want to display an image which indicates that this member is currently banned. Normally, you should create an additional membergroup which requires extra work; banning and placing in this membergroup. With the above suggestion, one little change in the code does this without requiring an extra membergroup. So, that's not as difficult as the request in the topic you mentioned :)

HunterP


if ($message['member']['is_banned'])

Is only true for full bans. How do I test if a user is post-banned?

Vancete

Sorry for the up, but, there's any way to show too the reason?
Thanks in advance

Advertisement: