News:

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

Main Menu

Members location on Admins Members List

Started by Chas Large, March 05, 2010, 03:07:58 PM

Previous topic - Next topic

Chas Large

Link to Mod

Members Location on Admin Members List

This mod adds a column to the admin members list to show the members location if they have filled in that field in their profile.

Version History:
1.1 Change of ID.
1.0 Mod built, tested and working on two forums.

Please use the support link if required.

Regards

Chas Large
5th March 2010
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Capion

being a "pure" sources mod this mod shouldn't have any difficulties in any theme...in my logic..
I have tried the mod in 2rc3 w. simpleportal 2.3.1 and a wow-theme ( Eots Dzine ) and just cant get the location column to show in the admins memberlist.
I've tried both the automatic installation afterwards manual.

This is the only way I can have the modded code in "managemembers.php" any other way gives weird errors :


'display_name' => array(
'header' => array(
'value' => $txt['display_name'],
),
'data' => array(
'sprintf' => array(
'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=profile;u=%1$d">%2$s</a>',
'params' => array(
'id_member' => false,
'real_name' => false,
),
),
),
'sort' => array(
'default' => 'real_name',
'reverse' => 'real_name DESC',
),

//Location
'location' => array(
'header' => array(
'value' => $txt['location'],
),
'data' => array(
'function' => create_function('$rowData', '
global $scripturl;
$url = strtr($scripturl, array(\'%\' => \'%%\')) . \'?action=profile;u=\' . $rowData[\'location\'];
return sprintfspamer($rowData, $url, \'location\', 0);
'),
),
'sort' => array(
'default' => 'location',
'reverse' => 'location DESC',
),
),
//End Location
            ),


*if it works, dont fix it*

Chas Large

Does it show in the default theme's Admin Members list?

(Well of course it will do now silly me :-\) but did it before you did your manual edit?
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Capion

to be sure, I've uploaded the original "managemembers.php" file again, to eliminate any other mods.

then I've inserted the code as described, and are looking at the default theme..where I get this error:

Fatal error: Call to undefined function sprintfspamer() in /home/capion/public_html/wow-maw.dk/Sources/ManageMembers.php(532) : runtime-created function on line 4
*if it works, dont fix it*

Capion

If I move the:

),


from right before // location
to right after // end location
( like shown in my previous example )
I do not get any errors..
but I do not get the location column either.
*if it works, dont fix it*

Chas Large

I find this very strange. I tested this on two RC2 forums, one brand new RC3 forum and two upgraded RC2 to RC3 forums plus it's been tested by SMF before being released.

Can you post (attach) you're original unmodified ManageMembers.php file so I can test it.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Capion

*if it works, dont fix it*

Chas Large

OK. I can see you have other mods installed "Spammer protection" and these have changed some of the core functions back to RC2 functionality so the page requires the sprintf call.

Installing the mod using RC2 emulation fixes the problem.

The attached is a fixed and tested version of your ManageMembers.php file.

Regards

Chas
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Capion

It worked like a charm! I am very happy You are so kind, Thank You very much.
*if it works, dont fix it*

Chas Large

You're welcome and I'm pleased you find the mod useful.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Advertisement: