Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: GL700Wing in September 13, 2013, 10:06:52 NACHMITTAGS

Titel: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: GL700Wing in September 13, 2013, 10:06:52 NACHMITTAGS
The following code changes will allow a forum Administrator to search the member list for banned members (this was a mod request (http://www.simplemachines.org/community/index.php?topic=484082.0) 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';
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Colin in September 15, 2013, 04:17:17 NACHMITTAGS
Thanks!


For simplicity sake you could use ADD AFTER for the ./Themes/default/ManageMembers.template.php edit.
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Shambles in September 15, 2013, 04:32:22 NACHMITTAGS
Neat. Thanks :)


ZitatFor simplicity sake you could use ADD AFTER for the ./Themes/default/ManageMembers.template.php edit.
The original/existing line has an amendment.
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Bigguy in September 15, 2013, 04:34:15 NACHMITTAGS
Nice, very useful.
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Biology Forums in September 16, 2013, 07:37:33 NACHMITTAGS
Does this work on SMF1
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: live627 in September 16, 2013, 09:00:12 NACHMITTAGS
Yes, but with some 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.
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Biology Forums in September 16, 2013, 10:51:47 NACHMITTAGS
Thank you.
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Moerpot in September 26, 2013, 03:46:37 VORMITTAG
What is the possibility to create a folder [Banned] and set the path in the program to do it automatically?
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: live627 in September 26, 2013, 06:09:59 VORMITTAG
Define "folder", please. Is it a file system directory? The members are stored in the database.
Titel: Re: [TIP/TRICK] Allow Admin to search for banned members (SMF 2.0.4)
Beitrag von: Arantor in September 26, 2013, 10:32:54 VORMITTAG
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