mod işlevi: Rütbe ayarlarına, o rütbeye erişmiş kişilerin flood sınırına dahil olup olmadıklarını belirleme şansı verir, böylece belli bir kıdeme ermiş üyeler mesaj flood sınırında takılmadan site içinde mesaj yazabilirler
mod linki: http://www.phpbb.com/phpBB/viewtopic.php?t=41640
- Kod: Tümünü seç
##############################################################
## MOD Title: Disable Flood by Rank
## MOD Author: netclectic (Adrian *beep*) www.netclectic.com
## MOD Description: Allows you to enable / disable flood control on a per rank basis.
## MOD Version: 0.9.0 BETA
##
## Installation Level: moderate
## Installation Time: 10 Minutes
## Files To Edit: (5) functions_post.php admin_ranks.php, lang_admin.php, ranks_list_body.tpl, ranks_edit_body.tpl
##
## Included Files: n/a
##############################################################
## 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/
##############################################################
## Authors Notes:
## Includes 1 database alteration - add 1 field to ranks table
##
## Change History:
## 0.9.0 Beta : Original Beta release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]-------------------------------------------
#
ALTER TABLE `phpbb_ranks` ADD `flood_disabled` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
$where_sql = ( $userdata['user_id'] == ANONYMOUS ) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
WHERE $where_sql";
#
#-----[ REPLACE WITH ]----------------------------------
#
$from_sql = ( $userdata['user_id'] == ANONYMOUS ) ? POSTS_TABLE : POSTS_TABLE . " p, " . USERS_TABLE . " u, " . RANKS_TABLE . " r ";
$join_sql = ( $userdata['user_id'] == ANONYMOUS ) ? "" : " p.poster_id = u.user_id AND (u.user_rank = 0 OR (u.user_rank = r.rank_id AND r.flood_disabled = 0)) AND ";
$where_sql = ( $userdata['user_id'] == ANONYMOUS ) ? "poster_ip = '$user_ip'" : 'p.poster_id = ' . $userdata['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM $from_sql
WHERE $join_sql $where_sql";
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_ranks.php
#
#-----[ FIND ]------------------------------------------
#
$rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
$flood_disabled_yes = ( $rank_info['flood_disabled'] ) ? "checked=\"checked\"" : "";
$flood_disabled_no = ( !$rank_info['flood_disabled'] ) ? "checked=\"checked\"" : "";
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
"IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img src="../' . $rank_info['rank_image'] . '" />' : "",
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
"FLOOD_DISABLED_YES" => $flood_disabled_yes,
"FLOOD_DISABLED_NO" => $flood_disabled_no,
"L_FLOOD_DISABLE" => $lang['Flood_disable'],
"L_FLOOD_DISABLE_EXPLAIN" => $lang['Flood_disable_explain'],
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
$rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) ) ? trim($HTTP_POST_VARS['rank_image']) : "";
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
$flood_disabled = ( $HTTP_POST_VARS['flood_disabled'] == 1 ) ? TRUE : 0;
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
str_replace("\'", "''", $rank_image) . "'
#
#-----[ IN-LINE AFTER, ADD ]---------------------------
#
, flood_disabled = $flood_disabled
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image,
#
#-----[ IN-LINE AFTER, ADD ]---------------------------
#
, flood_disabled
#
#-----[ FIND ]------------------------------------------
#
str_replace("\'", "''", $rank_image) . "'
#
#-----[ IN-LINE AFTER, ADD ]---------------------------
#
, $flood_disabled
#
#-----[ FIND ]------------------------------------------
#
"L_ACTION" => $lang['Action'],
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
"L_FLOOD_DISABLE" => $lang['Flood_disable'],
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
$rank_min = $rank_rows[$i]['rank_min'];
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
$flood_disabled = $rank_rows[$i]['flood_disabled'];
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
"SPECIAL_RANK" => ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'],
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
"FLOOD_DISABLED" => ( $flood_disabled == 1 ) ? $lang['Yes'] : $lang['No'],
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
"L_ACTION" => $lang['Action'],
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
"L_FLOOD_DISABLE" => $lang['Flood_disable'],
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
$rank_min = $rank_rows[$i]['rank_min'];
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
$flood_disabled = ( $rank_rows[$i]['flood_disabled'] ) ? $lang['Yes'] : $lang['No'];
// MOD FLOOD DISABLE END
#
#-----[ FIND ]------------------------------------------
#
"RANK_MIN" => $rank_min,
#
#-----[ AFTER, ADD ]------------------------------------
#
// MOD FLOOD DISABLE BEGIN
"FLOOD_DISABLED" => $flood_disabled,
// MOD FLOOD DISABLE END
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/ranks_list_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th class="thTop">{L_SPECIAL_RANK}</th>
#
#-----[ AFTER, ADD ]------------------------------------
#
<th class="thTop">{L_FLOOD_DISABLE}</th>
#
#-----[ FIND ]------------------------------------------
#
<td class="{ranks.ROW_CLASS}" align="center">{ranks.SPECIAL_RANK}</td>
#
#-----[ AFTER, ADD ]------------------------------------
#
<td class="{ranks.ROW_CLASS}" align="center">{ranks.FLOOD_DISABLED}</td>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/ranks_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_RANK_SPECIAL}</span></td>
<td class="row2"><input type="radio" name="special_rank" value="1" {SPECIAL_RANK} />{L_YES} &&<input type="radio" name="special_rank" value="0" {NOT_SPECIAL_RANK} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_FLOOD_DISABLE}<br></span><span class="gensmall">{L_FLOOD_DISABLE_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="flood_disabled" value="1" {FLOOD_DISABLED_YES} />{L_YES} &&<input type="radio" name="flood_disabled" value="0" {FLOOD_DISABLED_NO} /> {L_NO}</td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]-----------------------------------
#
// MOD FLOOD DISABLE BEGIN
$lang['Flood_disable'] = 'Flood disabled';
$lang['Flood_disable_explain'] = 'Disable flood control for this rank';
// MOD FLOOD DISABLE END
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM