1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-01 03:54:56 +02:00

Added editing information, no time limit at present

git-svn-id: file:///svn/phpbb/trunk@673 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-07-15 15:45:09 +00:00
parent 2878b8bad5
commit e5211f3d20
5 changed files with 57 additions and 13 deletions

View File

@ -204,6 +204,8 @@ CREATE TABLE phpbb_posts (
poster_ip char(8) NOT NULL,
post_username varchar(30),
bbcode_uid varchar(10) NOT NULL,
post_edit_time int(11),
post_edit_count smallint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (post_id),
KEY forum_id (forum_id),
KEY topic_id (topic_id),

View File

@ -199,7 +199,9 @@ CREATE TABLE phpbb_posts (
post_time int4 DEFAULT '0' NOT NULL,
post_username varchar(30),
poster_ip char(8) DEFAULT '' NOT NULL,
bbcode_uid varchar(10) DEFAULT '' NOT NULL,
bbcode_uid varchar(10) DEFAULT '' NOT NULL,
post_edit_time int4,
post_edit_count int2 DEFAULT '0' NOT NULL,
CONSTRAINT phpbb_posts_pkey PRIMARY KEY (post_id)
);
CREATE INDEX forum_id_phpbb_posts_index ON phpbb_posts (forum_id);

View File

@ -199,6 +199,11 @@ $lang['Reply_with_quote'] = "Reply with quote";
$lang['View_IP'] = "View IP of poster";
$lang['Delete_post'] = "Delete this post";
$lang['Edited_by'] = "Last edited by"; // followed by -> [username] on ...
$lang['on'] = "on";
$lang['edited'] = "edited"; // followed by -> [num] times in total
$lang['times_in_total'] = "time/s in total";
$lang['Lock_topic'] = "Lock this topic";
$lang['Unlock_topic'] = "Unlock this topic";
$lang['Move_topic'] = "Move this topic";

View File

@ -164,6 +164,7 @@ if( $mode != "newtopic" )
{
$topic_id = $check_row['topic_id'];
}
$is_first_post = FALSE;
$is_last_post = FALSE;
}
@ -357,7 +358,7 @@ if( ( isset($HTTP_POST_VARS['submit']) || $preview ) && $topic_status == TOPIC_U
$message = prepare_message(stripslashes($HTTP_POST_VARS['message']), $html_on, $bbcode_on, $smile_on, $bbcode_uid);
if($attach_sig && !empty($userdata['user_sig']))
if( $attach_sig )
{
$message .= (eregi(" $", $message)) ? "[addsig]" : " [addsig]";
}
@ -776,8 +777,17 @@ else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
}
else
{
if( !$is_last_post && $userdata['user_level'] != ADMIN )
{
$edited_sql = ", post_edit_time = " . time() . ", post_edit_count = post_edit_count + 1 ";
}
else
{
$edited_sql = "";
}
$sql = "UPDATE " . POSTS_TABLE . "
SET bbcode_uid = '$bbcode_uid'
SET bbcode_uid = '$bbcode_uid'" . $edited_sql . "
WHERE post_id = $post_id";
if($db->sql_query($sql, BEGIN_TRANSACTION))
@ -866,11 +876,16 @@ else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
$subject = stripslashes(trim($postrow['post_subject']));
$message = stripslashes(trim($postrow['post_text']));
if(eregi("\[addsig]$", $message))
{
$message = eregi_replace("\[addsig]$", "", $message);
$attach_sig = TRUE;
}
$message = eregi_replace("\[addsig]$", "", $message);
else
{
$attach_sig = FALSE;
}
// Removes UID from BBCode entries
$message = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $message);
@ -899,6 +914,7 @@ else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
case POST_ANNOUNCE:
$is_announce = TRUE;
break;
case POST_STICKY:
$is_sticky = TRUE;
break;
@ -950,6 +966,7 @@ if($preview && !$error)
case POST_ANNOUNCE:
$is_announce = TRUE;
break;
case POST_STICKY:
$is_sticky = TRUE;
break;
@ -961,7 +978,9 @@ if($preview && !$error)
$preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
$preview_message = make_clickable($preview_message);
$template->set_filenames(array("preview" => "posting_preview.tpl"));
$template->set_filenames(array(
"preview" => "posting_preview.tpl")
);
$template->assign_vars(array(
"TOPIC_TITLE" => $subject,
"POST_SUBJECT" => $subject,

View File

@ -166,7 +166,7 @@ if(!$is_auth['auth_view'] || !$is_auth['auth_view'])
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_avatar, p.post_time, p.post_id, p.bbcode_uid, pt.post_text, pt.post_subject, p.post_username
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_avatar, p.post_time, p.post_id, p.post_username, p.bbcode_uid, p.post_edit_time, p.post_edit_count, pt.post_text, pt.post_subject
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
@ -394,16 +394,21 @@ for($i = 0; $i < $total_posts; $i++)
if(!$board_config['allow_html'])
{
$user_sig = strip_tags($user_sig);
if($user_sig != "")
{
$user_sig = strip_tags($user_sig);
}
$message = strip_tags($message);
}
if($board_config['allow_bbcode'])
{
// do bbcode stuff here
$sig_uid = make_bbcode_uid();
$user_sig = bbencode_first_pass($user_sig, $sig_uid);
$user_sig = bbencode_second_pass($user_sig, $sig_uid);
if($user_sig != "")
{
$sig_uid = make_bbcode_uid();
$user_sig = bbencode_first_pass($user_sig, $sig_uid);
$user_sig = bbencode_second_pass($user_sig, $sig_uid);
}
$message = bbencode_second_pass($message, $bbcode_uid);
}
@ -411,6 +416,19 @@ for($i = 0; $i < $total_posts; $i++)
$message = make_clickable($message);
$message = str_replace("\n", "<br />", $message);
if($user_sig != "")
{
$message = eregi_replace("\[addsig]$", "<br /><br />_________________<br />" . nl2br($user_sig), $message);
}
//
// Editing information
//
if($postrow[$i]['post_edit_count'])
{
$message = $message . "<br /><br /><font size=\"-2\">" . $lang['Edited_by'] . " " . $poster . " " . $lang['on'] . " " . create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['default_timezone']) . ", " . $lang['edited'] . " " . $postrow[$i]['post_edit_count'] . " " . $lang['times_in_total'] . "</font>";
}
//
// Again this will be handled by the templating
// code at some point
@ -424,8 +442,6 @@ for($i = 0; $i < $total_posts; $i++)
$color = "#" . $theme['td_color2'];
}
$message = eregi_replace("\[addsig]$", "<br /><br />_________________<br />" . nl2br($user_sig), $message);
$template->assign_block_vars("postrow", array(
"POSTER_NAME" => $poster,
"POSTER_RANK" => $poster_rank,