Page 1 of 4

[RC1] PM Count MOD

Posted: Tue May 15, 2007 5:38 pm
by ErDrRon
MOD Title: PM Count MOD
MOD Description: Allows administrators and moderators to view the total number of PMs sent
by users in their Profile and on the Memberlist. This version has been tested and works with phpBB 2.0.22.
MOD Version: 1.1.RC1

MOD Download: http://www.erdrron.com/phpBB2/download.php?id=611
Last Stable version: 1.1.RC1

Demo Board: N/A
Demo Username: N/A
Demo Password: N/A

MOD History:
2007-11-06 - Version 1.1.1
- first release candidate

2007-05-17 - Version 1.1.1
- added Admin Userlist Add-on

2007-05-16 - Version 1.1.0
- added total PMs count to Memberlist

2007-05-15 - Version 1.0.0
- initial stable release
____________________________________________________________________________________

This MOD shows the total number of PMs a user has sent on their Profile page as well as on the Memberlist. Only Admins and Mods can view this new field. The number of PMs sent for every
user will start at zero once this MOD is installed and will increment by one each
time they send a PM afterwards. There is no way to know how many PMs were sent
prior to installation of this MOD as phpBB did not previously store that information.

I have included a set of pre-edited files in the contrib folder. You can copy these
pre-edited files directly to your server replacing the original phpBB files ONLY if you
have not modified the standard phpBB installation in any way. If you have already modified
any of the files in your current phpBB installation that will be replaced by the
pre-edited files in this MOD you may break your forum and it may no longer function
correctly.

I have, at the request of Dogs and things, included in the contrib folder an Add-on that allows Administrators to see the total number of PM's sent by users in the Admin Userlist 2.0.6c MOD.

While this version has only been tested and certified to work with phpBB version 2.0.22 it
likely will work with any phpBB 2.x.x version. If you need me to test it for a particular
version please let me know.

Please note that this MOD is NOT written to be EasyMod compatible (I haven't tested it).

This MOD was written at the request of sibry at:
http://www.phpbb.com/community/viewtopi ... &sk=t&sd=a

Cheers!
Ron

Re: [BETA] PM Count MOD

Posted: Wed May 16, 2007 10:07 pm
by Dogs and things
Er Doc,

Nice job! :razz:

Re: [BETA] PM Count MOD

Posted: Wed May 16, 2007 10:12 pm
by ErDrRon
Dogs and things,

Thank you very much. I am currently adding the capability of seeing the total PM's sent in the Memberlist as well. Again, only the Admins and Mods will see this info.

Cheers!
Ron

Re: [BETA] PM Count MOD

Posted: Wed May 16, 2007 10:24 pm
by Dogs and things
It would be nice if you could make this MOD compatible with Admin Userlist 2.0.6c so that we can see in the userlist the nº of PMs.

Allthough I guess that the current memberlist thingie will do virtually the same, allow us to see in one quick look many user´s pm count. ;)

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 12:17 am
by ErDrRon
I have the Memberlist module finished. I'll repackage the MOD and release it as version 1.1.0 in the next day or so. I'll add it to the Admin Userlist as a contrib next.

Cheers!
Ron

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 2:55 am
by ErDrRon
I have repackaged the PM Count MOD as version 1.1.0. It now shows Administrators and Moderators the total number of PM's sent by each user in their respective profile pages as well as on the Memberlist. You can now see at a glance those users that utilize the PM system and to what extent. Enjoy!

Cheers!
Ron

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 6:32 am
by Dogs and things
Cheers to you! :)

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 5:42 pm
by sibry
I have now installed this!

It works a treat!!

Thanks very much 8)

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 7:35 pm
by ErDrRon
You're very welcome. Did you install version 1.0.0 or 1.1.0?

Cheers!
Ron

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 9:28 pm
by ErDrRon
Dogs and things wrote: It would be nice if you could make this MOD compatible with Admin Userlist 2.0.6c so that we can see in the userlist the nº of PMs.

Allthough I guess that the current memberlist thingie will do virtually the same, allow us to see in one quick look many user´s pm count. ;)
Dogs and things,

I have written an Add-on to the PM Count MOD that shows the number of PM's sent by each user to the Admin Userlist 2.0.6c MOD. It is included in the contrib folder of the latest PM Count MOD release (1.1.1).

