Здравейте, скоро реших да тествам един мод за phpbb - Democracy MOD. Една от главните функции на този мод е, че потребител може да съобщава за лоши постове. Проблемът обаче е, че аз имам един доста по-стабилен и добър мод, който върши същото и за съжаление изисква абсолютно същата таблица, каквато и мода Democracy. Следователно не мога да кача мода Democracy освен ако не променя името на таблицата. За мен е важно да кача този мод и да го тествам още днес, затова ви моля за помощ. Въпросът ми е, трябва ли да се промени само POST_REPORTS_TABLE (от кода по-долу) или трябва да бъдат променени повече неща. Аз например искам таблицата да не се казва POST_REPORTS, а REPORTS2.
Това е инсталационния код по-долу. Благодаря ви предварително!
Това е инсталационния код по-долу. Благодаря ви предварително!
Код:
####################################################################################################
## MOD Title: Democracy MOD
## MOD Author: Carbofos < carbofos@mail.ru > (N/A) N/A
## MOD Author: ETZel < etzel@mail.ru > (N/A) N/A
## MOD Description: Adds some social mechanisms to the phpBB (namely: warnings + reputation + reports)
## MOD Version: 0.2.0
##
## Installation Level: Intermediate
## Installation Time: 30 Minutes
## Files To Edit (17):
## index.php
## posting.php
## profile.php
## viewtopic.php
## admin/admin_db_utilities.php
## includes/constants.php
## includes/functions_post.php
## includes/functions_admin.php
## includes/functions.php
## includes/page_header.php
## includes/usercp_viewprofile.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/subSilver.cfg
## templates/subSilver/index_body.tpl
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/viewtopic_body.tpl
##
## Included Files (22):
## post_report.php
## reputation.php
## admin/admin_democracy.php
## includes/functions_reputation.php
## includes/usercp_reputation.php
## language/lang_english/email/reputation_ban.tpl
## language/lang_english/email/reputation_warning.tpl
## templates/subSilver/modcp_reports_body.tpl
## templates/subSilver/profile_modify_reputation.tpl
## templates/subSilver/profile_view_reputation.tpl
## templates/subSilver/profile_warning.tpl
## templates/subSilver/admin/reputation_body.tpl
## templates/subSilver/images/icon_ban.gif
## templates/subSilver/images/icon_edit_small.gif
## templates/subSilver/images/icon_lock_small.gif
## templates/subSilver/images/icon_red.gif
## templates/subSilver/images/icon_report.gif
## templates/subSilver/images/icon_warning.gif
## templates/subSilver/images/icon_yellow.gif
## templates/subSilver/images/thumb_dn.gif
## templates/subSilver/images/thumb_up.gif
## templates/subSilver/images/lang_english/icon_reviews.gif
##
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2
####################################################################################################
##
## 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:
## This MOD adds some of the "democracy" features to phpBB such as "reputation system" and
## "warnings system" as well as some minor features to help board administration to keep
## board in order.
## Please note that both of these systems are subjective, because it wasn't my goal to build
## an ideal society (has anybody succeeded in this anyway?) so it'll be as objective as board
## administration will want it to be, just like in real life, heh ;)
## A short description:
## - Every user now has a so-called reputation, measured in a number
## - The reason a user might get a reputation point (or lose it) are his/her posts
## - User has to review one of the posts to add or substract one point to post author's reputation
## - User can review a post only once and (by default) won't be able to edit the review later
## - It's up on the board administration to add review requirements (how objective it has to be) to board rules
## - If a user feels some post (or review) is breaking a board rule he/she can notify officials using a special button
## - Moderators and administrators can view such reports via a special page and take actions directly from there
## - These actions include editing or deleting post or review, locking topic, issuing a warning or banning a user
## - Same actions can be done by moderators directly from the topic
## - A post (by default) becomes locked after moderator or administrator has edited it
## - Warnings and bans work the same way as reviews - a reason should be stated
## - Warnings and even bans can expire over time
## - Admin can choose whether expired warnings and bans are deleted or kept as expired
## - After gaining certain amount of non-expired warnings user gets automatically banned (turned on by default)
## - Administrators and moderators are considered one team, so the warnings system is not applied to them
## - Username which has the most reputation is displayed in Who is Online box
##
## Language packs are distributed as separate mods, see translations/ folder.
##
####################################################################################################
##
## MOD History:
##
## ????-??-?? - Version 0.0.9x
## - Few prebeta versions
## ????-??-?? - Version 0.1.0
## - First beta version
## ????-??-?? - Version 0.1.1
## - New feature: bans can also expire over time (setup in ACP separately from warnings expire)
## - Catched a few minor bugs
## 2005-12-03 - Version 0.1.2
## - Fixed a bug introduced in version 0.1.1 (forgot to add a little string to constants.php...)
## - Added feature I forgot to add earlier: delete user reports :)
## - When you delete post or review that was reported, the report is now deleted too
## - Some minor improvements
## 2006-01-07 - Version 0.1.3
## - Fixed bug that made all user's warnings expired
## - Report post button now appears properly
## - Fixed some bugs in templates
## - Added option to view bans/warnings and reviews separately
## - Added compatibility with Global Moderator Mod and User Level Mod (beta support)
## - Some more minor code improvements
## 2006-01-17 - Version 0.1.4
## - Fixed LOTS of bugs
## - Added MOD's tables to db_utilities tables list
## - Removed compatibility with Global Moderator Mod and User Level Mod (will be later as add-ons)
## 2006-07-18 - Version 0.2.0
## - New permissions system, much more flexible
## - An option to show the least respected users list on index in addition to the most respected.
## - Post warnigns are now displayed in-line
## - Rich set of restrictions on who can change reputation and when
## - An important "positive reputation only" mode
##
####################################################################################################
##
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##
####################################################################################################
#
#-----------------------[ COPY ]-------------------------
#
copy root/post_report.php to post_report.php
copy root/reputation.php to reputation.php
copy root/admin/admin_democracy.php to admin/admin_democracy.php
copy root/includes/functions_reputation.php to includes/functions_reputation.php
copy root/includes/usercp_reputation.php to includes/usercp_reputation.php
copy root/language/lang_english/email/reputation_ban.tpl to language/lang_english/email/reputation_ban.tpl
copy root/language/lang_english/email/reputation_warning.tpl to language/lang_english/email/reputation_warning.tpl
copy root/templates/subSilver/modcp_reports_body.tpl to templates/subSilver/modcp_reports_body.tpl
copy root/templates/subSilver/profile_modify_reputation.tpl to templates/subSilver/profile_modify_reputation.tpl
copy root/templates/subSilver/profile_view_reputation.tpl to templates/subSilver/profile_view_reputation.tpl
copy root/templates/subSilver/profile_warning.tpl to templates/subSilver/profile_warning.tpl
copy root/templates/subSilver/admin/reputation_body.tpl to templates/subSilver/admin/reputation_body.tpl
copy root/templates/subSilver/images/icon_edit_small.gif to templates/subSilver/images/icon_edit_small.gif
copy root/templates/subSilver/images/icon_lock_small.gif to templates/subSilver/images/icon_lock_small.gif
copy root/templates/subSilver/images/icon_red.gif to templates/subSilver/images/icon_red.gif
copy root/templates/subSilver/images/icon_report.gif to templates/subSilver/images/icon_report.gif
copy root/templates/subSilver/images/icon_warning.gif to templates/subSilver/images/icon_warning.gif
copy root/templates/subSilver/images/icon_yellow.gif to templates/subSilver/images/icon_yellow.gif
copy root/templates/subSilver/images/thumb_dn.gif to templates/subSilver/images/thumb_dn.gif
copy root/templates/subSilver/images/thumb_up.gif to templates/subSilver/images/thumb_up.gif
copy root/templates/subSilver/images/lang_english/icon_reviews.gif to templates/subSilver/images/lang_english/icon_reviews.gif
#
#------------------------[ SQL ]-------------------------
#
CREATE TABLE `phpbb_reputation` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`modification` tinyint(1) NOT NULL default '0',
`user_id` mediumint(8) NOT NULL default '0',
`voter_id` mediumint(8) NOT NULL default '0',
`post_id` mediumint(8) NOT NULL default '-1',
`forum_id` smallint(5) NOT NULL default '-1',
`poster_ip` char(8) NOT NULL default '',
`date` int(11) default NULL,
`expire` int(11) default NULL,
`edit_time` int(11) default NULL,
`edit_count` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `voter_id` (`voter_id`),
KEY `post_id` (`post_id`),
KEY `date` (`date`),
KEY `expire` (`expire`)
);
CREATE TABLE `phpbb_reputation_text` (
`id` mediumint(8) unsigned NOT NULL default '0',
`text` text,
`bbcode_uid` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
);
CREATE TABLE `phpbb_post_reports` (
`report_id` mediumint(8) NOT NULL auto_increment,
`post_id` mediumint(8) NOT NULL default '-1',
`review_id` mediumint(8) NOT NULL default '-1',
`forum_id` mediumint(9) NOT NULL default '-1',
`user_id` mediumint(8) NOT NULL default '0',
`report_time` int(11) NOT NULL default '0',
`reports_num` mediumint(8) NOT NULL default '0',
PRIMARY KEY (`report_id`),
KEY `post_id` (`post_id`),
KEY `review_id` (`review_id`),
KEY `forum_id` (`forum_id`)
);
ALTER TABLE `phpbb_users` ADD `user_reputation` smallint(8) NOT NULL default '0';
ALTER TABLE `phpbb_users` ADD `user_reputation_plus` smallint(8) NOT NULL default '0';
ALTER TABLE `phpbb_users` ADD `user_warnings` tinyint(4) unsigned NOT NULL default '0';
ALTER TABLE `phpbb_posts` ADD `post_reviews` smallint(8) unsigned NOT NULL default '0';
ALTER TABLE `phpbb_posts` ADD `post_locked` tinyint(1) unsigned NOT NULL default '0';
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES
('warnings_enabled', '1'),
('reputation_enabled', '1'),
('reports_enabled', '1'),
('reputation_least_respected', '0'),
('reputation_ban_warnings', '5'),
('reputation_delete_expired', '-1'),
('reputation_warning_expire', '3,30'),
('reputation_ban_expire', '3,30'),
('reputation_perms', '0,0,1,3,3,3,3,5,3,5,3,3,3'),
('reputation_none', '0,0'),
('reputation_mod_norep', '0'),
('reputation_reviews_per_page', '25'),
('reputation_reports_per_page', '25'),
('reputation_display', '1'),
('reputation_most_respected', '1'),
('reputation_days_req', '0'),
('reputation_posts_req', '0'),
('reputation_points_req', '-100000'),
('reputation_warnings_req', '100000'),
('reputation_rotation_limit', '0'),
('reputation_time_limit', '0'),
('reputation_check_rate', '60'),
('reputation_last_check_time', '1152884749'),
('reputation_empty_reviews', '0'),
('reputation_positive_only', '0'),
('reputation_check_reports', '1'),
('reputation_reports_color', ''),
('reputation_admin_norep', '0');
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
$newest_uid = $newest_userdata['user_id'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
//////////democracy///////////////////////////////
//
// Get user(s) with the most reputation points
//
$s_most_respected_users = $s_least_respected_users = $u_reported_posts = '';
if ($board_config['reputation_enabled'] && ($board_config['reputation_most_respected'] || $board_config['reputation_least_respected']))
{
include_once($phpbb_root_path . 'includes/functions_reputation.' . $phpEx);
function reputation_user_list($cond, &$user_list)
{
global $db, $phpEx, $theme;
$user_list = ''; $user_count = 0;
$result = db_query('SELECT username, user_id, user_level, user_reputation FROM {USERS_TABLE}
WHERE user_id <> {ANONYMOUS} AND ' . $cond);
while ($row = $db->sql_fetchrow($result))
{
switch ($row['user_level'])
{
case ADMIN:
$style_color = ' style="color: #' . $theme['fontcolor3'] . '"';
break;
case MOD:
$style_color = ' style="color: #' . $theme['fontcolor2'] . '"';
break;
default:
$style_color = '';
}
// NOTE: this string will be cached, so session ids will be added later
$user_list .= '<b><a href="profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $row['user_id'] . "\"$style_color>" . $row['username'] . '</a></b>, ';
++$user_count;
}
$user_list = substr($user_list, 0, -2);
return $user_count;
}
if (!($rep_cache = cache_get(RESPECTED_CACHE)))
{
$rep_cache = array('num_most_respected' => 0, 'num_least_respected' => 0, 'most_respected' => '', 'least_respected' => '');
if ($board_config['reputation_most_respected'])
{
$result = db_query('SELECT user_reputation FROM {USERS_TABLE} GROUP BY user_reputation ORDER BY user_reputation DESC LIMIT %d', $board_config['reputation_most_respected']);
$reputation = 0;
while (($row = $db->sql_fetchrow($result)) && $row['user_reputation'] > 0)
{
$reputation = $row['user_reputation'];
}
if ($reputation && ($rep_cache['num_most_respected'] = reputation_user_list('user_reputation >= ' . $reputation . ' ORDER BY user_reputation DESC', $rep_list)))
{
$rep_cache['most_respected'] = $rep_list;
}
}
if ($board_config['reputation_least_respected'] && !$board_config['reputation_positive_only'])
{
$result = db_query('SELECT user_reputation FROM {USERS_TABLE} GROUP BY user_reputation ORDER BY user_reputation ASC LIMIT %d', $board_config['reputation_least_respected']);
$reputation = 0;
while (($row = $db->sql_fetchrow($result)) && $row['user_reputation'] < 0)
{
$reputation = $row['user_reputation'];
}
if ($reputation && ($rep_cache['num_least_respected'] = reputation_user_list('user_reputation <= ' . $reputation . ' ORDER BY user_reputation ASC', $rep_list)))
{
$rep_cache['least_respected'] = $rep_list;
}
}
cache_set(RESPECTED_CACHE, $rep_cache);
}
if (!empty($SID))
{
// add session ids to urls (quick and dirty)
$rep_cache['most_respected'] = str_replace('?', "?$SID&", $rep_cache['most_respected']);
$rep_cache['least_respected'] = str_replace('?', "?$SID&", $rep_cache['least_respected']); // patch urls to preserve session
// NOTE: code for custom append_sid
// $rep_cache['respected'] = preg_replace('#(?<=href=")([^"]+)#se', 'append_sid(\'\1\')', $rep_cache['respected']);
}
if ($rep_cache['num_most_respected'])
{
$s_most_respected_users = '<br />' . (($rep_cache['num_most_respected'] == 1) ? $lang['reputation_most_respected_user'] : $lang['reputation_most_respected_users']) . $rep_cache['most_respected'];
}
if ($rep_cache['num_least_respected'])
{
$s_least_respected_users = '<br />' . (($rep_cache['num_least_respected'] == 1) ? $lang['reputation_least_respected_user'] : $lang['reputation_least_respected_users']) . $rep_cache['least_respected'];
}
}
//
// Make a link to reported posts (for authorized ppl only)
//
if ($board_config['reports_enabled'] && ($userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD))
{
include_once($phpbb_root_path . 'includes/functions_reputation.' . $phpEx);
if ($userdata['user_level'] != ADMIN)
{
$forums_auth = reputation_auth(AUTH_LIST_ALL, $userdata);
$forums_sql = '';
foreach ($forums_auth as $forum_id => $is_auth)
{
if ($is_auth['auth_mod'])
{
$forums_sql .= ($forums_sql ? ',' : '') . $forum_id;
}
}
$forums_sql = "WHERE forum_id IN($forums_sql)";
unset($forum_id);
}
else
{
$forums_sql = '';
}
//
// Get reports count
//
$result = db_query('SELECT COUNT(report_id) AS num_reports FROM {POST_REPORTS_TABLE} ' . $forums_sql);
$total_post_reports = ($row = $db->sql_fetchrow($result)) ? ('<b>' . $row['num_reports'] . '</b>') : '0';
$link_color = '';
$l_reported_posts = sprintf($lang['reputation_reported_posts'], $total_post_reports);
if ($board_config['reputation_reports_color'] && $total_post_reports)
{
$link_color = ' style="color: #' . $board_config['reputation_reports_color'] . '"';
}
$u_reported_posts = '<a href="' . append_sid("post_report.$phpEx?mode=view") . '" class="gensmall"' . $link_color . '>' . $l_reported_posts . '</a><br />';
}
///////////////////////////////////////////////
#
#-----[ FIND ]------------------------------------------
#
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$is_auth_ary = isset($forums_auth) ? $forums_auth : auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
#
#-----[ FIND ]------------------------------------------
#
'FORUM_LOCKED_IMG' => $images['forum_locked'],
'L_FORUM' => $lang['Forum'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
////////////////democracy//////////////////////
'MOST_RESPECTED_USERS' => $s_most_respected_users,
'LEAST_RESPECTED_USERS' => $s_least_respected_users,
'U_VIEW_REPORTED' => $u_reported_posts,
///////////////////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT f.*, t.topic_id, t.topic_status,
#
#-----[ IN-LINE FIND ]------------------------------------------
#
p.poster_id
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, p.post_locked
#
#-----[ FIND ]------------------------------------------
#
//
// The user is not authed, if they're not logged in then redirect
#
#-----[ BEFORE, ADD ]------------------------------------------
#
////democracy/////
if ( $post_info['post_locked'] == 1 && !$is_auth['auth_mod'] )
{
message_die(GENERAL_MESSAGE, $lang['Post_locked'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'));
}
/////////////
#
#-----[ FIND ]------------------------------------------
#
case 'newtopic':
case 'reply':
$username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : '';
#
#-----[ BEFORE, ADD ]------------------------------------------
#
////////////democracy/////
if ( $post_data['poster_id'] != $userdata['user_id'] )
{
$post_data['post_locked'] = ( !empty($HTTP_POST_VARS['lock_post']) ? 1 : 0 );
}
//////////////////////
#
#-----[ FIND ]------------------------------------------
#
//
// Delete selection
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
/////democracy///////
//
// Lock selection
//
if ( $mode == 'editpost' && $post_data['poster_id'] != $userdata['user_id'] && $is_auth['auth_mod'] )
{
$template->assign_block_vars('switch_lock_checkbox', array());
}
/////////////
#
#-----[ FIND ]------------------------------------------
#
'L_DELETE_POST' => $lang['Delete_post'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_LOCK_POST' => $lang['reputation_lock_post'], /* /////democracy//////// */
#
#-----[ OPEN ]------------------------------------------
#
profile.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
exit;
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//////////democracy/////////////////
else if ( $mode == 'reputation' || $mode == 'given' || $mode == 'warnings' || $mode == 'expired' )
{
include($phpbb_root_path . 'includes/usercp_reputation.'.$phpEx);
exit;
}
/////////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
#
#-----[ IN-LINE FIND ]------------------------------------------
#
pt.post_subject, pt.bbcode_uid
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, u.user_reputation, u.user_reputation_plus, u.user_warnings, u.user_level
#
#-----[ FIND ]------------------------------------------
#
$postrow = array();
if ($row = $db->sql_fetchrow($result))
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
$post_ids = $row['post_id'];
#
#-----[ FIND ]------------------------------------------
#
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$post_ids .= ',' . $row['post_id'];
#
#-----[ FIND ]------------------------------------------
#
}
$db->sql_freeresult($result);
#
#-----[ AFTER, ADD ]------------------------------------------
#
////////////democracy/////////////
if ($board_config['warnings_enabled'] || $board_config['reputation_enabled'])
{
include($phpbb_root_path . 'includes/functions_reputation.' . $phpEx);
$is_auth = reputation_auth($is_auth, $userdata);
if ($board_config['warnings_enabled'])
{
$result = db_query('SELECT ban_userid FROM {BANLIST_TABLE}');
while ($row = $db->sql_fetchrow($result))
{
$banned[$row['ban_userid']] = true;
}
$result = db_query('SELECT r.*, rt.*, u.username FROM {REPUTATION_TABLE} r, {REPUTATION_TEXT_TABLE} rt, {USERS_TABLE} u
WHERE r.post_id IN (%s)
AND r.modification IN ({REPUTATION_WARNING},{REPUTATION_BAN},{REPUTATION_WARNING_EXPIRED},{REPUTATION_BAN_EXPIRED})
AND r.id = rt.id
AND r.voter_id = u.user_id', $post_ids);
while ($row = $db->sql_fetchrow($result))
{
$post_warnings[$row['post_id']] = $row;
}
}
}
/////////////////////////////////
#
#-----[ FIND ]------------------------------------------
#
'L_GOTO_PAGE' => $lang['Goto_page'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_REASON' => $lang['reputation_reason'],
#
#-----[ FIND ]------------------------------------------
#
if ( $poster_id != ANONYMOUS )
{
$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");
#
#-----[ BEFORE, ADD ]------------------------------------------
#
///////////democracy////////////////
$user_warnings = $user_reputation = $reviews_img = $reviews = $ban_img = $ban = $warn_img = $warn = $ban_img = $ban = $reportpost_img = $reportpost = '';
////////////////////////////////
#
#-----[ FIND ]------------------------------------------
#
$yim = ( $postrow[$i]['user_yim'] ) ? '<a href="
#
#-----[ AFTER, ADD ]------------------------------------------
#
/////////////democracy////////////////////
if ($board_config['reputation_enabled'])
{
$personal_auth = reputation_auth($is_auth, $userdata, $postrow[$i], true);
$user_reputation = reputation_display($postrow[$i], $personal_auth, true);
if ($postrow[$i]['post_reviews'])
{
$temp_url = append_sid("profile.$phpEx?mode=reputation&" . POST_POST_URL . '=' . $postrow[$i]['post_id']);
$post_reviews = sprintf($lang['reputation_view_reviews'], $postrow[$i]['post_reviews']);
$reviews_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_reviews'] . '" alt="' . $post_reviews . '" title="' . $post_reviews . '" border="0" /></a>';
$reviews = '<a href="' . $temp_url . '" title="' . $post_reviews . '">' . $lang['Reviews'] . '</a>';
}
}
if ($board_config['warnings_enabled'])
{
$personal_auth = reputation_auth($is_auth, $userdata, $postrow[$i], true);
$user_warnings = reputation_warnings($postrow[$i], !empty($banned[$poster_id]), $personal_auth);
if (!isset($post_warnings[$postrow[$i]['post_id']]))
{
if ($personal_auth['auth_warn'])
{
$temp_url = "reputation.$phpEx?mode=warning&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
$warn_img = '<a href="' . $temp_url . '"><img src="' . $images['warn_user'] . '" alt="' . $lang['reputation_warn_user'] . '" title="' . $lang['reputation_warn_user'] . '" border="0" /></a>';
$warn = '<a href="' . $temp_url . '">' . $lang['reputation_warn'] . '</a>';
}
if ($personal_auth['auth_ban'])
{
$temp_url = "reputation.$phpEx?mode=ban&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
$ban_img = '<a href="' . $temp_url . '"><img src="' . $images['ban_user'] . '" alt="' . $lang['reputation_ban_user'] . '" title="' . $lang['reputation_ban_user'] . '" border="0" /></a>';
$ban = '<a href="' . $temp_url . '">' . $lang['reputation_ban'] . '</a>';
}
}
}
/////////////////////////////////////////
#
#-----[ FIND ]------------------------------------------
#
}
$post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : '';
#
#-----[ BEFORE, ADD ]------------------------------------------
#
/////////////democracy////////////////////
if ($board_config['reports_enabled'])
{
if ($userdata['user_id'] != ANONYMOUS)
{
$temp_url = "post_report.$phpEx?mode=report&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
$reportpost_img = '<a href="' . $temp_url . '"><img src="' . $images['report_post'] . '" alt="' . $lang['reputation_report_post'] . '" title="' . $lang['reputation_report_post'] . '" border="0" /></a>';
$reportpost = '<a href="' . $temp_url . '">' . $lang['reputation_report_post'] . '</a>';
}
}
///////////////////////////////////////////
#
#-----[ FIND ]------------------------------------------
#
'EDITED_MESSAGE' => $l_edited_by,
#
#-----[ AFTER, ADD ]------------------------------------------
#
//////////democracy/////////
'POSTER_REPUTATION' => $user_reputation,
'POSTER_WARNINGS' => $user_warnings,
'REPORTPOST' => $reportpost,
'REPORTPOST_IMG' => $reportpost_img,
'RED' => $ban,
'RED_IMG' => $ban_img,
'YELLOW' => $warn,
'YELLOW_IMG' => $warn_img,
'REVIEWS' => $reviews,
'REVIEWS_IMG' => $reviews_img,
////////////////////////////
#
#-----[ FIND ]------------------------------------------
#
'U_MINI_POST' => $mini_post_url,
'U_POST_ID' => $postrow[$i]['post_id'])
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if (isset($post_warnings[$postrow[$i]['post_id']]))
{
$template->assign_block_vars('postrow.warning', reputation_warning_tpl($post_warnings[$postrow[$i]['post_id']]));
}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_db_utilities.php
#
#-----[ FIND ]------------------------------------------
#
$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm', 'sessions_keys');
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'sessions_keys'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'reputation', 'reputation_text', 'post_reports'
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
#
#-----[ AFTER, ADD ]------------------------------------------
#
///////////////democracy/////////////////////
define('REPUTATION_TABLE', $table_prefix.'reputation');
define('REPUTATION_TEXT_TABLE', $table_prefix.'reputation_text');
define('POST_REPORTS_TABLE', $table_prefix.'post_reports');
// reputation modifications
define('REPUTATION_INC', 1);
define('REPUTATION_DEC', 2);
define('REPUTATION_WARNING', 3);
define('REPUTATION_BAN', 4);
define('REPUTATION_WARNING_EXPIRED', 7);
define('REPUTATION_BAN_EXPIRED', 8);
// display modes (more to come)
define('REPUTATION_SUM', 0);
define('REPUTATION_PLUSMINUS', 1);
define('POST_REVIEWS_URL', 'r');
define('RESPECTED_CACHE', 'respected.dat');
define('NO_ID', -1);
////////////////////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
exit;
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
/////////////democracy////////
/**
* This is sprintf-like $db->sql_query() wrapper with automatic constants and variables substitution.
* Idea and some code are borrowed from drupal.
* Example:
* $result = db_query('SELECT * FROM {POSTS_TABLE} WHERE id = %d OR name LIKE \'%s\'', 10, '\\StupidUserName/');
*
* @return resource Database query result
*/
function db_query($sql)
{
global $db;
$sql = preg_replace_callback('#{(\w+)}#', 'const_subst', $sql); // substitute constants
if (func_num_args() > 1)
{
$args = func_get_args();
$args = array_map('addslashes', $args);
$args[0] = $sql;
$sql = call_user_func_array('sprintf', $args);
}
if ($result = $db->sql_query($sql))
{
return $result;
}
else
{
message_die(GENERAL_ERROR, 'SQL query failed', '', __LINE__, __FILE__, $sql);
}
}
/**
* Used in db_query with preg_replace_callback to avoid dynamic code.
* @access private
*/
function const_subst($match)
{
return constant($match[1]);
}
/**
* Begins or ends transaction
* @param integer $command Specify BEGIN_TRANSACTION or END_TRANASCTION
*/
function db_transaction($command)
{
global $db;
$db->sql_query('SELECT 0', $command); // DBAL requires non-empty query to issue transaction command.
}
//////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_admin.php
#
#-----[ FIND ]------------------------------------------
#
{
message_die(GENERAL_ERROR, 'Could not update forum', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
/////////democracy///////////////
global $board_config;
if ($board_config['reputation_enabled'] || $board_config['warnings_enabled'])
{
$result = db_query('SELECT r.id, r.forum_id AS review_forum_id, p.post_id, p.forum_id AS post_forum_id
FROM {REPUTATION_TABLE} r LEFT JOIN {POSTS_TABLE} p ON r.post_id = p.post_id
WHERE r.forum_id = %d
AND (p.forum_id <> r.forum_id OR (r.post_id <> {NO_ID} AND p.post_id IS NULL))', $id);
$no_post = ''; $wrong_forum = array();
while ($row = $db->sql_fetchrow($result))
{
if (!$row['post_id'])
{
$no_post .= ($no_post ? ',' : '') . $row['id'];
}
elseif ($row['review_forum_id'] != $row['post_forum_id'])
{
if (isset($wrong_forum[$row['post_forum_id']]))
{
$wrong_forum[$row['post_forum_id']] .= ',' . $row['id'];
}
else
{
$wrong_forum[$row['post_forum_id']] = $row['id'];
}
}
}
if ($no_post)
{
db_query('UPDATE {REPUTATION_TABLE} SET post_id = {NO_ID} WHERE id IN(%s)', $no_post);
}
foreach ($wrong_forum as $forum_id => $review_ids)
{
db_query('UPDATE {REPUTATION_TABLE} SET forum_id = %d WHERE id IN(%s)', $forum_id, $review_ids);
}
}
/////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));
#
#-----[ BEFORE, ADD ]------------------------------------------
#
////democracy/////
if ($mode == 'editpost' && $post_data['poster_id'] != $userdata['user_id'])
{
db_query('UPDATE {POSTS_TABLE} SET post_locked = %d WHERE post_id = %d', $post_data['post_locked'], $post_id);
}
/////////////
#
#-----[ FIND ]------------------------------------------
#
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
/////////democracy///////////////
db_query('UPDATE {REPUTATION_TABLE} SET post_id = {NO_ID} WHERE post_id = %d', $post_id);
db_query('DELETE FROM {POST_REPORTS_TABLE} WHERE post_id = %d', $post_id);
////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//////////////////democracy///////////////////////////////////
//
// Check for expired warnings and bans
//
$current_time = time();
if ($board_config['reputation_last_check_time'] + $board_config['reputation_check_rate'] * 60 < $current_time)
{
if ($board_config['reputation_delete_expired'] != -1)
{
$delete_time = $current_time - $board_config['reputation_delete_expired'] * 86400;
// switch (SQL_LAYER)
// {
// case 'mysql4':
// db_query('DELETE r, rt FROM {REPUTATION_TABLE} r, {REPUTATION_TEXT_TABLE} rt
// WHERE r.id = rt.id
// AND (r.modification = {REPUTATION_WARNING_EXPIRED} OR r.modification = {REPUTATION_BAN_EXPIRED})
// AND r.expire < %d', $delete_time); // QUESTION: expire value storage
// break;
// default:
$result = db_query('SELECT id
FROM {REPUTATION_TABLE}
WHERE (modification = {REPUTATION_WARNING_EXPIRED} OR modification = {REPUTATION_BAN_EXPIRED})
AND expire < %d', $delete_time);
$in_sql = '';
while ($row = $db->sql_fetchrow($result))
{
$in_sql .= ($in_sql ? ',' : '') . $row['id'];
}
if ($in_sql)
{
db_query('DELETE FROM {REPUTATION_TABLE}
WHERE id IN (' . $in_sql . ')');
db_query('DELETE FROM {REPUTATION_TEXT_TABLE}
WHERE id IN (' . $in_sql . ')');
}
// break;
// }
}
else
{
$delete_time = -1;
}
$result = db_query('SELECT id, user_id, modification FROM {REPUTATION_TABLE}
WHERE (modification = {REPUTATION_WARNING} OR modification = {REPUTATION_BAN})
AND expire < %d', $current_time);
while ($row = $db->sql_fetchrow($result))
{
if ($delete_time != -1 && $row['expire'] < $delete_time)
{
db_query('DELETE FROM {REPUTATION_TABLE} WHERE id = ' . $row['id']);
db_query('DELETE FROM {REPUTATION_TEXT_TABLE} WHERE id = ' . $row['id']);
}
else
{
$set = ($row['modification'] == REPUTATION_WARNING) ? REPUTATION_WARNING_EXPIRED : REPUTATION_BAN_EXPIRED;
db_query('UPDATE {REPUTATION_TABLE} SET modification = %d WHERE id = %d', $set, $row['id']);
}
if ($row['modification'] == REPUTATION_BAN)
{
db_query('DELETE FROM {BANLIST_TABLE} WHERE ban_userid = %d', $row['user_id']);
}
db_query('UPDATE {USERS_TABLE} SET user_warnings = user_warnings - 1 WHERE user_id = %d', $row['user_id']);
}
db_query('UPDATE {CONFIG_TABLE} SET config_value = %d WHERE config_name = \'reputation_last_check_time\'', $current_time);
}
/////////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$u_search_author = urlencode(str_replace(array(
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
/////democracy///////////////////
if ($board_config['warnings_enabled'] || $board_config['reputation_enabled'])
{
include($phpbb_root_path . 'includes/functions_reputation.' . $phpEx);
$is_auth = reputation_auth(NO_ID, $userdata, $profiledata);
if ($board_config['warnings_enabled'] && !$is_auth['no_warn'])
{
$warn_img = $warn = $ban_img = $ban = '';
if ($is_auth['auth_warn'])
{
$temp_url = "reputation.$phpEx?mode=warning&" . POST_USERS_URL . "=" . $profiledata['user_id'] . "&sid=" . $userdata['session_id'];
$warn_img = '<a href="' . $temp_url . '"><img src="' . $images['warn_user'] . '" alt="' . $lang['reputation_warn_user'] . '" title="' . $lang['reputation_warn_user'] . '" border="0" /></a>';
$warn = '<a href="' . $temp_url . '">' . $lang['reputation_warn'] . '</a>';
}
if ($is_auth['auth_ban'])
{
$temp_url = "reputation.$phpEx?mode=ban&" . POST_USERS_URL . "=" . $profiledata['user_id'] . "&sid=" . $userdata['session_id'];
$ban_img = '<a href="' . $temp_url . '"><img src="' . $images['ban_user'] . '" alt="' . $lang['reputation_ban_user'] . '" title="' . $lang['reputation_ban_user'] . '" border="0" /></a>';
$ban = '<a href="' . $temp_url . '">' . $lang['reputation_ban'] . '</a>';
}
$template->assign_block_vars('warnings', array(
'L_WARNINGS' => $lang['Warnings'],
'WARNINGS' => $profiledata['user_warnings'],
'RED' => $ban,
'RED_IMG' => $ban_img,
'YELLOW' => $warn,
'YELLOW_IMG' => $warn_img,
));
if ($is_auth['auth_view_warns'] && $profiledata['user_warnings'])
{
$template->assign_block_vars('warnings.details', array(
'U_SEARCH' => append_sid("profile.$phpEx?mode=warnings&" . POST_USERS_URL . '=' . $profiledata['user_id']),
'L_SEARCH' => sprintf($lang['reputation_search_warnings'], $profiledata['username']),
));
}
}
if ($board_config['reputation_enabled'] && !$is_auth['no_rep'])
{
$template->assign_block_vars('reputation', array(
'L_REPUTATION' => $lang['Reputation'],
'U_VIEW_REPUTATION' => append_sid("profile.$phpEx?mode=reputation&" . POST_USERS_URL . '=' . $profiledata['user_id']),
'REPUTATION' => reputation_display($profiledata, $is_auth, false),
));
if ($is_auth['auth_view_rep'] && ($profiledata['user_reputation'] || $profiledata['user_reputation_plus']))
{
$template->assign_block_vars('reputation.details', array(
'U_SEARCH' => append_sid("profile.$phpEx?mode=reputation&" . POST_USERS_URL . '=' . $profiledata['user_id']),
'L_SEARCH' => sprintf($lang['reputation_search_reputation'], $profiledata['username']),
));
}
}
}
///////////////////////////////////
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Login_reset_time_explain'] =
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Democracy MOD
//
$lang = array(
'reputation_democracy' => 'Democracy',
'reputation_democracy_exp' => 'Democracy combines the features of warnings system, ban manager, karma (reputation) and post reports.',
'reputation_enable' => 'Enable reputation',
'reputation_enable_warnings' => 'Enable warnings and bans',
'reports_enabled' => 'Enable Report Post button',
'reputation_positive_only' => 'Positive reviews only',
'reputation_positive_only_exp' => 'Make only positive reviews possible. Hide (not delete!) negative reviews and do not count them when summing reputation points.',
'reputation_empty_reviews' => 'Allow reviews without comments (make comment field optional)',
'reputation_reputation_options' => 'Reputation options',
'reputation_warnings_options' => 'Warnings options',
'reputation_reports_options' => 'Post report options',
'Click_return_reputation_index' => 'Click %sHere%s to return to Democracy configuration',
'reputation_access_rights' => 'Access rights',
'reputation_add_rep' => 'Change reputation',
'reputation_add_rep_nonpost' => 'Change reputation without referring to a specific post',
'reputation_edit_rep' => 'Edit reputation reviews',
'reputation_delete_rep' => 'Delete reputation reviews',
'reputation_no_limits' => 'Requirements do not apply',
'reputation_warn' => 'Give warnings',
'reputation_warn_nonpost' => 'Give warnings without referring to a specific post',
'reputation_ban' => 'Ban users',
'reputation_ban_nonpost' => 'Ban users without referring to a specific post',
'reputation_edit_warns' => 'Edit warnings and bans',
'reputation_delete_warns' => 'Delete warnings and bans',
'reputation_not_applicable' => 'Don\'t have reputation at all',
'reputation_anonymous_view_rep' => 'Anonymous users can read reviews pages.',
'reputation_anonymous_view_warns' => 'Anonymous users can read warnings and bans pages.',
'reputation_perms_notes' => '* = only his/her own<br />** = only in the forums where he/she is moderator.',
'reputation_warn_perms_notes' => '* = only in the forums where he/she is moderator.',
'reputation_days_req' => 'At least %s days of registration.',
'reputation_posts_req' => 'At least %s posts.',
'reputation_warnings_req' => 'At most %s unexpired warnings.',
'reputation_points_req' => 'At least %s reputation points.',
'reputation_time_limit' => 'User cannot change reputation of the same member more than once in %s minutes.',
'reputation_rotation_limit' => 'Reputation user spread: %s users.',
'reputation_rotation_limit_exp' => 'This setting dictates how many unique members that a user must rate before they are able to rate the same member twice.',
'reputation_most_respected' => 'Show %s most respected users.',
'reputation_least_respected' => 'Show %s least respected users.',
'reputation_display' => 'Reputation display',
'reputation_display_sum' => 'Single number (sum)',
'reputation_display_plusminus' => 'Positive and negative separated (+2/-3)',
'reputation_infinite' => 'Infinite',
'reputation_infinite_exp' => 'Moderators should expire or delete warnings manually.',
'reputation_infinite_ban_exp' => 'Moderators should expire or delete bans manually.',
'reputation_fixed' => 'Fixed: %s days.',
'reputation_modifiable' => 'Can be chosen by moderator between %s and %s days.',
'reputation_modifiable_exp' => 'Leave the fields blank not to put restrictions.',
'reputation_store' => 'Mark as expired and store',
'reputation_delete_days' => 'Mark as expired and delete after %s days.',
'reputation_ban_warnings' => 'Users will get banned after receiving %s active warnings.',
'reputation_ban_warnings_exp' => 'When this option is enabled, the last warning will just turn into ban.',
'reputation_check_rate' => 'Expired warnings and bans check rate: %s minutes.',
'reputation_check_rate_exp' => 'Manipulate delay between checkups to reduce the workload.',
'reputation_check_confirm' => 'Please confirm your intention to change settings by checking the appropriate checkbox!',
'reputation_reports_color' => 'Color used to distinguish the link to reports page:',
'reputation_reports_color_exp' => 'If there are any reports. Leave blank if you don\'t want the link to have different color.',
'reputation_warning_expiry' => 'Warnings expiration',
'reputation_ban_expiry' => 'Bans expiration',
'reputation_expired_warnings' => 'Expired warnings and bans',
'reputation_index_page' => 'Index page',
'reputation_prerequirements' => 'Requirements to the user changing reputation',
'reputation_limits' => 'Other requirements',
'reputation_maintenance' => 'Maintenance',
'reputation_resync' => 'Ensure data integrity between users, posts and reputation table.',
'reputation_resync_exp' => 'Use this when user\'s reputation or warnings don\'t match actual number of reviews.',
'reputation_success' => 'Operation completed successfully.',
/*
'reputation_reports_per_page' => 'Reports per page',
'reputation_reviews_per_page' => 'Reputation reviews per page',
'reputation_allow_empty_warns' => 'Allow warnings without the reason specified.',
*/
) + $lang;
//
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Please_remove_install_contrib'] =
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Democracy MOD
//
$lang = array(
// general & misc
'Reputation' => 'Reputation',
'Warnings' => 'Warnings',
'Warning' => 'Warning',
'reputation_display' => 'Display',
'reputation_banned_permanently' => 'Banned permanently',
// index page
'reputation_reported_posts' => 'Posts reported by users: %s',
'reputation_most_respected_user' => 'Our most respected user is ',
'reputation_most_respected_users' => 'Our most respected users are ',
'reputation_least_respected_user' => 'Our least respected user is ',
'reputation_least_respected_users' => 'Our least respected users are ',
// viewing reviews
'New_warning' => 'New warning',
'New_review' => 'New review',
'Post_Reports' => 'Post Reports',
'Review' => 'Review',
'Official' => 'Review', // i.e. Moderator
'reputation_of' => 'Reputation of %s',
'reputation_warnings_to' => 'Warnings given to %s',
'reputation_warnings_expired' => 'Expired warnings given to %s',
'reputation_display_expired' => 'Show expired warnings',
'reputation_post_ref' => 'Post reference',
'reputation_post_reviews' => 'Post reviews',
'reputation_post_deleted' => 'Deleted',
'reputation_total' => 'Total',
'reputation_issued' => 'Issued',
'Edit' => 'Edit',
'reputation_edit_review' => 'Edit review',
'reputation_delete_review' => 'Delete review',
// viewing reports
'reputation_actions' => 'Actions',
'reputation_order_by' => 'Order by',
'reputation_post_peports_exp' => 'Using the form below you can check out posts and reviews reported by users and perform actions on them.<br />Hint: After you resolve the report delete it to prevent other moderators from taking same actions as you did once more :)',
'reputation_report_date' => 'Report date',
'reputation_reports_number' => 'Reports number',
'reputation_first_reported' => 'First reported by',
'reputation_confirm_report' => 'Are you sure you want to report this post to moderator(s)?',
'reputation_confirm_report2' => 'Are you sure you want to report this review to moderator(s)?',
'reputation_report_deleted' => 'The report has been deleted.',
'reputation_report_success' => 'The officials have been informed',
'reputation_reviewed' => 'Reviewed', // TODO: replace
// viewing profile
'reputation_search_given' => 'Find all reviews written by %s',
'reputation_search_reputation' => 'Find all reviews given to %s',
'reputation_search_warnings' => 'Find all warnings given to %s',
// viewing posts (+some general buttons)
'Reviews' => 'Reviews',
'reputation_view_reviews' => 'This post has %s review(s)',
'reputation_post_warning' => 'Warned by %s on %s. Expires: %s',
'reputation_post_ban' => 'Banned by %s at %s. Expires: %s',
'reputation_approve' => 'Approve',
'reputation_disapprove' => 'Disapprove',
'reputation_reason' => 'Reason',
'reputation_warn' => 'Warn',
'reputation_ban' => 'Ban',
'reputation_warn_user' => 'Give this user a warning',
'reputation_ban_user' => 'Ban this user',
'reputation_report_post' => 'Report this post to moderator(s)',
'reputation_report' => 'Report',
// expiration
'reputation_expire' => 'Expire',
'reputation_expired' => 'Expired',
'reputation_expire_never' => 'Never',
// adding/editing reviews
'reputation_modify' => 'Modify user\'s reputation',
'reputation_mail_warning' => 'You have recieved a warning',
'reputation_mail_ban' => 'You have been banned',
'reputation_expire_fixed' => 'After %s days.',
'reputation_expire_limited_bottom' => 'Minimum value is %d day(s)',
'reputation_expire_limited' => 'Possible values are %d to %d days',
'reputation_note_cant_edit' => 'Please note that you won\'t be able to edit your review later',
'reputation_note_can_edit' => 'Please note that you\'ll be able to edit only your review text',
'reputation_for_days' => 'for %d day(s)',
'reputation_confirm_delete' => 'Are you sure you want to delete this review?',
'reputation_update_successfull' => 'You have successfully voted for this user\'s reputation',
'reputation_warning_successfull' => 'The user has been warned successfully',
'reputation_delete_success' => 'Review was deleted successfully. User\'s reputation has been updated.',
// input errors
'reputation_no_comments_entered' => 'You didn\'t enter any comment!',
'reputation_no_post_spec' => 'No post specified!',
'reputation_no_user_spec' => 'No user specified!',
'reputation_no_review_spec' => 'No review specified!',
'reputation_no_expire_entered' => 'You didn\'t enter an expire date for this warning',
// procedural errors
'reputation_deleted_no_edit' => 'The review you try to edit referres to deleted post',
'reputation_last_warning_issued' => 'The user has already got last warning',
'reputation_already_warned' => 'This user has been already warned for this post',
'reputation_already_banned' => 'This user is already banned',
'reputation_already_voted' => 'You have already referred to this post!',
// auth_personal errors
'reputation_not_applicable' => 'This user can\'t have reputation.',
'reputation_cant_warn_mods' => 'Moderators and administrators cannot be given warnings',
'reputation_self_no_modify' => 'You can\'t modify your own reputation!',
'reputation_others_no_edit' => 'You can\'t edit others\' reviews',
'reputation_other_mods_no_edit' => 'You can\'t edit warnings or bans given by other moderators/admins.',
'reputation_anonymous_no_reputation' => 'Anonymous users don\'t have reputation!',
'reputation_anonymous_no_reviews' => 'Anonymous posts don\'t have reviews!',
'reputation_limits_apply' => 'To change reputation you should met requirements on the number of posts, reputation points and active warnings.',
'reputation_time_limit' => 'You can\'t change reputation of the same member more than once in %d minutes.',
'reputation_rotation_limit' => 'You mush change reputation of %Ч different member to be able to change reputation of the same member twice.',
// emptiness errors
'reputation_no_reviews' => 'This post hasn\'t got any reviews',
'reputation_no_details' => 'This user hasn\'t got any reputation details',
'reputation_no_warnings' => 'This post hasn\'t got any warnings',
// backlinks
'reputation_msg_view_warning' => '%sView this warning%s',
'reputation_msg_delete_report' => '%sDelete report%s',
'reputation_msg_view_profile' => '%sView this user\'s profile%s',
'reputation_msg_back_to_topic' => '%sGo back to topic%s',
'reputation_msg_back_to_reviews' => '%sGo back to reviews%s',
'reputation_msg_view_your_review' => '%sView your review of this post%s',
'reputation_msg_back_to_reports' => '%sBack to the Reports page%s',
// posting
'Post_locked' => 'Sorry, you are not allowed edit or delete this post any more.',
'reputation_lock_post' => 'Lock this post',
) + $lang;
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<a href="{U_SEARCH_NEW}"
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
{U_VIEW_REPORTED}
#
#-----[ FIND ]------------------------------------------
#
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<br />{NEWEST_USER}
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{MOST_RESPECTED_USERS}{LEAST_RESPECTED_USERS}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td align="right" nowrap="nowrap"><span class="gen">{warnings.L_WARNINGS}: </span></td>
<td><b><span class="gen">{warnings.WARNINGS}</span></b> {warnings.YELLOW_IMG} {warnings.RED_IMG}
<br /><span class="genmed"><a href="{warnings.details.U_SEARCH}" class="genmed">{warnings.details.L_SEARCH}</a></span>
</tr>
<tr>
<td align="right" nowrap="nowrap"><span class="gen">{reputation.L_REPUTATION}: </span></td>
<td><b><span class="gen">{reputation.REPUTATION}</span></b>
<br /><span class="genmed"><a href="{reputation.details.U_SEARCH}" class="genmed">{reputation.details.L_SEARCH}</a></span>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]------------------------------------------
#
$board_config['privmsg_graphic_length'] = 175;
#
#-----[