UBB.Dev
Posted By: sirdude [7.2.1] - Sort moderators alphabetically - 07/25/2007 2:23 AM
We have about 30 moderators on a board and dealing with them in the CPanel is a pain, when the list isn't sorted. It's also nice to have the list per forum sorted too..

This does just that.. nothing fancy, but it sorts them where visible alphabetically.

open: /admin/modmanage.php

find:
PHP Code
 SELECT t1.USER_DISPLAY_NAME,t2.USER_ID,t2.FORUM_ID
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t2,
{
$config['TABLE_PREFIX']}USERS AS t1
WHERE t2
.USER_ID = t1.USER_ID
ORDER BY FORUM_ID

replace with:
PHP Code
 SELECT t1.USER_DISPLAY_NAME,t2.USER_ID,t2.FORUM_ID
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t2,
{
$config['TABLE_PREFIX']}USERS AS t1
WHERE t2
.USER_ID = t1.USER_ID
ORDER BY FORUM_ID
, t1.USER_DISPLAY_NAME
done!

open: /admin/modselect.php

find:
PHP Code
 SELECT USER_ID,USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}USERS
WHERE USER_MEMBERSHIP_LEVEL
='Moderator' OR USER_MEMBERSHIP_LEVEL='Administrator'

replace with:
PHP Code
 SELECT USER_ID,USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}USERS
WHERE USER_MEMBERSHIP_LEVEL
='Moderator' OR USER_MEMBERSHIP_LEVEL='Administrator'
ORDER BY USER_DISPLAY_NAME
done!

open: /scripts/cfrm.inc.php

find:
PHP Code
	 SELECT t1.FORUM_ID,t1.USER_ID,t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.USER_ID = t2.USER_ID
replace with:
PHP Code
	 SELECT t1.FORUM_ID,t1.USER_ID,t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.USER_ID = t2.USER_ID
ORDER BY t2
.USER_DISPLAY_NAME
done!

open: /scripts/postlist.inc.php

find:
PHP Code
				 SELECT t1.USER_ID, t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.USER_ID = t2.USER_ID
AND t1.FORUM_ID = ?
replace with:
PHP Code
				 SELECT t1.USER_ID, t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.USER_ID = t2.USER_ID
AND t1.FORUM_ID = ?
ORDER BY t2.USER_DISPLAY_NAME
find:
PHP Code
	 SELECT t1.USER_ID,t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.FORUM_ID = ?
AND
t1.USER_ID = t2.USER_ID
replace with:
PHP Code
	 SELECT t1.USER_ID,t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.FORUM_ID = ?
AND
t1.USER_ID = t2.USER_ID
ORDER BY t2
.USER_DISPLAY_NAME
done!

open: /scripts/showflat.inc.php

find:
PHP Code
	 SELECT t1.USER_ID,t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.FORUM_ID = ?
AND
t1.USER_ID = t2.USER_ID
replace with:
PHP Code
	 SELECT t1.USER_ID,t2.USER_DISPLAY_NAME
FROM
{$config['TABLE_PREFIX']}MODERATORS AS t1,
{
$config['TABLE_PREFIX']}USERS AS t2
WHERE t1
.FORUM_ID = ?
AND
t1.USER_ID = t2.USER_ID
ORDER BY t2
.USER_DISPLAY_NAME
done!

All done. upload files and you have sorted moderator lists where visible.

Edit for 7.2.1 smile
© UBB.Developers