[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
User avatar
primehalo
Former Team Member
Posts: 2828
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 » Tue Mar 01, 2011 9:24 pm

Ashley.S. wrote:Hey Primehalo,

Do you have any idea how overnight, the mod could suddenly just crash and cause this error to happen:

Code: Select all

General Error
SQL ERROR [ mysqli ]

Unknown table engine 'InnoDB' [1286]

SQL

SELECT r.post_id, r.post_edit_time, r.post_edit_user, u.* FROM (phpbb_post_revisions r, phpbb_users u) WHERE r.post_id IN (6365, 6372) AND r.post_edit_user = u.user_id

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/prime_post_revisions.php
LINE: 133
CALL: dbal_mysqli->sql_query()

FILE: viewtopic.php
LINE: 1037
CALL: prime_post_revisions->prime_post_revisions()
I had to remove the table completely & re-create it in order to get rid of the error, I'm using version 1.2.5c right now. Any ideas what could have happened?
No idea, I've never seen that error before.
artikkk wrote:in viewtopic.php
Find:

Code: Select all

page_header($user->lang['VIEW_TOPIC']
add after

Code: Select all

//-- mod: Prime Post Revisions ----------------------------------------------//
$prime_post_revisions->assign_template_variables($viewtopic_url, $viewtopic_title);
//-- end: Prime Post Revisions ----------------------------------------------//
but page_header($user->lang['VIEW_TOPIC'] there isn't in my viewtopic.php :shock: :shock:
Help me
It is near the bottom of the file. I think it's about 10 lines up from the bottom of the file.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

artikkk
Registered User
Posts: 379
Joined: Sun Jan 04, 2009 1:37 pm
Location: Roma

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

Post by artikkk » Tue Mar 01, 2011 9:42 pm

i've this

Code: Select all

page_header($topic_data['topic_title'], true, $forum_id);
sorry for my bad english :S

User avatar
primehalo
Former Team Member
Posts: 2828
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 » Tue Mar 01, 2011 9:47 pm

Yes, that's the correct line.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

artikkk
Registered User
Posts: 379
Joined: Sun Jan 04, 2009 1:37 pm
Location: Roma

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

Post by artikkk » Tue Mar 01, 2011 9:52 pm

Italian :)

Code: Select all

<?php
/**
*
* prime_post_revisions [Italian_artikkk]
*
* @package language
* @version $Id: prime_post_revisions.php,v 1.2.0 2008/07/21 13:45: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(
	// Viewing posts
	'PRIME_POST_REVISIONS_VIEW'				=> 'Guarda storia messaggio.',	// Text for the link to view the revision history

	// Viewing revisions
	'PRIME_POST_REVISIONS_VIEWING'			=> 'Sta guardando la storia del messaggio',
	'PRIME_POST_REVISIONS_VIEWING_EXPLAIN'	=> 'Questa pagina mostra tutte le versioni del messaggio, dal post originale a quello finale.',
	'PRIME_POST_REVISIONS_TITLE'			=> 'Sta guardando la storia del messaggio: %s',	// The %s is the post title
	'PRIME_POST_REVISIONS_FIRST'			=> 'Messaggio originale: %s',			// The %s is the post title
	'PRIME_POST_REVISIONS_FINAL'			=> 'Messaggio attuale: %s',			// The %s is the post title
	'PRIME_POST_REVISIONS_COUNT'			=> 'Revisione %d: %s',			// The %s is the post title
	'PRIME_POST_REVISIONS_INFO'				=> 'Modificato da %1$s il %2$s.',
	'PRIME_POST_REVISIONS_NO_SUBJECT'		=> '[nessun soggetto]',	

	// Delete a revision
	'PRIME_POST_REVISIONS_DELETE'			=> 'Cancella revisione',
	'PRIME_POST_REVISIONS_DELETE_CONFIRM'	=> 'Sei sicuro di voler cancellare questa revisione?',
	'PRIME_POST_REVISIONS_DELETE_DENIED'	=> 'Non hai i permessi necessari per eliminare questa revisione.',
	'PRIME_POST_REVISIONS_DELETE_FAILED'	=> 'Si e\' verificato un errore mentre si cercava di eliminare la revisione.',
	'PRIME_POST_REVISIONS_DELETE_SUCCESS'	=> 'Revisione rimossa con successo.',
	'PRIME_POST_REVISIONS_DELETE_INVALID'	=> 'Nessuna revisione del messaggio e\' stata seleziona per la rimozione.',

	// Delete all revisions
	'PRIME_POST_REVISIONS_DELETES'			=> 'Cancella tutte le revisioni.',
	'PRIME_POST_REVISIONS_DELETES_CONFIRM'	=> 'Sei sicuro di voler cancellare queste revisioni?',
	'PRIME_POST_REVISIONS_DELETES_DENIED'	=> 'Non hai i permessi necessari per eliminare queste revisioni.',
	'PRIME_POST_REVISIONS_DELETES_FAILED'	=> 'Si e\' verificato un errore mentre si cercava di eliminare queste revisioni.',
	'PRIME_POST_REVISIONS_DELETES_SUCCESS'	=> 'Revisioni rimosse con successo.',
	'PRIME_POST_REVISIONS_DELETES_INVALID'	=> 'Nessuna revisione del messaggio e\' stata seleziona per la rimozione.',
));

?>
sorry for my bad english :S

User avatar
primehalo
Former Team Member
Posts: 2828
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 » Tue Mar 01, 2011 10:12 pm

thanks
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Ashley.S.
Registered User
Posts: 468
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

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

Post by Ashley.S. » Tue Mar 01, 2011 10:47 pm

primehalo wrote:
Ashley.S. wrote:Hey Primehalo,

Do you have any idea how overnight, the mod could suddenly just crash and cause this error to happen:

Code: Select all

General Error
SQL ERROR [ mysqli ]

Unknown table engine 'InnoDB' [1286]

SQL

SELECT r.post_id, r.post_edit_time, r.post_edit_user, u.* FROM (phpbb_post_revisions r, phpbb_users u) WHERE r.post_id IN (6365, 6372) AND r.post_edit_user = u.user_id

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/prime_post_revisions.php
LINE: 133
CALL: dbal_mysqli->sql_query()

FILE: viewtopic.php
LINE: 1037
CALL: prime_post_revisions->prime_post_revisions()
I had to remove the table completely & re-create it in order to get rid of the error, I'm using version 1.2.5c right now. Any ideas what could have happened?
No idea, I've never seen that error before.
ok never mind then. I'll keep an eye out and see if it happens again but to resolve it I had to delete the table, re-create it and then I restored the data from that table from a recent backup so hopefully it won't happen again.
Regards,
-Ashley.S. [ ProphpBB Free Forum Hosting Moderator ]

indra
Registered User
Posts: 104
Joined: Fri Dec 31, 2010 8:20 am
Location: North Sumatra - Indonesia
Name: Indra Gunawan
Contact:

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

Post by indra » Thu Mar 03, 2011 5:59 am

Another great MOD, primehalo! Thank you!

User avatar
Acorn
Registered User
Posts: 397
Joined: Tue Sep 26, 2006 8:11 am
Location: UK
Contact:

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

Post by Acorn » Thu Mar 03, 2011 5:51 pm

Hi
Just installed this on a shiny new installation (I've had it on three other boards, never any problems).

It appears to be working, but when I click to see the post history I get a page with all the usual stuff - the 'Viewing Post History' box etc - but the posts themselves are missing. At the top of the page I have the error message, "[phpBB Debug] PHP Notice: in file /includes/prime_post_revisions.php on line 436: array_merge() [function.array-merge]: Argument #2 is not an array"

Thanks. :?
Getting braver all the time. :D

User avatar
primehalo
Former Team Member
Posts: 2828
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 » Tue Mar 08, 2011 8:22 am

That is a very strange error. I believe this is the line the error is referring to:

Code: Select all

                $row = array_merge($this->current_post, $row); 
Argument #2 is $row, which is passed into the merge_revision_info function:

Code: Select all

while ($row = $db->sql_fetchrow($result))
{
//-- mod: Prime Post Revisions ----------------------------------------------//
    $prime_post_revisions->merge_revision_info($post_list, $result, $row);
//-- end: Prime Post Revisions ----------------------------------------------//
    // Set max_post_time
    if ($row['post_time'] > $max_post_time)
    {
        $max_post_time = $row['post_time'];
    } 
If $row was empty, it would not reach that code. So for some reason it's not empty but also not an array, which is strange. The default phpbb3 doesn't even bother to check if $row is an array, which I take to mean it should always be an array.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Acorn
Registered User
Posts: 397
Joined: Tue Sep 26, 2006 8:11 am
Location: UK
Contact:

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

Post by Acorn » Tue Mar 08, 2011 12:55 pm

:( Do you have any suggestions?

Is this likely to be caused by another mod? It is a fresh installation, unused, new database, but with 12 mods including this one, and a customised style (my own).

I tried deleting the table from the database and re-running the database update file, but the result is the same.
Getting braver all the time. :D

User avatar
primehalo
Former Team Member
Posts: 2828
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 » Tue Mar 08, 2011 8:59 pm

It's possible that another MOD had something to do with it, though I couldn't say how likely it is, unless one of those MODs is actually modifying the $row variable before it's passed into my MOD. As you can see in the code snippet, my code comes directly after the $row variable gets set.

I don't think messing with database tables will help. The problem seems to be on this line:
while ($row = $db->sql_fetchrow($result))

Try adding debug code to find out why $row is not an array. It should always be either an array or FALSE.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Acorn
Registered User
Posts: 397
Joined: Tue Sep 26, 2006 8:11 am
Location: UK
Contact:

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

Post by Acorn » Thu Mar 31, 2011 4:19 pm

I'm afraid I don't know how to add debug code - or what to do with the result if I do. Is it straightforward enough for you to talk me through it?

I've uninstalled and re-installed and am still getting the same error.
Getting braver all the time. :D

User avatar
primehalo
Former Team Member
Posts: 2828
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 » Mon Apr 04, 2011 8:47 am

It's not that difficult but I don't really have the time to do it right now as I have a whole lot of work I need to get done in the next few weeks. There are a lot of knowledgeable people on these forums, I'm sure if you ask someone would have the time to show you how.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Acorn
Registered User
Posts: 397
Joined: Tue Sep 26, 2006 8:11 am
Location: UK
Contact:

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

Post by Acorn » Mon Apr 04, 2011 7:47 pm

I am a complete idiot. :oops: :oops: :oops:

Somehow I had added

Code: Select all

//-- mod: Prime Post Revisions ----------------------------------------------//
    $prime_post_revisions->merge_revision_info($post_list, $result, $row);
//-- end: Prime Post Revisions ----------------------------------------------//
before

Code: Select all

while ($row = $db->sql_fetchrow($result))
{
instead of after it.

And somehow I uninstalled the whole thing and reinstalled it, making exactly the same mistake. :oops: I'm better than that usually, honest!

Thanks very much for your help - without you pointing out which bit of code was causing the problem I'm not sure I would have got there. :D
Getting braver all the time. :D

mazeteam
Registered User
Posts: 76
Joined: Thu Apr 20, 2006 1:45 am
Location: York, UK
Contact:

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

Post by mazeteam » Tue Apr 05, 2011 2:27 am

I have been using this mod on my forum for a while... but it is required that the post revisions link be a bit more discreet on the forum.

Instead of saying "this post was last edited by {xx} on {dd} - view post revisions" and then a link, I instead want just a simple image that can be clicked.

I am halfway through but need a bit of help finalising.

In file "includes/prime_post_revisions.php" I have made the following line of change on line 570:

Code: Select all

$l_edited_link = '<a href="' . append_sid("viewtopic.$phpEx", "p={$row['post_id']}&display_history=true") . '" class="view_edits">' . $user->lang['PRIME_POST_REVISIONS_IMG'] . '</a>';
- whereby PRIME_POST_REVISIONS_IMG has replaced the previous "PRIME_POST_REVISIONS_VIEW" identifier, which was the text saying "view post history".

This corresponds to a change I have made in "language/en/mods/prime_post_revisions.php", whereby I have added in

Code: Select all

'PRIME_POST_REVISIONS_IMG'				=> '<img src="/forum/images/upload_icons/txt.gif" title="This post has been edited by the user stated, click this image to View Post History."/>',

So what this is doing is still saying "Last edited by {xx} on {dd}, edited {y} times in total." but is then followed by the image which is clickable for the viewing revisions page.


NOW, what I want to do is to get rid of the text before the clickable image, and instead have it in the "title" field of the image: so that all that shows is the small icon, and when the mouse is hovered over it then a tooltip shows and that states "Last edited by {xx} on {dd}, edited {y} times in total... click image to view post revisions".

So, how can I go about doing this as simply as possible? (even if it means splitting the html for the image into the opening section before the "title" field as one identifier, and the closing IMG tag after the "title" field as a seperate identifier)
Have you not heard? it was my understanding that everybody had heard...

Locked

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