[RC] Prime Post Revisions - View all edits to posts

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
Locked
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

Re: [RC] Prime Post Revisions - View all edits to posts

Post by shahinavthal »

IPB_Refugee wrote: Why do you think you have to alter your template files?
Where exactly is your problem?

You don't see an Obama thread in your board? Propably you do not have one...
:D

I meant that as an example... :mrgreen:

What i meant is that i dont find that revision text line(Like how you mentioned with the Obama example) under the edited post...I have purged the cache as well..I have founder rights and have full access for the forums..I use prosilver base theme with 3.0.2
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [RC] Prime Post Revisions - View all edits to posts

Post by IPB_Refugee »

Okay, thanks.

The template doesn't matter - that's completely unimportant regarding this MOD.

Are you sure you did all code edits correctly? Can you double check, please?
Did you upload the 4 modified files to the correct places at your webspace?
Did you do the database changes?
To be on the safe side: Please double check, if your account has moderator rights (especially "Can delete posts forever" (or something like that) and "Can restore postings")

And of course this MOD doesn't show edits of posts you did in the past. Only edits after installing this MOD will be shown.

And did you alter prime_post_revisions.php? E.g. these settings should work:

Code: Select all

/**
* Permissions
*/
define('APPROVE_VIEWING_POSTER', false);		// Can the post author view the revisions?
define('APPROVE_REMOVAL_POSTER', false);		// Can the post author remove revisions?
define('APPROVE_REMOVAL_EDITOR', false);		// Can the post editor remove their revision?
define('APPROVE_REMOVAL_MODERATOR', true);		// Can moderators (with the ability to delete posts) remove revisions?

/**
* Options
*/
define('ENABLE_POST_REVISIONS', true);			// Enable this MOD?
define('SUBJECT_CHANGE_REVISION', true);		// Store a revision when only the subject has been changed?
define('REVISION_PAGE_HEADER', true);			// Display the explanation about the viewing revisions page?
define('REVISION_POST_HEADERS', true);			// Display the revision number in the posts' subject area?
define('REVISION_SIGNATURES', true);			// Display signatures while viewing revisions?
Did this help or does the problem still occur?

Regards
Wolfgang
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

Re: [RC] Prime Post Revisions - View all edits to posts

Post by shahinavthal »

Well i think i had to come out of that post...moved around a few posts and then came back to see it is working

:? but :D
User avatar
jmaraujo
Registered User
Posts: 240
Joined: Fri Jun 01, 2007 9:48 pm
Location: Rivera - Uruguay
Name: Juan

Re: [RC] Prime Post Revisions - View all edits to posts

Post by jmaraujo »

Thanks for this excellent MOD, primehalo! :D

In my opinion this should be included by default with all phpBB3 versions.
User avatar
COD3M4ST3R-X
Registered User
Posts: 2269
Joined: Sat Aug 02, 2008 5:47 am
Location: Lahore,Pakistan

Re: [RC] Prime Post Revisions - View all edits to posts

Post by COD3M4ST3R-X »

Your Mod is flawless but its causing problems with this Mod.When users edits his or her topic using this mod the revisions are not stored. i hope u can provide a hotfix for that.Thanks
Ajax Quick Edit

Code: Select all

http://www.phpbb.com/community/viewtopic.php?f=70&t=597644
“Need and struggle are what excite and inspire us.”
User avatar
Forumtreff
Registered User
Posts: 9
Joined: Thu Jun 19, 2008 2:56 pm

Re: [RC] Prime Post Revisions - View all edits to posts

Post by Forumtreff »

Whoever the editor Vim or gvim used, can be use following easily replaced commands for this mod.

includes/constants.php

Code: Select all

:%s#.*define('POSTS_TABLE',\s*\$table_prefix . 'posts');.*#&\r//-- mod: Prime Post Revisions ----------------------------------------------//\rdefine('POST_REVISIONS_TABLE',		$table_prefix . 'post_revisions');\r//-- end: Prime Post Revisions ----------------------------------------------//
includes/functions_admin.php