Let me know if this serves your purpose.

Cheers!
Ron
:D

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 9:48 pm
by Dogs and things
It´s working, nicely. :razz:

I guess it would be to much of a deviation from the purpose of the MOD asking you to make the admin_userlist addon so that pm count would be fitted into the sorting method, but nevertheless I ask if this would be easilly achievable?

Your MOD is very good as it is really, but it would be nice to have some way of figuring out easilly who are the top pm-ers without having to go through the whole member- or userlist.

Greetings and thanks again.

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 10:42 pm
by ErDrRon
I have added the Admin Userlist Add-on sorting capability you asked for and it is now included in version 1.1.1.

The following code snippet adds the sorting capability you asked for.

Cheers!
Ron
:D

Code: Select all

# 
#-----[ OPEN ]-------------------------------------------- 
# 
admin_userlist.php

#-----[ FIND ]-------------------------------------------- 
#
# approximately line 112
#
	case 'user_posts': 

# 
#-----[ AFTER, ADD ]--------------------------------------
#
// PM Count MOD - Start
	case 'user_pms':
// PM Count MOD - End		

#-----[ FIND ]-------------------------------------------- 
#
# approximately line 839
#
			  $select_sort_by_text = array($lang['User_id'], $lang['Active'], $lang['Username'], $lang['Joined'], $lang['Last_activity'], $lang['User_level'], $lang['Posts'], $lang['Rank'], $lang['Email'], $lang['Website']); 

# 
#-----[ REPLACE WITH ]--------------------------------------
#
// PM Count MOD - Start
			  $select_sort_by_text = array($lang['User_id'], $lang['Active'], $lang['Username'], $lang['Joined'], $lang['Last_activity'], $lang['User_level'], $lang['Posts'], $lang['Pms'], $lang['Rank'], $lang['Email'], $lang['Website']); 
// PM Count MOD - End

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 11:18 pm
by Dogs and things
Thanks for your impressive quickness!

I have some minor bad news though:

My admin_userlist is not exactly the same as the pre-edited one you include. In mine I can´t find the first find of the snippet,

Code: Select all

   case 'user_posts':
The second find is there allright, just like the others in your first version of this addon.

Here is my admin_userlist.php for you to compare. A bit strange really. I´m sure my file is the correct version from admin userlist MOD version 2.0.6c, I just compared the file I´m using with a fresh one from the MOD as I downloaded it.

Re: [BETA] PM Count MOD

Posted: Thu May 17, 2007 11:25 pm
by ErDrRon
It looks like you've added another MOD to the Admin Userlist MOD. The following code has replaced the standard code in your version:

Code: Select all

//
// sort method (MOD: save sort order)
//
if ( isset($HTTP_GET_VARS['sort']) || isset($HTTP_POST_VARS['sort']) )
{
   $sort = ( isset($HTTP_POST_VARS['sort']) ) ? htmlspecialchars($HTTP_POST_VARS['sort']) : htmlspecialchars($HTTP_GET_VARS['sort']);
   $sort = str_replace("\'", "''", $sort);
  $order = ( isset($HTTP_POST_VARS['order']) ) ? $HTTP_POST_VARS['order'] : $HTTP_GET_VARS['order'];

   $order = ($order == 'ASC') ? 1 : 0;

   $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '$sort' WHERE config_name = 'admin_user_mode'";
   if (!($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not update sort method', '', __LINE__, __FILE__, $sql);
   }

   $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = $order WHERE config_name = 'admin_user_order'";
   if (!($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not update sort order', '', __LINE__, __FILE__, $sql);
   }
}
$sort = isset($sort) ? $sort : $board_config['admin_user_mode'];
$sort_order = ((isset($order) ? $order : $board_config['admin_user_order']) == 1) ? 'ASC' : 'DESC';

Re: [BETA] PM Count MOD

Posted: Fri May 18, 2007 12:07 am
by Dogs and things
Hello Ron,

You´re right, of course, I added some sort order modification to the userlist.

I undid the changes made by that addon and installed yours. It works nicely.

Thanks again for helping me out.

I´ll try and sort out that sort order tomorrow, if I can.

For now I´m quite pleased with the new function you added, it´s much more usefull than that sort order thing.

Final question, feel free to not answer: Would you expect this filter addon to interfere with yours or should I just try and see what happens? :razz:

Greetings.