I hope you can help me in this.
Well I don't want that the Ajax Quickedit always stay enabled in the posts of each user, because in my forum my users only have "X" time to edit their posts, but his only works to the full edit form, because always appears the quickedit function and with that my users can edit their posts.
I have this little mod to put time to my users can edit their posts, so I hope the AJAX can be compatible with that.
Code: Alles auswählen
## EasyMod 0.0.10a 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/ 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:
##
##############################################################
## MOD History:
##
## ------------
## 01-01-2002 - 0.9.0 beta
## - Beta
##
## 01-01-2002 - 1.0.0 FINAL
## - Final
##
## 01-01-2002 - 1.0.1 FINAL
## - Made phpBB v2.0.2 complaint and EasyMod 0.0.7 complaint
##
## 05-12-2003 - 1.0.2 FINAL
## - Made phpBB v2.0.6 complaint and EasyMod 0.0.10a complaint
## - Adjusted to the new Template
#################################################################
## 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.';
--------TRADUCCION----------------------------------------------
//limited post edit time MOD
$lang['edit_time_past'] = 'No estas permitido para editar tu respuesta. Para editar tu respuesta(mensaje) tienes únicamente <b>%d</b> minutos, después de haberla colocado.';
#
#-----[ 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" : '';
-------[ BUSCAR UNICAMENTE ]--------------
$select_sql = ( !$submit ) ? "
--------[DESPUES DE]---------------------
p.post_username,
--------[AGREGAR]------------------------
p.post_time,
#
#-----[ 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 ]------------------------------------------
#
# EoMAlso with the plus the Ajax 1.0.4 can enable and disable the quickedit function but with the update I lost that function in my Ajax Mod.
Cheers!!