############################################################## ## MOD Title: BBcode moderation (BB code & mod) ## MOD Author: Ralendil < ralendil@hotmail.com > Ravaille Franck - http://civs.org ## MOD Description: Permit to use a special BB code for your moderation. ## MOD Version: 1.0.2 ## Installation Level: Easy ## Installation Time: 5 min ## Files to Edit: includes/bbcode.php, ## posting.php, ## functions_post.php, ## templates/subSilver/bbcodes.tpl, ## templates/subSilver/subSilver.css, ## templates/subSilver/overall_header.tpl, ## language/lang_english/lang_main.php ## Included Files: none ## Generator: MODEdit by Andareed ######################################################## ## This MOD is released under the GPL License. ## Intellectual Property is retained by the MOD Author(s) listed above ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ ############################################################## ## Author Notes: ## MOD HISTORY ## ## 0.0.1 Beta: Doesn't work cause of Subsilver template that work in a special way. ## 1.0.0 Release: Work perfectly. ## 1.0.1 Correction (code forgotten). ## 1.0.2 Only Admin and modo can edit or post messages with BBcode moderation. ## Now this mod isn't only a bbcode. ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # includes/bbcode.php # #-----[ FIND ]------------------------------------------ # $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']); # #-----[ AFTER, ADD ]------------------------------------------ # $bbcode_tpl['mod_open'] = str_replace('{L_MOD}', $lang['Mod'], $bbcode_tpl['mod_open']); $bbcode_tpl['mod_username_open'] = str_replace('{L_MOD}', $lang['Mod'], $bbcode_tpl['mod_username_open']); $bbcode_tpl['mod_username_open'] = str_replace('{L_BY}', $lang['By'], $bbcode_tpl['mod_username_open']); $bbcode_tpl['mod_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['mod_username_open']); # #-----[ FIND ]------------------------------------------ # // [i] and [/i] for italicizing text. $text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text); $text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text); # #-----[ AFTER, ADD ]------------------------------------------ # // MOD Mod quote $text = str_replace("[mod:$uid]", $bbcode_tpl['mod_open'], $text); $text = str_replace("[/mod:$uid]", $bbcode_tpl['mod_close'], $text); $text = preg_replace("/\[mod:$uid=(?:\"?([^\"]*)\"?)\]/si", $bbcode_tpl['mod_username_open'], $text); # #-----[ FIND ]------------------------------------------ # // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. $text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, ''); $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\"[^"]*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]"); # #-----[ AFTER, ADD ]------------------------------------------ # // MOD Mod Quote $text = bbencode_first_pass_pda($text, $uid, '[mod]', '[/mod]', '', false, ''); $text = bbencode_first_pass_pda($text, $uid, '/\[mod=(\\\\"[^"]*?\\\\")\]/is', '[/mod]', '', false, '', "[mod:$uid=\\1]"); # #-----[ FIND ]------------------------------------------ # // // We're going to try and catch usernames with "[' characters. // if( preg_match('/\[quote\=\\\\"/si', $possible_start) && !preg_match('/\[quote=\\\\"[^"]*\\\\"\]/si', $possible_start) ) { // // OK we are in a quote tag that probably contains a ] bracket. // Grab a bit more of the string to hopefully get all of it.. // $possible_start = substr($text, $curr_pos, strpos($text, "\"]", $curr_pos + 1) - $curr_pos + 2); } # #-----[ AFTER, ADD ]------------------------------------------ # // // MOD Mod Quote // if( preg_match('/\[mod\=\\\\"/si', $possible_start) && !preg_match('/\[mod=\\\\"[^"]*\\\\"\]/si', $possible_start) ) { // // OK we are in a quote tag that probably contains a ] bracket. // Grab a bit more of the string to hopefully get all of it.. // $possible_start = substr($text, $curr_pos, strpos($text, "\"]", $curr_pos + 1) - $curr_pos + 2); } # #-----[ OPEN ]------------------------------------------ # posting.php # #-----[ FIND ]------------------------------------------ # if ( $mode == 'editpost' ) { $attach_sig = ( $post_info['enable_sig'] && $post_info['user_sig'] != '' ) ? TRUE : 0; $user_sig = $post_info['user_sig']; $html_on = ( $post_info['enable_html'] ) ? true : false; $bbcode_on = ( $post_info['enable_bbcode'] ) ? true : false; $smilies_on = ( $post_info['enable_smilies'] ) ? true : false; # #-----[ AFTER, ADD ]------------------------------------------ # /*BEGIN Moderation BBcode*/ // Is this post isn't moderated yet? if (($userdata['user_level'] != ADMIN) and ($userdata['user_level'] != MOD)) { if( (preg_match("[mod:$uid]", $message)) || (preg_match("/\[mod:$uid=(?:\"?([^\"]*)\"?)\]/si", $message)) || (preg_match("[/mod:$uid]", $message)) ) { message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } } /*END Moderation BBcode*/ # #-----[ OPEN ]------------------------------------------ # functions_post.php # #-----[ FIND ]------------------------------------------ # // Check message if (!empty($message)) { $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : ''; $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); # #-----[ AFTER, ADD ]------------------------------------------ # /*BEGIN Moderation BBcode*/ // Is this post countain moderation BBcode? if (($userdata['user_level'] != ADMIN) and ($userdata['user_level'] != MOD)) { if( (preg_match("[mod:$uid]", $message)) || (preg_match("/\[mod:$uid=(?:\"?([^\"]*)\"?)\]/si", $message)) || (preg_match("[/mod:$uid]", $message)) ) { message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } } /*END Moderation BBcode*/ # #-----[ OPEN ]------------------------------------------ # templates/subSilver/bbcodes.tpl # #-----[ FIND ]------------------------------------------ # {EMAIL} # #-----[ AFTER, ADD ]------------------------------------------ #
{L_MOD} {L_BY} {USERNAME}:
{L_MOD}:
# #-----[ OPEN ]------------------------------------------ # templates/subSilver/subSilver.css # #-----[ FIND ]------------------------------------------ # .quote { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%; background-color: #FAFAFA; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px } # #-----[ AFTER, ADD ]------------------------------------------ # .mod { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #D61717; line-height: 125%; background-color: #f1e1b1; border: #D61717; border-style: solid; font-weight : bold; border-left-width: 2px; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px } # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_header.tpl # #-----[ FIND ]------------------------------------------ # .quote { font-family: {T_FONTFACE1}; font-size: {T_FONTSIZE2}px; color: {T_FONTCOLOR1}; line-height: 125%; background-color: {T_TD_COLOR1}; border: {T_TR_COLOR3}; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px } # #-----[ AFTER, ADD ]------------------------------------------ # .mod { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #D61717; line-height: 125%; background-color: #f1e1b1; border: #D61717; border-style: solid; font-weight : bold; border-left-width: 2px; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px } # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # $lang['wrote'] = 'wrote'; // proceeds the username and is followed by the quoted text $lang['Quote'] = 'Quote'; // comes before bbcode quote output. $lang['Code'] = 'Code'; // comes before bbcode code output. # #-----[ AFTER, ADD ]------------------------------------------ # // MOD Mod quote begin $lang['By'] = "by"; $lang['Mod'] = "Moderation"; // MOD Mod quote end # #-----[ SAVE/CLOSE ALL FILES ]---------------------------------------- # # EoM