чтоб модератор мог выражать свое модераторское мнение и недовольство своими пользователями
Код: Выделить всё
##############################################################
## MOD Title: Moderator Tag (Light Version)
## MOD Author: quazi < nomail@nospam.com > (quazi) http://phpbbguru.net/community/viewtopic.php?t=3958
## MOD Description: Allow moderators to apply in the posts moderator tags such as [mod][/mod] and [warn][/warn].
## The first of them means informational message and voices user's opinion as a moderator.
## The second means warning and recommended as the stronger expression.
## These tags are dislayed as large blue "M" and red "!" moderator signs.
##
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 5 Minute
## Files To Edit (6): templates/subSilver/bbcode.tpl, templates/subSilver/subSilver.css, template/subSilver/overall_header.tpl, includes/bbcode.php, viewtopic.php, posting.php
## Included Files: (n/a)
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/
##############################################################
## Author Notes: This MOD enables over moderator signs the default tooltips "Moderator Information" and
## "Moderator Warning", respectively. If You want change them to Your ownself texts or localize
## to Your native language You can add two variables to the language/lang_XXX/lang_main.php:
##
## $lang['Moderator_Mod'] = 'Your text in place of <Moderator Information>';
## $lang['Moderator_Warn'] = 'Your text in place of <Moderator Warning>';
##
##############################################################
## MOD History:
##
## 2007-02-14 - Version 1.0.1
## - Fixed parser of [mod] and [warn] tags. All visialization removed to appropriate template file
## 2005-07-15 - Version 1.0.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#----[ OPEN ]-------------------------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#----[ FIND ]-------------------------------------------------------------
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
#
#----[ AFTER, ADD ]--------------------------------------------------------------
#
<!-- BEGIN moderate -->
<table border="0" cellpadding="0" cellspacing="2"><tr valign="top"><td><div class="moder {MODER_CLASS}" title="{MODER_TOOLTIP}">{MODER_SIGN}</div></td><td class="postbody">{MODER_TEXT}</td></tr></table>
<!-- END moderate -->
#
#----[ OPEN ]-------------------------------------------------------------
#
templates/subSilver/subSilver.css
#
#----[ FIND ]-------------------------------------------------------------
#
/*
The original subSilver Theme for phpBB version 2+
Created by subBlue design
http://www.subBlue.com
*/
#
#----[ AFTER, ADD ]--------------------------------------------------------------
#
/* +Moderator tags MOD */
.moder {
color: #FFFFFF;
font-family: Arial, 'Courier New', sans-serif;
font-size: 32px;
font-weight: bold;
height: 50px;
text-align: center;
width: 50px;
}
.warn { background-color: #FF0000; }
.mod { background-color: #0066CC; }
/* -Moderator tags MOD */
#
#----[ OPEN ]-------------------------------------------------------------
#
template/subSilver/overall_header.tpl
#
#----[ FIND ]-------------------------------------------------------------
#
<style type="text/css">
<!--
#
#----[ AFTER, ADD ]--------------------------------------------------------
#
/* +Moderator tags MOD */
.moder {
color: #FFFFFF;
font-family: Arial, 'Courier New', sans-serif;
font-size: 32px;
font-weight: bold;
height: 50px;
text-align: center;
width: 50px;
}
.warn { background-color: #FF0000; }
.mod { background-color: #0066CC; }
/* -Moderator tags MOD */
#
#----[ OPEN ]-------------------------------------------------------------
#
includes/bbcode.php
#
#----[ FIND ]-------------------------------------------------------------
#
/**
* Does second-pass bbencoding. This should be used before displaying the message in
* a thread. Assumes the message is already first-pass encoded, and we are given the
* correct UID as used in first-pass encoding.
*/
#
#----[ BEFORE, ADD ]------------------------------------------------------
#
// +Moderator tags MOD
function bbencode_moder_cb($matches)
{
global $lang, $bbcode_tpl;
$class = $matches[1];
$text = @$matches[2];
if ($class == 'mod')
{
$tooltip = @$lang['Moderator_Mod'] ? $lang['Moderator_Mod'] : "Moderator Information";
$sign = "M";
}
else
{
$tooltip = @$lang['Moderator_Warn'] ? $lang['Moderator_Warn'] : "Moderator Warning";
$sign = "!";
}
//$text = '<table border="0" cellpadding="0" cellspacing="2"><tr valign="top"><td><div class="moder ' . $class . '" title="' . $tooltip . '">' . $sign . '</div></td><td class="postbody">' . $text . '</td></tr></table>';
$text = str_replace(array('{MODER_CLASS}', '{MODER_TOOLTIP}', '{MODER_SIGN}', '{MODER_TEXT}'), array($class, $tooltip, $sign, $text), $bbcode_tpl['moderate']);
return $text;
}
function bbencode_moder($text, $enable)
{
if ( $enable )
{
$text = preg_replace_callback("/\[(mod|warn)\]((?:(?!\[\/?\\1\]).)*)\[\/\\1\]/s", 'bbencode_moder_cb', $text);
}
return $text;
}
// -Moderator tags MOD
#
#----[ OPEN ]-------------------------------------------------------------
#
viewtopic.php
#
#----[ FIND ]-------------------------------------------------------------
#
//'MESSAGE' => $message,
#
#----[ REPLACE WITH ]-----------------------------------------------------
#
// +Moderator tag MOD
//'MESSAGE' => $message,
'MESSAGE' => bbencode_moder($message, $postrow[$i]['user_level'] == ADMIN || $postrow[$i]['user_level'] == MOD),
// -Moderator tag MOD
#
#----[ OPEN ]-------------------------------------------------------------
#
posting.php
#
#----[ FIND ]-------------------------------------------------------------
#
//'MESSAGE' => $preview_message,
#
#----[ REPLACE WITH ]-----------------------------------------------------
#
// +Moderator tag MOD
//'MESSAGE' => $preview_message,
'MESSAGE' => bbencode_moder($preview_message, $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD),
// -Moderator tag MOD
#
# EoM
#