Should befrank22 wrote:Hi,
I installed this mod. Get this error on trying to post new topic:
Parse error: parse error, unexpected T_VARIABLE in /home/reikimas/public_html/tforum/posting.php on line 273
Line 273:
Please help.Code: Select all
$message = sprintf($lang['edit_time_auth_explain'], $post_info['forum_limited_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>');
Code: Select all
$message = sprintf($lang['edit_time_auth_explain'], $post_info['forum_limited_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>');
frank22 wrote:Thanks for your help, RMcGirr83.
Now it gives the same error but in line 282, which reads as:
$message = sprintf($lang['edit_time_past'], $userdata['user_limited_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>');
Kindly review this one too. I hope correcting this would make it work.
Thanks in advance.
Code: Select all
$message = sprintf($lang['edit_time_past'], $userdata['user_limited_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>');
Code: Select all
#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . FORUMS_TABLE . "
#
#-----[ BEFORE, ADD ]-----------------------------------------
You can set for users not to be able to delete posts in the ACPrantbot wrote:Does this mod also prevent users from deleting their posts after the edit time limit has passed?
That's not what I want. I want deletions to be handled like edits - users can do either but only up to a point.RMcGirr83 wrote:You can set for users not to be able to delete posts in the ACP
Code: Select all
//-- mod : Limited Edit Time by 3Di ----------------------------------------------
//
// languages handling here.. 1 means singular, for forums.
if ($post_info['forum_limited_time'] == 1)
{
$lang['edit_time_auth_explain'] = $lang['edit_time_auth_explain_one'];
}
// languages handling here.. 1 means singular, for $userdata.
if ($userdata['user_limited_time'] == 1)
{
$lang['edit_time_past'] = $lang['edit_time_past_one'];
}
// let's start with the program then.
//
// Time precision set to seconds, not minutes.. this time.
// We avoid also Admin and Moderators to be involved here, ofcourse
// If forum_limited_time or user_limited_time are set to ZERO there aren't restriction set..
// you can use both or just one of those, it's up to you
//
if ( $mode == 'editpost' && !$is_auth['auth_mod'] && ($post_info['forum_limited_time'] != '0') && !$submit)
{
$current_time = time();
$difference_sec = $current_time - $post_info['post_time'];
if ( $difference_sec > ($post_info['forum_limited_time'] * 60) )
{
$message = sprintf($lang['edit_time_auth_explain'], $post_info['forum_limited_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);
}
else if ( $mode == 'editpost' && !$is_auth['auth_mod'] && ($userdata['user_limited_time'] != '0') && !$submit)
{
$current_time = time();
$difference_sec = $current_time - $post_info['post_time'];
if ( $difference_sec > ( $userdata['user_limited_time'] * 60 ) )
{
$message = sprintf($lang['edit_time_past'], $userdata['user_limited_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 mod : Limited Edit Time by 3Di ------------------------------------------
Code: Select all
//-- mod : Limited Edit Time by 3Di ----------------------------------------------
//
// languages handling here.. 1 means singular, for forums.
if ($post_info['forum_limited_time'] == 1)
{
$lang['edit_time_auth_explain'] = $lang['edit_time_auth_explain_one'];
$lang['delete_time_auth_explain'] = $lang['delete_time_auth_explain_one'];
}
// languages handling here.. 1 means singular, for $userdata.
if ($userdata['user_limited_time'] == 1)
{
$lang['edit_time_past'] = $lang['edit_time_past_one'];
$lang['delete_time_past'] = $lang['delete_time_past_one'];
}
// let's start with the program then.
//
// Time precision set to seconds, not minutes.. this time.
// We avoid also Admin and Moderators to be involved here, ofcourse
// If forum_limited_time or user_limited_time are set to ZERO there aren't restriction set..
// you can use both or just one of those, it's up to you..also for delete post
//
if ( ( $mode == 'editpost' || $mode == 'delete' ) && !$is_auth['auth_mod'] && ($post_info['forum_limited_time'] != '0') && !$submit)
{
$current_time = time();
$difference_sec = $current_time - $post_info['post_time'];
if ( $difference_sec > ($post_info['forum_limited_time'] * 60) )
{
if ( $mode == 'editpost' )
{
$message = sprintf($lang['edit_time_auth_explain'], $post_info['forum_limited_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);
}
else
{
$message = sprintf($lang['delete_time_auth_explain'], $post_info['forum_limited_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);
}
}
else if ( ( $mode == 'editpost' || $mode == 'delete' ) && !$is_auth['auth_mod'] && ($userdata['user_limited_time'] != '0') && !$submit)
{
$current_time = time();
$difference_sec = $current_time - $post_info['post_time'];
if ( $difference_sec > ( $userdata['user_limited_time'] * 60 ) )
{
if ( $mode == 'editpost' )
{
$message = sprintf($lang['edit_time_past'], $userdata['user_limited_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);
}
else
{
$message = sprintf($lang['delete_time_past'], $userdata['user_limited_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 mod : Limited Edit Time by 3Di ------------------------------------------
Code: Select all
<?php
/***************************************************************************
* lang_extend_let_3Di.php
* -------------------
* begin : 2007/03/31
* copyright : (C) 2007 3Di (aka 3D)
* email : 3dforum AT libero DOT it
*
* $Id: lang_extend_let_3Di.php, 1.0.0e, 2007/08/13 18.30.00, 3Di Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
$lang['edit_time_past'] = 'You are not allowed to edit your posts. You have to edit your posts within <b>%d</b> minutes, after you posted your messages.';
$lang['edit_time_past_one'] = 'You are not allowed to edit your post. You have to edit your post within <b>%d</b> minute, after you posted your message.';
$lang['edit_time'] = 'Post Edit time';
$lang['edit_time_explain'] = 'The time (in minutes) the user has to edit/delete his/her post/s. Unlimited time if ZERO.';
$lang['edit_time_auth_explain'] = 'This Forum has the <i>Limited Time Edit</i> set to <b>%d</b> minutes. Sorry';
$lang['edit_time_auth_explain_one'] = 'This Forum has the <i>Limited Time Edit</i> set to <b>%d</b> minute. Sorry';
$lang['Limited_Edit_Time_value_must_be'] = 'The value for Limited Edit/Delete Time must be <b>only numbers</b><br />The query has been stopped and no values have been entered into the DB yet.<br /><br />Please go back and try again.';
$lang['Forum_time'] = 'Time in minutes within the posts can be edited or deleted, ZERO for unlimited time.';
$lang['delete_time_auth_explain'] = 'This Forum has the <i>Limited Time Delete</i> set to <b>%d</b> minutes. Sorry';
$lang['delete_time_auth_explain_one'] = 'This Forum has the <i>Limited Time Delete</i> set to <b>%d</b> minute. Sorry';
$lang['delete_time_past'] = 'You are not allowed to delete your posts. You have to delete your posts within <b>%d</b> minutes, after you posted your messages.';
$lang['delete_time_past_one'] = 'You are not allowed to delete your post. You have to delete your post within <b>%d</b> minute, after you posted your message.';
?>