Seite 1 von 1
EDIT-Time für einzelne User begrenzen
Verfasst: 20.01.2005 12:53
von Crazy Com
Hallo!
Ich suche einen Mod, wo ich für jeden User einzeln die Edit-Time begrenzen kann.
Also dass er z.B. nach 30 Minuten seine Postings nicht mehr editieren kann.
Ich hoffe es gibt sowas...
cu
Crazy Com
Verfasst: 20.01.2005 13:40
von Mario Siebert
Hier, allerdings limitiert der für alle Benutzer die Editierzeit, aber es ist nicht schwer den Mod dahingehend zu erweitern das der Admin für jeden User eine eigene Editierzeit einstellen kann.
## EasyMod 0.0.7 compliant
#################################################################
## MOD Title: Limited Post Edit time
## MOD Author: Shannado <sven@shannado.nl> (Sven) http://www.shannado.nl/forumorg
## MOD Description: With this MOD the admin is able to set through the board configuaration, the time (in minutes) a user has
## to edit his/her post. When the value is set to '0', the time is unlimited.
## The check occurs only when the user hits the 'edit'button in the post.
## NOT when the user hits the submit button.
## Moderators & Admins can always edit the post
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 10 - 20 Minutes
## Files To Edit: posting.php,
## lang_main.php,
## lang_admin.php,
## admin_board.php,
## board_config_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/
##############################################################
##
## Author Note:
##
##############################################################
##
## History:
## ------------
## 0.9.0 beta
## - Beta
##
## 1.0.0 FINAL
## - Final
##
## 1.0.1 FINAL
## - Made phpBB v2.0.2 complaint and EasyMod 0.0.7 complaint
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ SQL ]-------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0')
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//limited post edit time MOD
$lang['edit_time'] = 'Post Edit time';
$lang['edit_time_explain'] = 'The time (in minutes) the user has to edit his/her post. Setting this value to 0, the time is unlimited.';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//limited post edit time MOD
$lang['edit_time_past'] = 'You are not allowed to edit your post. You have to edit your post within <b>%d</b> minutes, after you posted your message.';
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';
#
#-----[ FIND ]------------------------------------------
#
else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])
{
message_die(GENERAL_MESSAGE, $lang['Topic_locked']);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// BEGIN - Limited post edit time MOD
//
if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $board_config['edit_time'] != '0' && !$submit)
{
$current_time = time();
$difference_sec = $current_time - $post_info['post_time'] ;
$difference_min = ($current_time - $post_info['post_time']) / 60;
if ($difference_min > $board_config['edit_time'] )
{
$message = sprintf($lang['edit_time_past'],$board_config['edit_time']) . '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
}
//
// END - Limited post edit time MOD
//
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_ENABLE_PRUNE" => $lang['Enable_prune'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_EDIT_TIME" => $lang['edit_time'],
"L_EDIT_TIME_EXPLAIN" => $lang['edit_time_explain'],
#
#-----[ FIND ]------------------------------------------
#
"PRUNE_NO" => $prune_no,
#
#-----[ AFTER, ADD ]------------------------------------------
#
"EDIT_TIME" => $new['edit_time'],
#
#-----[ OPEN ]------------------------------------------
#
templates/SubSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_EDIT_TIME}<br /><span class="gensmall">{L_EDIT_TIME_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="4" maxlength="4" name="edit_time" value="{EDIT_TIME}" /></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Grüße Mario