[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!
Scam Warning
Locked
Chanty87
Registered User
Posts: 28
Joined: Mon Jul 11, 2005 8:36 pm
Location: NL
Contact:

Re: [BETA] Prime Post Revisions (0.0.4) - View all edits to post

Post by Chanty87 » Thu Jul 10, 2008 10:37 pm

primehalo wrote: I can't get this to happen. Whenever I edit a post, it shows the correct name. Can you provide any other information? Try editing with different users and see what happens.
Works fine when a normal user edits his/her own posts, but when mods and admins edit other users' posts it says it was last edited by "Guest". Also, I recently installed a mod that auto-merges double posts, maybe that's the troublemaker then?

lockylew
Registered User
Posts: 96
Joined: Thu Apr 03, 2008 11:37 pm
Contact:

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

Post by lockylew » Fri Jul 11, 2008 12:31 am

fantastic mod, works great.

is there anything i can do to have it setup so that it dosent log an admin revision?

i don't like my moderators to see what i've changed.

Lew

User avatar
primehalo
Former Team Member
Posts: 2827
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Post Revisions (0.0.4) - View all edits to post

Post by primehalo » Fri Jul 11, 2008 2:10 am

Chanty87 wrote:
primehalo wrote: I can't get this to happen. Whenever I edit a post, it shows the correct name. Can you provide any other information? Try editing with different users and see what happens.
Works fine when a normal user edits his/her own posts, but when mods and admins edit other users' posts it says it was last edited by "Guest". Also, I recently installed a mod that auto-merges double posts, maybe that's the troublemaker then?
I still can't get it to happen, so looks like we'll have to do debugging. Does this happen on both the actual post and on the Viewing Post History page? On the page with the actual post, the username information comes from this code in viewtopic.php:

Code: Select all

            $sql = 'SELECT DISTINCT u.user_id, u.username, u.user_colour
                FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
                WHERE ' . $db->sql_in_set('p.post_id', $post_storage_list) . '
                    AND p.post_edit_count <> 0
                    AND p.post_edit_user <> 0
                    AND p.post_edit_user = u.user_id';
            $result2 = $db->sql_query($sql);
            while ($user_edit_row = $db->sql_fetchrow($result2))
            {
                $post_edit_list[$user_edit_row['user_id']] = $user_edit_row;
            }
            $db->sql_freeresult($result2);
  
You could put a debug statement after this to view the username that it's getting.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm

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

Post by demon327 » Fri Jul 11, 2008 1:52 pm

mm.. it seems i cant delete the correct revision.., i can only delete the orginal and not the edited version..

http://img262.imageshack.us/img262/4143/revjx8.jpg

suggestion: give the revisions a sort of color layer so you can see what the revesion is and what the orginal post ;)

settings:

Code: Select all

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?

User avatar
primehalo
Former Team Member
Posts: 2827
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 » Fri Jul 11, 2008 5:19 pm

demon327 wrote:mm.. it seems i cant delete the correct revision.., i can only delete the orginal and not the edited version..

http://img262.imageshack.us/img262/4143/revjx8.jpg

suggestion: give the revisions a sort of color layer so you can see what the revesion is and what the orginal post ;)

settings:

Code: Select all

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?
On the Viewing Post History page, you can delete the original and all revisions except for the latest, which is the current active post and can be deleted from the normal Viewing Topic page. It sounds like you want a new feature where you can delete the latest revision and then the previous revision will become the current active post. Am I understanding that correctly?

The original post is always at the bottom and the currently active post is always at the top.

Can you do a language translation for me?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm

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

Post by demon327 » Fri Jul 11, 2008 5:37 pm

primehalo wrote: ....
Can you do a language translation for me?
ow, now i got the system how it works :)

although i have a feature request now: store the revisions on a seperate page like you have for posts in the MCP so you can select them with with checkboxes and you only see the revisions and not the others posts ;)

translation in dutch is already done even before you asked it:

