[請教]關於第 幾次修改?Always show 'edited by'

phpBB 大部分皆是由竹貓星球提供資料!
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 4
文章: 33799
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

[請教]關於第 幾次修改?Always show 'edited by'

未閱讀文章 懸壺子 »

[請教]關於第 幾次修改?
最近才發現,有時候我們要更改發文時,
都會出現某某人第 幾次修改
可是在下的論壇,有時候會顯示,有時候不會顯示?
連系統管理員也是如此?
不知道該如何修改? 謝謝管理大人

http://bbc.sytes.net/phpbb2/viewtopic.php?p=880#880

可以安裝下面此外掛就可以達到你想要的功能

http://www.phpbbhacks.com/download/1299

一般情況,會員自己更改過文章,而下面沒有其他回覆的話,是不會顯示回覆次數的,這個外掛就可以就算沒人回覆也可以顯示修改次數
圖檔
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 4
文章: 33799
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

Re: [請教]關於第 幾次修改?

未閱讀文章 懸壺子 »

kittyman
我是裝在plus 1.53a, 一切正常........
不好意思, 您有執行 db_update.php 嗎!?
.....一點淺見.....
昨天我沒有做此動作! 有複製,但是沒Run
趕快去做 感恩您

目前測試已經正常
圖檔
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 4
文章: 33799
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

Always show 'edited by'

未閱讀文章 懸壺子 »

Always show 'edited by'

代碼: 選擇全部

###############################################
##	Hack Title:		Always show 'edited by'
##	Hack Version:	0.0.3
##	Author:			Freakin' Booty ;-P
##	Website:		http://freakingbooty.no-ip.com
##	Description:	When a user edits a post, 'edited by' is always shown. Without this hack,
##					'edited by' is only shown after a reply has been posted.
##					Also shows what user has edited the post.
##	Compatibility:	2.0.4 - 2.0.11
##
##	Installation Level: Easy
##	Installation Time: 5-10 minutes
##	Files To Edit: 3
##		viewtopic.php
##		includes/constants.php
##		includes/functions_post.php
##
##	Included Files: 1
##		db_update.php\r
##
##	History:
##		0.0.3:	Fixed a bug where the data is input for the first time.
##		0.0.2:	Now shows who exactly has edited the post, and how many times. On top also shows what the last
##				post time was.
##		0.0.1:	Initial release
##
##	Author Notes:
##		0.0.2 is unreleased, so that is why there are no upgrade instructions or anything.
##
##	Support:		http://www.phpbbhacks.com/forums
##	Copyright:		?003-04 Freakin' Booty ;-P - Always show 'edited by' 0.0.3
##
###############################################
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
##   Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
##   This hack is released under the GPL License.
##   This hack can be freely used, but not distributed, without permission.
##   Intellectual Property is retained by the hack author(s) listed above.
###############################################

#
#-----[ COPY ]--------------------------------------------
#
# Run this file once as an administrator and then delete it immediately
#
db_update.php		=> db_update.php