Code: Select all

:%s#.*$table_ary = array(POSTS_TABLE, REPORTS_TABLE);.*#&\r//-- mod: Prime Post Revisions ----------------------------------------------//\r	$table_ary[] = POST_REVISIONS_TABLE; // To delete the post's edit history\r//-- end: Prime Post Revisions ----------------------------------------------//
posting.php

Code: Select all

:%s#.*$data\['topic_replies'\] = \$post_data\['topic_replies'\];.*#&\r//-- mod: Prime Post Revisions ----------------------------------------------//\r				include($phpbb_root_path . 'includes/prime_post_revisions.' . $phpEx);\r				store_post_revision_info($data, $post_data);\r//-- end: Prime Post Revisions ----------------------------------------------//
viewtopic.php

Code: Select all

:%s#.*\$max_post_time = 0;.*#&\r//-- mod: Prime Post Revisions ----------------------------------------------//\rinclude($phpbb_root_path . 'includes/prime_post_revisions.' . $phpEx);\r$prime_post_revisions = new prime_post_revisions($post_list, $forum_id, $topic_id, $post_id);\r//-- end: Prime Post Revisions ----------------------------------------------//

Code: Select all

:%s#\s*\/\/ Posts are stored in the \$rowset.*#//-- mod: Prime Post Revisions ----------------------------------------------//\r$prime_post_revisions->get_revision_info($post_list, $result, $viewtopic_url, $viewtopic_title);\r//-- end: Prime Post Revisions ----------------------------------------------//\r&

Code: Select all

:%s#\s*\/\/ Posts are stored in the \$rowset array while \$attach_list, \$user_cache\n\/\/ and the global bbcode_bitfield are built\nwhile (\$row = \$db->sql_fetchrow(\$result))\n\s*{.*#&\r//-- mod: Prime Post Revisions ----------------------------------------------//\r	$prime_post_revisions->merge_revision_info($post_list, $result, $row);\r//-- end: Prime Post Revisions ----------------------------------------------//

Code: Select all

:%s#\s*// Editing information.*#//-- mod: Prime Post Revisions ----------------------------------------------//\r	$prime_post_revisions->set_edit_count($row);\r//-- end: Prime Post Revisions ----------------------------------------------//\r&

Code: Select all

:%s#.*\$l_edit_time_total = (\$row\['post_edit_count'\] == 1) ? \$user->lang\['EDITED_TIME_TOTAL'\] : \$user->lang\['EDITED_TIMES_TOTAL'\];.*#//-- mod: Prime Post Revisions ----------------------------------------------//\r		$prime_post_revisions->inject_user_data($row);\r//-- end: Prime Post Revisions ----------------------------------------------//\r&

Code: Select all

:%s#.*if (isset(\$cp_row\['row'\]) && sizeof(\$cp_row\['row'\])).*#//-- mod: Prime Post Revisions ----------------------------------------------//\r	$prime_post_revisions->update_postrow($post_list, $i, $rowset, $postrow);\r//-- end: Prime Post Revisions ----------------------------------------------//\r&

Code: Select all

:%s#.*page_header(\$user->lang\['VIEW_TOPIC'\].*#&\r//-- mod: Prime Post Revisions ----------------------------------------------//\r$prime_post_revisions->assign_template_variables($viewtopic_url, $viewtopic_title);\r//-- end: Prime Post Revisions ----------------------------------------------//
Porutchik
I've Been Banned!
Posts: 275
Joined: Sat Dec 31, 2005 11:11 am
Location: Russia, Orenburg (Россия, Оренбург)
Name: Sergey O
Contact:

Re: [RC] Prime Post Revisions - View all edits to posts

Post by Porutchik »

Nice mod! I've translated him to Russian.

COD3M4ST3R-X, I've made ADD-ON for Ajax Quick Edit.
Download ADD-ON for Ajax Quick Edit and Translation on Russian in the folder contrib.
My forum | Advanced Similar Topics
Excuse me please for my awful English. Thanks!. Please do not P.M., ICQ or email me for support help - you won't get any reply. If you have a question or issue, post it in the appropriate forum/topic.
User avatar
COD3M4ST3R-X
Registered User
Posts: 2269
Joined: Sat Aug 02, 2008 5:47 am
Location: Lahore,Pakistan

Re: [RC] Prime Post Revisions - View all edits to posts

Post by COD3M4ST3R-X »

Porutchik wrote:Nice mod! I've translated him to Russian.

COD3M4ST3R-X, I've made ADD-ON for Ajax Quick Edit.
Download ADD-ON for Ajax Quick Edit and Translation on Russian in the folder contrib.
Yes it worked Gr8.Thanks
“Need and struggle are what excite and inspire us.”
Makonde
Registered User
Posts: 1
Joined: Tue Jun 27, 2006 6:55 am

Re: [RC] Prime Post Revisions - View all edits to posts

Post by Makonde »

IPB_Refugee wrote:Hi Ken,

there's a small bug in function prime_post_revisions. Change

Code: Select all

			global $db, $auth, $user, $php_root_path, $phpEx;
to

Code: Select all

			global $db, $auth, $user, $phpbb_root_path, $phpEx;
Regards
Wolfgang
Bug still exists in v1.2.3 downloaded from http://www.absoluteanime.com/admin/mods.htm
User avatar
primehalo
Former Team Member
Posts: 2904
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Post Revisions - View all edits to posts

Post by primehalo »

Thanks for pointing this out.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
DoYouSpeakWak
Registered User
Posts: 2310
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Contact:

Re: [RC] Prime Post Revisions - View all edits to posts

Post by DoYouSpeakWak »

Same here thx.

Another idea i had last night while installing this on a board with 6K users. How much extra info does this mod add to the database. As i can see on our board at least most dont edit there post so thats good. But still i would love a feature that said. "if less than X letters are changed then dont save revision" or something like that. Like the subject feature just more advanced.

And i also saw those magic words to delete all revisions. how does that work, that solution could be a good way if no extra features are added to come around this.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid services. 10+ years of experience with phpBB3 and as System Administrator.
User avatar
DoYouSpeakWak
Registered User
Posts: 2310
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Contact:

Re: [RC] Prime Post Revisions - View all edits to posts

Post by DoYouSpeakWak »

We got a strange error today on our board. See more here http://www.phpbb.com/community/viewtopi ... &t=1426155

Pst revisions was included in the error, so i thought i might just ask in here as well.

Code: Select all

SQL ERROR [ mysql4 ]

Incorrect string value: '\xEF\xBF\xBDte ...' for column 'post_subject' at row 1 [1366]

SQL

INSERT INTO phpbb_post_revisions (post_id, post_subject, post_text, bbcode_uid, post_edit_time, post_edit_user, post_edit_reason) VALUES (352329, 'Re: Søger DR programmet "de spræ�te sind"', 'wow mand. Hold kæft nogle klaphatte! Læ�sjusk er så �cceptabelt. Når �s job er en andens liv, skal man fandeme gøre �bejdet ordenligt. Skræmmen� historie.\nMht. distribution af det digitaliserede tv-program, er jeg sikker på at n�en her inde fra kan hjælpe me�nogle fif via PM. Om ikke andet kan du dele det op i nogle bider og lægge dem�å youtube�Det tror jeg godt man må med prog�mmer man har optaget fra fjernsynet.', '1fkrp73v', 1232802702, '3289', '')

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal->sql_error()

FILE: includes/prime_post_revisions.php
LINE: 84
CALL: dbal_mysql->sql_query()

FILE: posting.php
LINE: 1100
CALL: store_post_revision_info()
This was only changed after the user above posted his strange signs.
IPB_Refugee wrote:Hi Ken,

there's a small bug in function prime_post_revisions. Change

Code: Select all

			global $db, $auth, $user, $php_root_path, $phpEx;
to

Code: Select all

			global $db, $auth, $user, $phpbb_root_path, $phpEx;
Regards
Wolfgang
Also i wonder if changing the format on some of the files for this mod to UTF-8 without brom could help me some how.... Not sure.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid services. 10+ years of experience with phpBB3 and as System Administrator.
User avatar
primehalo
Former Team Member
Posts: 2904
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Post Revisions - View all edits to posts

Post by primehalo »

I don't know... seems like it must be some kind of encoding issue.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
DoYouSpeakWak
Registered User
Posts: 2310
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Contact:

Re: [RC] Prime Post Revisions - View all edits to posts

Post by DoYouSpeakWak »

Yes i hope it was.

This is how it looked in the database after install of this mod

Image

Got an error. Wrote here

http://www.phpbb.com/community/viewtopi ... &t=1426155

Changed it to this. Now it seems like it works. But since i really have no idea how the error accured to begin with its hard to duplicate. Also added utf8 on the two others.

Image


Additionally i would like to suggest a view code button in each edit when reading the revision, this way the mod or admin could go in an get a copy of an earlier edit with bbcodes and everything. Not just the text. like a qoute button in phpbb3 just view only of course.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid services. 10+ years of experience with phpBB3 and as System Administrator.
fishmanuk
Registered User
Posts: 24
Joined: Fri Feb 16, 2007 6:12 pm

Re: [RC] Prime Post Revisions - View all edits to posts

Post by fishmanuk »

Has anyone installed this for 3.0.4 ?

Sounds like an excellent MOD I have a problem though in the edits

viewtopic.php does not have

Code: Select all

// Posts are stored in the $rowset
it only has the second instance of it

Code: Select all

// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
while ($row = $db->sql_fetchrow($result))
{
Which is the next edit. Can anyone help me out ?


Here is the section of the .xml

Code: Select all

Open: viewtopic.php
Find
Tip: This may be a partial find and not the whole line.

Code:Select All
$max_post_time = 0;
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.

Code:Select All
//-- mod: Prime Post Revisions ----------------------------------------------//
include($phpbb_root_path . 'includes/prime_post_revisions.' . $phpEx);
$prime_post_revisions = new prime_post_revisions($post_list, $forum_id, $topic_id, $post_id);
//-- end: Prime Post Revisions ----------------------------------------------//
<< Hide
Find
Tip: This may be a partial find and not the whole line.

Code:Select All
// Posts are stored in the $rowset
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.

Code:Select All
//-- mod: Prime Post Revisions ----------------------------------------------//
$prime_post_revisions->get_revision_info($post_list, $result, $viewtopic_url, $viewtopic_title);
//-- end: Prime Post Revisions ----------------------------------------------//

<< Hide
Find
Tip: This may be a partial find and not the whole line.

Code:Select All
// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
while ($row = $db->sql_fetchrow($result))
{

Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.

Code:Select All
//-- mod: Prime Post Revisions ----------------------------------------------//
	$prime_post_revisions->merge_revision_info($post_list, $result, $row);
//-- end: Prime Post Revisions ----------------------------------------------//
And here is the relevant bit of viewtopic.php

Code: Select all

$max_post_time = 0;

$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.*, z.friend, z.foe, p.*',

	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		POSTS_TABLE		=> 'p',
	),

	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
		)
	),

	'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
		AND u.user_id = p.poster_id'
));

$result = $db->sql_query($sql);

$now = getdate(time() + $user->timezone + $user->dst - date('Z'));

// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
while ($row = $db->sql_fetchrow($result))
{

EDIT: Doh I am guessing you just put the first one before that line and the second after it. Sorry guys ! Will give it a go
Locked

Return to “[3.0.x] MODs in Development”