Code: Select all

<?php
/**
*
* prime_post_revisions [Dutch]
*
* @package language
* @version $Id: prime_post_revisions.php,v 1.0.0 2008/06/24 12:30:00 primehalo Exp $
* @copyright (c) 2007-2008 Ken F. Innes IV
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, array(
	'PRIME_POST_REVISIONS_TITLE'	=> 'Bekijkt berichten geschiedenis',
	'PRIME_POST_REVISIONS_INFO'		=> 'Aangepast door %1$s op %2$s.',
	'PRIME_POST_REVISIONS_EXPLAIN'	=> 'Op deze pagina vindt u alle versies van de post, te beginnen met de meest recente versie.',
	'PRIME_POST_REVISIONS_VIEW'		=> 'Bekijk berichten geschiedenis.',	// Text for the link to view the revision history
	'PRIME_POST_REVISIONS_FIRST'	=> 'Origineel bericht: %s',		// The %s is the post title
	'PRIME_POST_REVISIONS_FINAL'	=> 'Huidig bericht: %s',		// The %s is the post title
	'PRIME_POST_REVISIONS_COUNT'	=> 'Revisie %d: %s',		// The %s is the post title


	'PRIME_POST_REVISIONS_DELETE'			=> 'Verwijder revisie',
	'PRIME_POST_REVISIONS_DELETE_CONFIRM'	=> 'Weet u zeker dat u deze revisie wilt verwijderen? ',
	'PRIME_POST_REVISIONS_DELETE_DENIED'	=> 'Je hebt je beschikt niet over voldoende permissies om deze revisie te verwijderen.',
	'PRIME_POST_REVISIONS_DELETE_FAILED'	=> 'Er is een fout opgetreden bij het verwijderen van de revisie.',
	'PRIME_POST_REVISIONS_DELETE_SUCCESS'	=> 'De revisie is met succes verwijderd!.',
	'PRIME_POST_REVISIONS_DELETE_INVALID'	=> 'Geen revisie berichten geselecteerd om te verwijderen.',

Chanty87
Registered User
Posts: 28
Joined: Mon Jul 11, 2005 8:36 pm
Location: NL
Contact:

Re: [BETA] Prime Post Revisions (0.0.4) - View all edits to post

Post by Chanty87 » Fri Jul 11, 2008 6:13 pm

primehalo wrote:
Chanty87 wrote:
primehalo wrote: I can't get this to happen. Whenever I edit a post, it shows the correct name. Can you provide any other information? Try editing with different users and see what happens.
Works fine when a normal user edits his/her own posts, but when mods and admins edit other users' posts it says it was last edited by "Guest". Also, I recently installed a mod that auto-merges double posts, maybe that's the troublemaker then?
I still can't get it to happen, so looks like we'll have to do debugging. Does this happen on both the actual post and on the Viewing Post History page? On the page with the actual post, the username information comes from this code in viewtopic.php:

Code: Select all

            $sql = 'SELECT DISTINCT u.user_id, u.username, u.user_colour
                FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
                WHERE ' . $db->sql_in_set('p.post_id', $post_storage_list) . '
                    AND p.post_edit_count <> 0
                    AND p.post_edit_user <> 0
                    AND p.post_edit_user = u.user_id';
            $result2 = $db->sql_query($sql);
            while ($user_edit_row = $db->sql_fetchrow($result2))
            {
                $post_edit_list[$user_edit_row['user_id']] = $user_edit_row;
            }
            $db->sql_freeresult($result2);
  
You could put a debug statement after this to view the username that it's getting.
Strangely enough it's just on the actual post, not on the Post History page...

User avatar
primehalo
Former Team Member
Posts: 2827
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 » Fri Jul 11, 2008 11:45 pm

Thanks, that helped me narrow things down and find the cause. I just got it fixed and uploaded version 1.0.1. Update instructions are in the config folder.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

Chanty87
Registered User
Posts: 28
Joined: Mon Jul 11, 2005 8:36 pm
Location: NL
Contact:

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

Post by Chanty87 » Sat Jul 12, 2008 4:40 pm

Thanks, I just updated it. But viewtopic.php now returns a fatal error:

Code: Select all

[b]Fatal error:[/b] Call to undefined method prime_post_revisions::inject_user_data()

User avatar
primehalo
Former Team Member
Posts: 2827
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 » Sat Jul 12, 2008 6:05 pm

Sounds like you didn't copy over the new includes/prime_post_revisions.php. And you might want tod download the package again, because I just noticed one line that I forgot to uncomment when I was testing. It won't cause anything to go wrong if you don't, as the line only helps prevent an extra SQL query from taking place in some situations.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

Chanty87
Registered User
Posts: 28
Joined: Mon Jul 11, 2005 8:36 pm
Location: NL
Contact:

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

Post by Chanty87 » Sat Jul 12, 2008 8:27 pm

Ah, yes, I forgot that ;) It's fixed now, thanks!

ibelphegor
Registered User
Posts: 453
Joined: Wed Oct 24, 2007 8:37 am

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

Post by ibelphegor » Sat Jul 12, 2008 10:41 pm

Hi primehalo,
Do you think you will add "delete after X day" soon?

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 » Thu Jul 17, 2008 10:20 pm

Hi Ken,

I love this MOD! :)

But nontheless here is a bug report: I upgraded my testboard from version 2 of phpBB. Most times your MOD works correctly. But when you edit a post that had already been edited in the good old days of phpBB-2, you get an error.

First, the number of edits is not counted correctly. E.g. my moderator had edited one of his posts 5 times before I upgraded my testboard to Olympus. When I edit this post now, it still tells "Edited 5 times, last edited by IPB_Refugee on 17.07.2008, 17:30."

When I click on the link to view the post revision history, I get this error:
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1392: Undefined index: 2
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3688: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3690: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3691: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3692: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
Regardless this error message, the history of edits is displayed correctly.

Now a feature request: A link to truncate the table phpbb_post_revisions would be great. This link could be placed in the forum rules section of the post revisions page but should only be visible/usable for founders.

Last not least here is my german translation of prime_post_revisions.php for the folder
language/de/mods: click here

Regards
Wolfgang

EDIT: A very small cosmetical change I'd like to suggest for function assign_template_variables:

Code: Select all

					'PAGE_TITLE'			=> ($viewtopic_title != '') ? $user->lang['PRIME_POST_REVISIONS_TITLE'] . ' - ' . $viewtopic_title : $user->lang['PRIME_POST_REVISIONS_TITLE'],

					'TOPIC_TITLE'			=> ($viewtopic_title != '') ? $user->lang['PRIME_POST_REVISIONS_TITLE'] . ' - ' . $viewtopic_title : $user->lang['PRIME_POST_REVISIONS_TITLE'],

User avatar
primehalo
Former Team Member
Posts: 2827
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 » Sun Jul 20, 2008 8:25 am

I don't know what's on line 1392 of your viewtopic.php. Care to share? And are you using the latest version of the MOD?

You can have a blank topic title? How would you click on it to actually view the topic?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

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 » Sun Jul 20, 2008 5:48 pm

Hi Ken,

here is my viewtopic.php: http://home.twin.at/wolfgang/viewtopic.txt
primehalo wrote:You can have a blank topic title? How would you click on it to actually view the topic?
No, I can't have a blank topic title but I can have blank message titles (I'm not talking about the first post in a topic) and then the cosmetical problem does occur. (At least in my case.)

Thanks for your help!
Wolfgang

EDIT:

Maybe I should mention that I have debug mode enabled in config.php. Therefore I sometimes see errors (or problematical pieces of code) others don't see. E.g.: http://www.phpbb.com/community/viewtopi ... 5#p6246495

Locked

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