#
#-----[ OPEN ]--------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]--------------------------------------------
#
	if ( $postrow[$i]['post_edit_count'] )
	{
		$l_edit_time_total = ( $postrow[$i]['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];

		$l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']), $postrow[$i]['post_edit_count']);
	}
	else
	{
		$l_edited_by = '';
	}

#
#-----[ REPLACE WITH ]------------------------------------
#
	$sql = "SELECT pe.*, u.username
			FROM " . POSTS_EDIT_TABLE . " pe, " . USERS_TABLE . " u
			WHERE pe.post_id = " . $postrow[$i]['post_id'] . "
				AND pe.user_id = u.user_id
			ORDER BY pe.post_edit_time DESC";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain posts edit count information', '', __LINE__, __FILE__, $sql);
	}

	$l_edited_by = '';
	while ( $row = $db->sql_fetchrow($result) )
	{
		$l_edit_time_total = ( $row['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];
		$l_edited_by .= ( ($l_edited_by == '') ? '<br />' : '' ) . '<br />' . sprintf($l_edit_time_total, $row['username'], create_date($board_config['default_dateformat'], $row['post_edit_time'], $board_config['board_timezone']), $row['post_edit_count']);
	}

#
#-----[ OPEN ]--------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]--------------------------------------------
#
define('POSTS_TABLE', $table_prefix.'posts');

#
#-----[ AFTER, ADD ]-------------------------------------
#
define('POSTS_EDIT_TABLE', $table_prefix.'posts_edit');

#
#-----[ OPEN ]--------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND, DELETE ]------------------------------------
#
	$edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";

#
#-----[ FIND ]--------------------------------------------
#
	$sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";

#
#-----[ INLINE, FIND & DELETE ]---------------------------
#
" . $edited_sql . "

#
#-----[ FIND ]--------------------------------------------
#
	add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));

#
#-----[ BEFORE, ADD ]-------------------------------------
#
	if( $mode == 'editpost' )
	{
		$sql = "SELECT * FROM " . POSTS_EDIT_TABLE . "
				WHERE post_id = $post_id
					AND user_id = " . $userdata['user_id'];
		if( !$result = $db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not retrieve post edit count information', '', __LINE__, __FILE__, $sql);
		}

		$sql = ( $row = $db->sql_fetchrow($result) ) ? "UPDATE " . POSTS_EDIT_TABLE . " SET post_edit_count = post_edit_count + 1, post_edit_time = $current_time WHERE post_id = $post_id AND user_id = " . $userdata['user_id'] : "INSERT INTO " . POSTS_EDIT_TABLE . " (post_id, user_id, post_edit_count, post_edit_time) VALUES ($post_id, " . $userdata['user_id'] . ", 1, $current_time)";
		if( !$result = $db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not update post edit count information', '', __LINE__, __FILE__, $sql);
		}
	}

#
#----[ SAVE & CLOSE ALL FILES ]---------------------------
#
頭像
懸壺子
系統管理員
系統管理員
主題中的帖子: 4
文章: 33799
註冊時間: 2001-10-05 , 10:10
個人狀態: 道骨學習佛心..^^..
貼心留言: 氣候不穩
性別: 公仔
來自: 黃金故鄉
聯繫:

db_update.php

未閱讀文章 懸壺子 »

db_update.php

代碼: 選擇全部

<?php

/***************************************************************************
 *                               db_update.php
 *                            -------------------
 *	Hack:		Always show 'edited by' 0.0.3
 *	Copyright:	?003-04 Freakin' Booty ;-P
 *	Website:	http://freakingbooty.no-ip.com
 *	Support:	http://www.phpbbhacks.com/forums
 *
 *
 ***************************************************************************/

/***************************************************************************
 *	This hack is released under the GPL License.
 *	This hack can be freely used, but not distributed, without permission.
 *	Intellectual Property is retained by the hack author(s) listed above.
 ***************************************************************************/


define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);


//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//


//
// Not logged in, not authorised
//
if( !$userdata['session_logged_in'] )
{
	$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
	header($header_location . append_sid('login.'.$phpEx.'?redirect=db_update.'.$phpEx));
	exit;
}

if( $userdata['user_level'] != ADMIN )
{
	message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}


$page_title = 'Updating the database';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "CREATE TABLE `" . $table_prefix . "posts_edit` (`post_id` mediumint(8) unsigned NOT NULL default '0', `user_id` mediumint(8) unsigned NOT NULL default '0', `post_edit_count` smallint(5) unsigned NOT NULL default '0', `post_edit_time` int(11) default NULL, KEY `post_id` (`post_id`));";

for( $i = 0; $i < count($sql); $i++ )
{
	if( !$result = $db->sql_query ($sql[$i]) )
	{
		$error = $db->sql_error();

		echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
	}
	else
	{
		echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
	}
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28">&nbsp;</td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.<br />If you have run into any errors, please visit the <a href="http://www.phpbbhacks.com/forums" target="_phpbbhacks">phpBBHacks.com support forums</a> and ask someone for help.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
版面鎖定 主題已鎖定

回到「phpBB2」