##############################################################
## MOD Title: Limited Post Edit Time
## MOD Author: acoolwelshbloke < [email protected] > (Paul Norman) https://tik.lat/UkSow
## MOD Description: With this MOD the admin is able to set through the boards configuaration, the time
## (in minutes) a user has to edit their post. Setting a value of '0', allows unlimited editing.
## (Moderators & Admins can always edit the post)
## MOD Version: 1.0.0
##
##
## Installation Level: Easy
## Installation Time: 10 Minutes
##
## Files To Edit: posting.php,
## admin/admin_board.php,
## language/lang_english/lang_main.php,
## language/lang_english/lang_admin.php,
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: (n/a)
##
## License: https://tik.lat/Sbpiy GNU General Public License v2
##############################################################
## For security purposes, please check: https://tik.lat/CJeGf
## 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 https://tik.lat/9dMQn
##############################################################
## Author Notes:
##
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
## FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
## THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
## ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
##
##############################################################
## MOD History:
##
## ------------
## 01-01-2002 - 0.9.0 beta
## - Beta
##
## 01-01-2002 - 1.0.0 FINAL
## - Final
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL SORGUSU ]-------------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0')
#
#-----[ AÇ ]------------------------------------------------
#
posting.php
#
#-----[ BUL ]------------------------------------------------
#
$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, u.user_sig_bbcode_uid' : '';
#
#-----[ TEKRAR BUL ]----------------------------------------
#
p.post_username,
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
p.post_time,
#
#-----[ BUL ]------------------------------------------------
#
else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])
{
message_die(GENERAL_MESSAGE, $lang['Topic_locked']);
}
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
//
// 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
//
#
#-----[ AÇ ]------------------------------------------------
#
admin/admin_board.php
#
#-----[ BUL ]------------------------------------------------
#
"L_ENABLE_PRUNE" => $lang['Enable_prune'],
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
"L_EDIT_TIME" => $lang['edit_time'],
"L_EDIT_TIME_EXPLAIN" => $lang['edit_time_explain'],
#
#-----[ BUL ]------------------------------------------------
#
"PRUNE_NO" => $prune_no,
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
"EDIT_TIME" => $new['edit_time'],
#
#-----[ AÇ ]------------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ BUL ]------------------------------------------------
#
//
// That's all Folks!
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
//limited post edit time MOD
$lang['edit_time'] = 'Post Edit time';
$lang['edit_time_explain'] = 'The time (in minutes) a user has to edit their posts. Setting this value to 0, allows unlimited editing.';
#
#-----[ AÇ ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ BUL ]------------------------------------------------
#
//
// That's all, Folks!
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
//limited post edit time MOD
$lang['edit_time_past'] = 'You are only allowed to edit your post within the first <b>%d</b> minute(s) of it being submitted.';
#
#-----[ AÇ ]------------------------------------------------
#
templates/SubSilver/admin/board_config_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<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>
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
<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>
#
#-----[ TÜM DOSYALARI KAYDET VE KAPAT ]--------------------------------
#
# EoM
## MOD Title: Limited Post Edit Time
## MOD Author: acoolwelshbloke < [email protected] > (Paul Norman) https://tik.lat/UkSow
## MOD Description: With this MOD the admin is able to set through the boards configuaration, the time
## (in minutes) a user has to edit their post. Setting a value of '0', allows unlimited editing.
## (Moderators & Admins can always edit the post)
## MOD Version: 1.0.0
##
##
## Installation Level: Easy
## Installation Time: 10 Minutes
##
## Files To Edit: posting.php,
## admin/admin_board.php,
## language/lang_english/lang_main.php,
## language/lang_english/lang_admin.php,
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: (n/a)
##
## License: https://tik.lat/Sbpiy GNU General Public License v2
##############################################################
## For security purposes, please check: https://tik.lat/CJeGf
## 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 https://tik.lat/9dMQn
##############################################################
## Author Notes:
##
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
## FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
## THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
## ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
##
##############################################################
## MOD History:
##
## ------------
## 01-01-2002 - 0.9.0 beta
## - Beta
##
## 01-01-2002 - 1.0.0 FINAL
## - Final
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL SORGUSU ]-------------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0')
#
#-----[ AÇ ]------------------------------------------------
#
posting.php
#
#-----[ BUL ]------------------------------------------------
#
$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, u.user_sig_bbcode_uid' : '';
#
#-----[ TEKRAR BUL ]----------------------------------------
#
p.post_username,
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
p.post_time,
#
#-----[ BUL ]------------------------------------------------
#
else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])
{
message_die(GENERAL_MESSAGE, $lang['Topic_locked']);
}
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
//
// 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
//
#
#-----[ AÇ ]------------------------------------------------
#
admin/admin_board.php
#
#-----[ BUL ]------------------------------------------------
#
"L_ENABLE_PRUNE" => $lang['Enable_prune'],
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
"L_EDIT_TIME" => $lang['edit_time'],
"L_EDIT_TIME_EXPLAIN" => $lang['edit_time_explain'],
#
#-----[ BUL ]------------------------------------------------
#
"PRUNE_NO" => $prune_no,
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
"EDIT_TIME" => $new['edit_time'],
#
#-----[ AÇ ]------------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ BUL ]------------------------------------------------
#
//
// That's all Folks!
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
//limited post edit time MOD
$lang['edit_time'] = 'Post Edit time';
$lang['edit_time_explain'] = 'The time (in minutes) a user has to edit their posts. Setting this value to 0, allows unlimited editing.';
#
#-----[ AÇ ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ BUL ]------------------------------------------------
#
//
// That's all, Folks!
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
//limited post edit time MOD
$lang['edit_time_past'] = 'You are only allowed to edit your post within the first <b>%d</b> minute(s) of it being submitted.';
#
#-----[ AÇ ]------------------------------------------------
#
templates/SubSilver/admin/board_config_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<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>
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
<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>
#
#-----[ TÜM DOSYALARI KAYDET VE KAPAT ]--------------------------------
#
# EoM