News:

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

Main Menu

[TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)

Started by GL700Wing, September 13, 2013, 10:06:52 PM

Previous topic - Next topic

GL700Wing

The following code changes will allow a forum Administrator to search the member list for banned members (this was a mod request in August 2012).

./Sources/ManageMembers.php
FIND
'activated' => array(
'db_fields' => array('CASE WHEN is_activated IN (1, 11) THEN 1 ELSE 0 END'),
'type' => 'checkbox',
'values' => array('0', '1'),
),


REPLACE WITH
'activated' => array(
'db_fields' => array('is_activated'),
'type' => 'checkbox',
'values' => array('0', '1', '11'),
),



./Themes/default/ManageMembers.template.php
FIND
<label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked="checked" class="input_check" /> ', $txt['not_activated'], '</label>

REPLACE WITH
<label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked="checked" class="input_check" /> ', $txt['not_activated'], '</label>&nbsp;&nbsp;
<label for="activated-11"><input type="checkbox" name="activated[]" value="11" id="activated-11" checked="checked" class="input_check" /> ', $txt['banned'], '</label>



./Themes/default/languages/Admin.english.php
FIND


?>


ADD BEFORE
$txt['banned'] = 'Banned';



./Themes/default/languages/Admin.english-utf8.php
FIND


?>


ADD BEFORE
$txt['banned'] = 'Banned';
Life doesn't have to be perfect to be wonderful ...

Colin

Thanks!


For simplicity sake you could use ADD AFTER for the ./Themes/default/ManageMembers.template.php edit.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Shambles

Neat. Thanks :)


QuoteFor simplicity sake you could use ADD AFTER for the ./Themes/default/ManageMembers.template.php edit.
The original/existing line has an amendment.

Bigguy



live627

Yes, but with dome minor changes.

Source:

'activated' => array(
'db_fields' => array('IF(is_activated IN (1, 11), 1, 0)'),
'type' => 'checkbox',
'values' => array('0', '1'),
),
(only db_fields change)

Template:

<label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked="checked" class="check" /> ', $txt['not_activated'], '</label> (only HTML class change. Remember to change the same in the code to replace from input_check to check!)

Everything else is the same.


Moerpot

What is the possibility to create a folder [Banned] and set the path in the program to do it automatically?

live627

Define "folder", please. Is it a file system directory? The members are stored in the database.

Arantor

Judging by his other topic I think he means a board with topics. The short answer is I don't think that's going to work

Advertisement: