############################################################## ## MOD Title: Seperate PM limits for admin and mods ## MOD Author: RMcGirr83 < rmcgirr83@betraythis.com > (Girr) http://www.betraythis.com/ ## MOD Author: ZombieSlayer < zombieslayer@thunder65.com > (N/A) http://www.thunder65.com ## ## Instructions Modified for phpnuke: MBSimonds (Mike) ## Premium members Limit Mod added by MBSimonds ## ##MOD Description: A mod that allows you to set different private message limits for administrators and moderators through the ACP. ##MOD MBSimonds ADD Premium members will have additional PM Space 100 per box by default. ## The current max allowed for admins is 500 per box (in/sent/save) and 250 for moderators. ## You can change this prior to installing the MOD by simply changing those values in the SQL queries. ## MOD Version: 1.1.0 ## ## Installation Level: Easy ## Installation Time: 9 minutes ## Files To Edit: modules/Private_messages/index.php ## modules/Forums/admin/admin_board.php ## modules/Forums/language/lang_english/lang_admin.php ## modules/Forums/language/lang_english/lang_main.php ## modules/Forums/templates/subSilver/admin/board_config_body.tpl ## Included Files: ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ## Generator: MOD Studio [ ModTemplateTools 1.0.2108.38030 ] ############################################################## ## For security purposes, please check: http://www.phpbb.com/mods/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://www.phpbb.com/mods/ ############################################################## ## Author Notes: A very big thank you goes to poyntesm for confirming that my code was correct and answering a ## bunch of questions. ## ## Another big thank you to Manipe for cleaning up my very sloppy SQL. ## ## Installation time should be around 5-10 minutes. ## ## ## The current max allowed for admins is 500 per box (in/sent/save) and 250 for moderators. ## You can change this prior to installing the MOD by simply changing those values in the SQL queries. ############################################################## ## MOD History: ## ## 2006-01-16 - Version 0.1.2 ## Final tweaking to the SQL query. ## ## 2006-02-04 - Version 1.0.0 ## A bit of tweaking in my author notes and version number ## ## 2006-02-13 - Version 1.0.1 ## Changed an if statement to an elseif statement. Also removed some unnecessary lang in admin/admin_board.php ## ## 2006-02-13 - Version 1.0.2 ## Enclosed the config_values in single quotes ## ## 2006-03-06 - Version 1.0.3 ## Changed the language in lang_admin.php from "Max posts in Inbox" etc to "Max posts in Users Inbox" etc. ## This will lower any confusion level about which limits are being changed while in the admin control panel. ## ## 2006-03-07 - Version 1.0.4 ## Corrected an error in the location of the finds in language/lang_english/lang_admin.php. Also changed the language from Users to Members. ## ## 2007-12-08 - Version 1.1.0 ## Corrected errors in private messaging allowances ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # # #-----[ SQL ]---------- Create a file with the following and import into your database. # INSERT INTO nuke_bbconfig VALUES ('administrator_max_inbox_privmsgs', '500'); INSERT INTO nuke_bbconfig VALUES ('administrator_max_sentbox_privmsgs', '500'); INSERT INTO nuke_bbconfig VALUES ('administrator_max_savebox_privmsgs', '500'); INSERT INTO nuke_bbconfig VALUES ('moderator_max_inbox_privmsgs', '250'); INSERT INTO nuke_bbconfig VALUES ('moderator_max_sentbox_privmsgs', '250'); INSERT INTO nuke_bbconfig VALUES ('moderator_max_savebox_privmsgs', '250'); INSERT INTO nuke_bbconfig VALUES ('premium_max_inbox_privmsgs', '100'); INSERT INTO nuke_bbconfig VALUES ('premium_max_sentbox_privmsgs', '100'); INSERT INTO nuke_bbconfig VALUES ('premium_max_savebox_privmsgs', '100'); # #-----[ OPEN ]------------------------------------------ # Private_messages/index.php # #IMPORTANT NOTE: You will need to change every instance of == 10 to the user_rank number that corresponds with your premium member thats in your database. # You will need to create the "special rank" through your forums control panel. # (There is 4 instances of == 10 in Private_messages/index.php and they have been NOTED: below) #-----[ FIND ]------------------------------------------ # $sql = "SELECT u.username AS username_1, # #-----[ IN-LINE FIND ]---------------------------------- # u.username AS username_1 # #-----[ IN-LINE AFTER, ADD ]----- # , u.user_level AS userlevel_1, u.user_rank AS userrank_1 # #-----[ FIND ]------------------------------------------ # if ($board_config['max_sentbox_privmsgs'] && $sent_info['sent_items'] >= $board_config['max_sentbox_privmsgs']) # #-----[ REPLACE WITH ]------------------------------------------ # /* NOTE: CHANGE == 10 in the code below to the user_rank that corresponds with your premium rank */ $max_sent_msgs = ($privmsg['userlevel_1'] == ADMIN) ? $board_config['administrator_max_sentbox_privmsgs'] : ($privmsg['userlevel_1'] == MOD) ? $board_config['moderator_max_sentbox_privmsgs'] : (($privmsg['userrank_1'] == 10) ? $board_config['premium_max_sentbox_privmsgs'] : $board_config['max_sentbox_privmsgs']); if ($max_sent_msgs && $sent_info['sent_items'] >= $max_sent_msgs) # #-----[ FIND ]------------------------------------------ # if ($board_config['max_savebox_privmsgs'] && $saved_info['savebox_items'] >= $board_config['max_savebox_privmsgs'] ) # #-----[ REPLACE WITH ]------------------------------------------ # /* NOTE: CHANGE == 10 to the user_rank that corresponds with your premium rank */ $max_save_msgs = ( $userdata['user_level'] == ADMIN ) ? $board_config['administrator_max_savebox_privmsgs'] : ( $userdata['user_level'] == MOD ) ? $board_config['moderator_max_savebox_privmsgs'] : (( $userdata['user_rank'] == 10 ) ? $board_config['premium_max_savebox_privmsgs'] : $board_config['max_savebox_privmsgs']); if ($max_save_msgs && $saved_info['savebox_items'] >= $max_save_msgs ) # #-----[ FIND ]------------------------------------------ # $sql = "SELECT user_id, # #-----[ IN-LINE FIND ]---------------------------------- # user_id # #-----[ IN-LINE AFTER, ADD ]----- # , user_level, user_rank # #-----[ FIND ]------------------------------------------ # if ($board_config['max_inbox_privmsgs'] && $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs']) # #-----[ REPLACE WITH ]------------------------------------------ # /* NOTE: CHANGE == 10 to the user_rank that corresponds with your premium rank */ $max_inbox_msgs = ( $to_userdata['user_level'] == ADMIN ) ? $board_config['administrator_max_inbox_privmsgs'] : ( $to_userdata['user_level'] == MOD ) ? $board_config['moderator_max_inbox_privmsgs'] : (( $to_userdata['user_rank'] == 10 ) ? $board_config['premium_max_inbox_privmsgs'] : $board_config['max_inbox_privmsgs']); if ($max_inbox_msgs && $inbox_info['inbox_items'] >= $max_inbox_msgs) # #-----[ FIND ]------------------------------------------ # $inbox_limit_pct = ( $board_config['max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['max_' . $folder . '_privmsgs'] ) * 100) : 100; # #-----[ BEFORE, ADD ]------------------------------------------ # /* Commented out for pmlimits mod # #-----[ FIND ]------------------------------------------ # $inbox_limit_remain = ( $board_config['max_' . $folder . '_privmsgs'] > 0 ) ? $board_config['max_' . $folder . '_privmsgs'] - $pm_all_total : 0; # #-----[ AFTER, ADD ]----- # */ /* NOTE: CHANGE == 10 to the user_rank that corresponds with your premium rank in your database */ if ( $userdata['user_level'] == ADMIN ) { $inbox_limit_pct = ( $board_config['administrator_max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['administrator_max_' . $folder . '_privmsgs'] ) * 100) : 100; $inbox_limit_img_length = ( $board_config['administrator_max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['administrator_max_' . $folder . '_privmsgs'] ) * $board_config['privmsg_graphic_length']) : $board_config['privmsg_graphic_length']; $inbox_limit_remain = ( $board_config['administrator_max_' . $folder . '_privmsgs'] > 0 ) ? $board_config['administrator_max_' . $folder . '_privmsgs'] - $pm_all_total : 0; } elseif ( $userdata['user_level'] == MOD ) { $inbox_limit_pct = ( $board_config['moderator_max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['moderator_max_' . $folder . '_privmsgs'] ) * 100) : 100; $inbox_limit_img_length = ( $board_config['moderator_max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['moderator_max_' . $folder . '_privmsgs'] ) * $board_config['privmsg_graphic_length']) : $board_config['privmsg_graphic_length']; $inbox_limit_remain = ( $board_config['moderator_max_' . $folder . '_privmsgs'] > 0 ) ? $board_config['moderator_max_' . $folder . '_privmsgs'] - $pm_all_total : 0; } elseif ( $userdata['user_rank'] == 10 ) { $inbox_limit_pct = ( $board_config['premium_max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['premium_max_' . $folder . '_privmsgs'] ) * 100) : 100; $inbox_limit_img_length = ( $board_config['premium_max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['premium_max_' . $folder . '_privmsgs'] ) * $board_config['privmsg_graphic_length']) : $board_config['privmsg_graphic_length']; $inbox_limit_remain = ( $board_config['premium_max_' . $folder . '_privmsgs'] > 0 ) ? $board_config['premium_max_' . $folder . '_privmsgs'] - $pm_all_total : 0; } else { $inbox_limit_pct = ( $board_config['max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['max_' . $folder . '_privmsgs'] ) * 100) : 100; $inbox_limit_img_length = ( $board_config['max_' . $folder . '_privmsgs'] > 0 ) ? round(( $pm_all_total / $board_config['max_' . $folder . '_privmsgs'] ) * $board_config['privmsg_graphic_length']) : $board_config['privmsg_graphic_length']; $inbox_limit_remain = ( $board_config['max_' . $folder . '_privmsgs'] > 0 ) ? $board_config['max_' . $folder . '_privmsgs'] - $pm_all_total : 0; } if ($inbox_limit_pct > 100) { $inbox_limit_img_length = $board_config['privmsg_graphic_length']; } # #-----[ OPEN ]------------------------------------------ # admin/admin_board.php # #-----[ FIND ]------------------------------------------ # "L_PRIVATE_MESSAGING" => $lang['Private_Messaging'], # #-----[ AFTER, ADD ]------------------------------------------ # "L_ADMINISTRATOR_INBOX_LIMIT" => $lang['Administrator_Inbox_limits'], "L_ADMINISTRATOR_SENTBOX_LIMIT" => $lang['Administrator_Sentbox_limits'], "L_ADMINISTRATOR_SAVEBOX_LIMIT" => $lang['Administrator_Savebox_limits'], "L_MODERATOR_INBOX_LIMIT" => $lang['Moderator_Inbox_limits'], "L_MODERATOR_SENTBOX_LIMIT" => $lang['Moderator_Sentbox_limits'], "L_MODERATOR_SAVEBOX_LIMIT" => $lang['Moderator_Savebox_limits'], "L_PREMIUM_INBOX_LIMIT" => $lang['Premium_Inbox_limits'], "L_PREMIUM_SENTBOX_LIMIT" => $lang['Premium_Sentbox_limits'], "L_PREMIUM_SAVEBOX_LIMIT" => $lang['Premium_Savebox_limits'], # #-----[ FIND ]------------------------------------------ # "S_PRIVMSG_DISABLED" => $privmsg_off, # #-----[ AFTER, ADD ]------------------------------------------ # "ADMINISTRATOR_INBOX_LIMIT"=>$new['administrator_max_inbox_privmsgs'], "ADMINISTRATOR_SENTBOX_LIMIT"=>$new['administrator_max_sentbox_privmsgs'], "ADMINISTRATOR_SAVEBOX_LIMIT"=>$new['administrator_max_savebox_privmsgs'], "MODERATOR_INBOX_LIMIT"=>$new['moderator_max_inbox_privmsgs'], "MODERATOR_SENTBOX_LIMIT"=>$new['moderator_max_sentbox_privmsgs'], "MODERATOR_SAVEBOX_LIMIT"=>$new['moderator_max_savebox_privmsgs'], "PREMIUM_INBOX_LIMIT"=>$new['premium_max_inbox_privmsgs'], "PREMIUM_SENTBOX_LIMIT"=>$new['premium_max_sentbox_privmsgs'], "PREMIUM_SAVEBOX_LIMIT"=>$new['premium_max_savebox_privmsgs'], # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_admin.php # #-----[ FIND ]------------------------------------------ # $lang['Disable_privmsg'] = 'Private Messaging'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['Administrator_Inbox_limits'] = 'Max posts in Administrator Inbox'; $lang['Administrator_Inbox_limits_explain'] = 'Max posts in Administrator Inbox'; $lang['Administrator_Sentbox_limits'] = 'Max posts in Administrator SentBox'; $lang['Administrator_Sentbox_limits_explain'] = 'Max posts in Administrator Sentbox'; $lang['Administrator_Savebox_limits'] = 'Max posts in Administrator Savebox'; $lang['Administrator_Savebox_limits_explain'] = 'Max posts in Administrator Savebox'; $lang['Moderator_Inbox_limits'] = 'Max posts in Moderator Inbox'; $lang['Moderator_Inbox_limits_explain'] = 'Max posts in Moderator Inbox'; $lang['Moderator_Sentbox_limits'] = 'Max posts in Moderator Sentbox'; $lang['Moderator_Sentbox_limits_explain'] = 'Max posts in Moderator Sentbox'; $lang['Moderator_Savebox_limits'] = 'Max posts in Moderator Savebox'; $lang['Moderator_Savebox_limits_explain'] = 'Max posts in Moderator Savebox'; $lang['Premium_Inbox_limits'] = 'Max posts in Premium Inbox'; $lang['Premium_Inbox_limits_explain'] = 'Max posts in Premium Inbox'; $lang['Premium_Sentbox_limits'] = 'Max posts in Premium Sentbox'; $lang['Premium_Sentbox_limits_explain'] = 'Max posts in Premium Sentbox'; $lang['Premium_Savebox_limits'] = 'Max posts in Premium Savebox'; $lang['Premium_Savebox_limits_explain'] = 'Max posts in Premium Savebox'; # #-----[ FIND ]------------------------------------------ # $lang['Inbox_limits'] = 'Max posts in Inbox'; # #-----[ REPLACE WITH ]------------------------------------------ # $lang['Inbox_limits'] = 'Max posts in Members Inbox'; # #-----[ FIND ]------------------------------------------ # $lang['Sentbox_limits'] = 'Max posts in Sentbox'; # #-----[ REPLACE WITH ]------------------------------------------ # $lang['Sentbox_limits'] = 'Max posts in Members Sentbox'; # #-----[ FIND ]------------------------------------------ # $lang['Savebox_limits'] = 'Max posts in Savebox'; # #-----[ REPLACE WITH ]------------------------------------------ # $lang['Savebox_limits'] = 'Max posts in Members Savebox'; # #-----[ OPEN ]------------------------------------------ # templates/subSilver/admin/board_config_body.tpl # #-----[ FIND ]------------------------------------------ # {L_INBOX_LIMIT} # #-----[ BEFORE, ADD ]------------------------------------------ # {L_ADMINISTRATOR_INBOX_LIMIT} {L_ADMINISTRATOR_SENTBOX_LIMIT} {L_ADMINISTRATOR_SAVEBOX_LIMIT} {L_MODERATOR_INBOX_LIMIT} {L_MODERATOR_SENTBOX_LIMIT} {L_MODERATOR_SAVEBOX_LIMIT} {L_PREMIUM_INBOX_LIMIT} {L_PREMIUM_SENTBOX_LIMIT} {L_PREMIUM_SAVEBOX_LIMIT} # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM