Page 11 of 21

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

Posted: Tue Dec 02, 2008 7:51 pm
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

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

Posted: Tue Dec 02, 2008 8:36 pm
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

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

Posted: Wed Dec 03, 2008 1:59 pm
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

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

Posted: Fri Dec 05, 2008 12:00 am
by jmaraujo
Thanks for this excellent MOD, primehalo! :D

In my opinion this should be included by default with all phpBB3 versions.

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

Posted: Mon Dec 22, 2008 4:05 pm
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

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

Posted: Wed Jan 14, 2009 1:26 am
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 ----------------------------------------------//

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

Posted: Wed Jan 14, 2009 2:06 pm
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.

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

Posted: Wed Jan 14, 2009 2:22 pm
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

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

Posted: Thu Jan 15, 2009 10:42 am
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

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

Posted: Thu Jan 15, 2009 6:48 pm
by primehalo
Thanks for pointing this out.

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

Posted: Wed Jan 21, 2009 3:58 pm
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.

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

Posted: Sat Jan 24, 2009 1:46 pm
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.

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

Posted: Mon Jan 26, 2009 3:43 am
by primehalo
I don't know... seems like it must be some kind of encoding issue.

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

Posted: Tue Jan 27, 2009 6:47 pm
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.

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

Posted: Sat Apr 11, 2009 11:38 am
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