Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: niko on May 23, 2009, 01:02:36 AM

Title: Post History
Post by: niko on May 23, 2009, 01:02:36 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1841)

Allows to store old versions of posts and viewing edit history of post.
Permission can be set either to own or all posts and it's set by board.

Features
Supported versions: SMF 2.0.x (Tested up to 2.0.2)
Version: 1.0.3 (16.03.2012)
Languages included: English, Finnish, Turkish
Links: SMF Modification Site (http://custom.simplemachines.org/mods/index.php?mod=1841), Support Topic (http://www.simplemachines.org/community/index.php?topic=312474.0), Github (https://github.com/nikop/PostHistory)

License
Copyright (c) 2012, Niko Pahajoki
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Niko Pahajoki nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Niko Pahajoki BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Post History
Post by: Blinker on May 23, 2009, 01:21:51 AM
This is exactly what I was looking for Niko. Any chance of 1.1x compatibility??
Title: Re: Post History
Post by: Eliana Tamerin on May 23, 2009, 01:57:35 AM
Oh wow, Niko, you are amazing. This is exactly the kind of useful mod that we need more of for SMF 2, just simple little mods that add uniquely useful features that SMF would never natively include.

Oh, and Blinker, if you need this feature on SMF 1.1.x, then use this mod instead: http://custom.simplemachines.org/mods/index.php?mod=1007 (http://custom.simplemachines.org/mods/index.php?mod=1007). It adds a 'delete spam post' feature as well, which overwrites the message's content with the spam message, but has the optional side effect of recording all edits of posts in the Recycle Bin.
Title: Re: Post History
Post by: Joe N on May 23, 2009, 04:04:41 AM
Nice Mod Niko!
Title: Re: Post History
Post by: Sudhakar Arjunan on May 23, 2009, 05:29:37 AM
Good mod niko.

History of post would be so helpful for all forum owner as an added features.
Title: Re: Post History
Post by: D.S on May 23, 2009, 09:44:28 AM
Post History is amazing mod, but I have 1.1.x version ,  Any chance of 1.1.x compatibility??
thank u Niko ..
Title: Re: Post History
Post by: Joe N on May 23, 2009, 09:47:03 AM
Quote from: D.S on May 23, 2009, 09:44:28 AM
Post History is amazing mod, but I have 1.1.x version ,  Any chance of 1.1.x compatibility??
thank u Niko ..

Ever read the replies...

Quote from: Eliana Tamerin on May 23, 2009, 01:57:35 AM
Oh wow, Niko, you are amazing. This is exactly the kind of useful mod that we need more of for SMF 2, just simple little mods that add uniquely useful features that SMF would never natively include.

Oh, and Blinker, if you need this feature on SMF 1.1.x, then use this mod instead: http://custom.simplemachines.org/mods/index.php?mod=1007 (http://custom.simplemachines.org/mods/index.php?mod=1007). It adds a 'delete spam post' feature as well, which overwrites the message's content with the spam message, but has the optional side effect of recording all edits of posts in the Recycle Bin.
Title: Re: Post History
Post by: M-DVD on May 23, 2009, 11:02:29 AM
Good MOD, very very usefull :P
Title: Re: Post History
Post by: Nibogo on May 23, 2009, 12:24:36 PM
another great mod :)
Title: Re: Post History
Post by: D.S on May 23, 2009, 06:03:07 PM
Quote from: Joe N on May 23, 2009, 09:47:03 AM
Quote from: D.S on May 23, 2009, 09:44:28 AM
Post History is amazing mod, but I have 1.1.x version ,  Any chance of 1.1.x compatibility??
thank u Niko ..

Ever read the replies...

Quote from: Eliana Tamerin on May 23, 2009, 01:57:35 AM
Oh wow, Niko, you are amazing. This is exactly the kind of useful mod that we need more of for SMF 2, just simple little mods that add uniquely useful features that SMF would never natively include.

Oh, and Blinker, if you need this feature on SMF 1.1.x, then use this mod instead: http://custom.simplemachines.org/mods/index.php?mod=1007 (http://custom.simplemachines.org/mods/index.php?mod=1007). It adds a 'delete spam post' feature as well, which overwrites the message's content with the spam message, but has the optional side effect of recording all edits of posts in the Recycle Bin.


thank u for attract attention
Title: Re: Post History
Post by: Alpay on May 24, 2009, 05:32:42 AM
Hi :)

Turkish translate..

Modifications.turkish.php ;

// Post History Start
$txt['core_settings_item_posthistory'] = 'İleti Geçmişi';
$txt['core_settings_item_posthistory_desc'] = 'Veritabanında ki İleti geçmişleri.';

$txt['view_post_history'] = 'İleti Geçmişini Görüntüle';
$txt['title_view_post_history'] = 'İleti Geçmişi Görüntüleniyor - %1$s';

$txt['ph_last_edit'] = 'Son Düzenleme';
$txt['ph_last_time'] = 'Düzenleme Zamanı';
$txt['ph_view_edit'] = 'Mesajı Görüntüle';

$txt['ph_no_edits'] = 'Konuda henüz bir düzenleme yok';

$txt['permissionname_posthistory_view'] = 'İleti düzenleme geçmişini görüntüle';
$txt['permissionhelp_posthistory_view'] = 'Eski İleti geçmişini görüntüle';
$txt['permissionname_posthistory_view_own'] = 'Kendi Konusu';
$txt['permissionname_posthistory_view_any'] = 'Herhangibir Konuyu';
$txt['permissionname_simple_posthistory_view_own'] = 'Kendi İleti geçmişini düzenleme';
$txt['permissionname_simple_posthistory_view_any'] = 'Herhangibir İleti geçmişini düzenleme';

$txt['cannot_posthistory_view_any'] = 'Bu yazının İleti geçmişi görünmesin!';
// Post History END
Title: Re: Post History
Post by: niko on May 24, 2009, 04:54:23 PM
Quote from: Alpay on May 24, 2009, 05:32:42 AM
Hi :)

Turkish translate..

Modifications.turkish.php ;

// Post History Start
$txt['core_settings_item_posthistory'] = 'İleti Geçmişi';
$txt['core_settings_item_posthistory_desc'] = 'Veritabanında ki İleti geçmişleri.';

$txt['view_post_history'] = 'İleti Geçmişini Görüntüle';
$txt['title_view_post_history'] = 'İleti Geçmişi Görüntüleniyor - %1$s';

$txt['ph_last_edit'] = 'Son Düzenleme';
$txt['ph_last_time'] = 'Düzenleme Zamanı';
$txt['ph_view_edit'] = 'Mesajı Görüntüle';

$txt['ph_no_edits'] = 'Konuda henüz bir düzenleme yok';

$txt['permissionname_posthistory_view'] = 'İleti düzenleme geçmişini görüntüle';
$txt['permissionhelp_posthistory_view'] = 'Eski İleti geçmişini görüntüle';
$txt['permissionname_posthistory_view_own'] = 'Kendi Konusu';
$txt['permissionname_posthistory_view_any'] = 'Herhangibir Konuyu';
$txt['permissionname_simple_posthistory_view_own'] = 'Kendi İleti geçmişini düzenleme';
$txt['permissionname_simple_posthistory_view_any'] = 'Herhangibir İleti geçmişini düzenleme';

$txt['cannot_posthistory_view_any'] = 'Bu yazının İleti geçmişi görünmesin!';
// Post History END


Thanks! Will include in next version (working on new build system which can handle multiple languages)
Title: Re: Post History
Post by: Nibogo on May 25, 2009, 06:50:30 PM
Niko I love this mod works really great in my localhost, but I want to suggest one feature, compare the posts, just like the SMF Wiki

Thanks
Title: Re: Post History
Post by: Oleg Vereshchagin on May 26, 2009, 03:12:19 PM
I have problems using this mod with russian-language-forum (cp1251). Some messages in post history see like "?????????????????????".
Title: Re: Post History
Post by: Eliana Tamerin on May 28, 2009, 02:41:47 PM
Niko, feature suggestion:

Only display the button if the post in question has edits recorded. It would save space on the display template, as most posts on my sites go unedited. This could be cached to save on queries.
Title: Re: Post History
Post by: niko on May 28, 2009, 03:30:42 PM
Quote from: Eliana Tamerin on May 28, 2009, 02:41:47 PM
Niko, feature suggestion:

Only display the button if the post in question has edits recorded. It would save space on the display template, as most posts on my sites go unedited. This could be cached to save on queries.

Will be in next version (0.2).

Quote from: Oleg Vereshchagin on May 26, 2009, 03:12:19 PM
I have problems using this mod with russian-language-forum (cp1251). Some messages in post history see like "?????????????????????".

Are tables in correct character set?
Title: Re: Post History
Post by: Oleg Vereshchagin on May 29, 2009, 04:37:37 AM
Quote from: Niko on May 28, 2009, 03:30:42 PM
Quote from: Oleg Vereshchagin on May 26, 2009, 03:12:19 PM
I have problems using this mod with russian-language-forum (cp1251). Some messages in post history see like "?????????????????????".

Are tables in correct character set?
You are right. The table smf_messages_history was in the Swedish coding.
Title: Re: Post History
Post by: niko on May 29, 2009, 05:56:58 AM
Quote from: Oleg Vereshchagin on May 29, 2009, 04:37:37 AM
Quote from: Niko on May 28, 2009, 03:30:42 PM
Quote from: Oleg Vereshchagin on May 26, 2009, 03:12:19 PM
I have problems using this mod with russian-language-forum (cp1251). Some messages in post history see like "?????????????????????".

Are tables in correct character set?
You are right. The table smf_messages_history was in the Swedish coding.

It means that your database is set to Swedish (mysql default) encoding. Select database and in Operations tab change collation to Russian and all new tables will use Russian encoding. (although it shouldn't cause errors, I recommend backing up before change)
Title: Re: Post History
Post by: niko on June 04, 2009, 04:07:18 AM
Here's translation files for next version. Some new strings.

There is full translation for Finnish language already.
Partial Turkish translation of Alpay (http://www.simplemachines.org/community/index.php?action=profile;u=39002) included with new strings added for translation.

Make sure you save files as UTF-8 without BOM (byteorder mark).
Title: Re: Post History
Post by: niko on September 12, 2009, 05:29:34 AM
0.2 Beta 1 has been added to mod site.

Changelog
0.2

SMF 2.0 RC1.2 tested and supported.
Title: Re: Post History
Post by: Nibogo on September 12, 2009, 12:25:17 PM
Great work Niko!

Really nice job
Title: Re: Post History
Post by: Groundhog on September 12, 2009, 06:17:01 PM
Hi Niko

The mod installed without any errors but after editing a message no edits were recorded. I checked and the post_history folder hadn't been installed. I uploaded it manually and the ran the install.php file but it returned this error message:

Fatal error: Function name must be a string in /home/******/public_html/home/post_history/Subs-Install.php on line 11

I am running v2.0 RC1 and I installed the Post_History_0.1.zip

Did I do something wrong?

Thanks for the help.
Title: Re: Post History
Post by: Eliana Tamerin on September 12, 2009, 10:19:53 PM
Congrats for a new release, Niko! Good work on incorporating my feature request, and a few other good new features. I can't wait to try it out.

If I were to upgrade from 1.0, would 2.0 b1 detect the has_history property on posts already made, or can that only be on posts made after upgrading to 2.0 b1?
Title: Re: Post History
Post by: niko on September 13, 2009, 04:06:41 AM
Quote from: Eliana Tamerin on September 12, 2009, 10:19:53 PM
Congrats for a new release, Niko! Good work on incorporating my feature request, and a few other good new features. I can't wait to try it out.

If I were to upgrade from 1.0, would 2.0 b1 detect the has_history property on posts already made, or can that only be on posts made after upgrading to 2.0 b1?

It does work on old posts too.
Title: Re: Post History
Post by: dakpluto on September 13, 2009, 08:06:18 AM
All I can say is THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU.

Been wanting this on SMF for ages.
Title: Re: Post History
Post by: ttuu on September 13, 2009, 09:38:12 AM
Quote from: Eliana Tamerin on May 23, 2009, 01:57:35 AM
Oh wow, Niko, you are amazing. This is exactly the kind of useful mod that we need more of for SMF 2, just simple little mods that add uniquely useful features that SMF would never natively include.

Oh, and Blinker, if you need this feature on SMF 1.1.x, then use this mod instead: http://custom.simplemachines.org/mods/index.php?mod=1007 (http://custom.simplemachines.org/mods/index.php?mod=1007). It adds a 'delete spam post' feature as well, which overwrites the message's content with the spam message, but has the optional side effect of recording all edits of posts in the Recycle Bin.

its good idea for deleted post but not for edit post.
Title: Re: Post History
Post by: Eliana Tamerin on September 13, 2009, 10:12:19 AM
Quote from: ttuu on September 13, 2009, 09:38:12 AM
Quote from: Eliana Tamerin on May 23, 2009, 01:57:35 AM
Oh wow, Niko, you are amazing. This is exactly the kind of useful mod that we need more of for SMF 2, just simple little mods that add uniquely useful features that SMF would never natively include.

Oh, and Blinker, if you need this feature on SMF 1.1.x, then use this mod instead: http://custom.simplemachines.org/mods/index.php?mod=1007 (http://custom.simplemachines.org/mods/index.php?mod=1007). It adds a 'delete spam post' feature as well, which overwrites the message's content with the spam message, but has the optional side effect of recording all edits of posts in the Recycle Bin.

its good idea for deleted post but not for edit post.

Well, it's a solution, regardless of the lack of polish like this mod has, that works unless/until a mod like this is backported.
Title: Re: Post History
Post by: Shark-Time on September 13, 2009, 10:35:53 AM
nice mod ...can you make one for 1.1.x version..
Title: Re: Post History
Post by: niko on September 13, 2009, 06:10:53 PM
Quote from: Shark-Time on September 13, 2009, 10:35:53 AM
nice mod ...can you make one for 1.1.x version..

No. I don't have time to do.
Title: Re: Post History
Post by: Özgür on September 14, 2009, 05:38:33 AM
Great mod Niko.
I guess Alpay don't have time for update his translate.
This is 2.0 turkish translate.
<?xml version="1.0"?>
<?xml-stylesheet href="modification.xsl" type="text/xsl"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

ATTENTION: If you are trying to install this manually, you should try
the package manager.  If it will not work for you, please take a look
at the following for information on this format:
http://mods.simplemachines.org/docs/manual-install.php

================================================================================

Modification files can be used to modify files so that they do what
your package needs them to do to work properly.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<!-- This information needs to be the same as that in the package-info.xml. -->
<id>Niko:PostHistory</id>
<version>{version}</version>

<file name="$languagedir/Modifications.turkish.php" error="ignore">
<operation>
<search position="end" />
<add><![CDATA[// Post History Start
$txt['core_settings_item_posthistory'] = 'İleti Geçmişi';
$txt['core_settings_item_posthistory_desc'] = 'Veritabanında ki İleti geçmişleri.';

$txt['view_post_history'] = 'İleti Geçmişini Görüntüle';
$txt['title_view_post_history'] = 'İleti Geçmişi Görüntüleniyor - %1$s';

$txt['ph_last_edit'] = 'Son Düzenleme';
$txt['ph_last_time'] = 'Düzenleme Zamanı';
$txt['ph_view_edit'] = 'İletiyi Görüntüle';

// Untranslated
$txt['ph_original_edit'] = 'Orjinal';
// Untranslated
$txt['ph_current_edit'] = 'Şuanki';
// Untranslated
$txt['ph_current_original_edit'] = 'şuanki, original';

$txt['ph_no_edits'] = 'Konuda henüz bir düzenleme yok';

$txt['permissionname_posthistory_view'] = 'İleti düzenleme geçmişini görüntüle';
$txt['permissionhelp_posthistory_view'] = 'Eski İleti geçmişini görüntüle';
$txt['permissionname_posthistory_view_own'] = 'Kendi Konusunu';
$txt['permissionname_posthistory_view_any'] = 'Herhangibir Konuyu';
$txt['permissionname_simple_posthistory_view_own'] = 'Kendi İletilerinin geçmişini düzenleme';
$txt['permissionname_simple_posthistory_view_any'] = 'Herhangibir İletinin geçmişini düzenleme';

$txt['cannot_posthistory_view_any'] = 'Bu yazının ileti geçmişi görünmesin!';
// Post History END]]></add>
</operation>
</file>
</modification>

Title: Re: Post History
Post by: Alpay on September 17, 2009, 02:15:28 PM
Thanks, [Daydreamer] =)

I guess I can not catch up with translations :(
Title: Re: Post History
Post by: Joe N on October 01, 2009, 12:05:27 PM
Quote from: [Daydreamer] on September 14, 2009, 05:38:33 AM
Great mod Niko.
I guess Alpay don't have time for update his translate.
This is 2.0 turkish translate.
<?xml version="1.0"?>
<?xml-stylesheet href="modification.xsl" type="text/xsl"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

ATTENTION: If you are trying to install this manually, you should try
the package manager.  If it will not work for you, please take a look
at the following for information on this format:
http://mods.simplemachines.org/docs/manual-install.php

================================================================================

Modification files can be used to modify files so that they do what
your package needs them to do to work properly.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<!-- This information needs to be the same as that in the package-info.xml. -->
<id>Niko:PostHistory</id>
<version>{version}</version>

<file name="$languagedir/Modifications.turkish.php" error="ignore">
<operation>
<search position="end" />
<add><![CDATA[// Post History Start
$txt['core_settings_item_posthistory'] = 'İleti Geçmişi';
$txt['core_settings_item_posthistory_desc'] = 'Veritabanında ki İleti geçmişleri.';

$txt['view_post_history'] = 'İleti Geçmişini Görüntüle';
$txt['title_view_post_history'] = 'İleti Geçmişi Görüntüleniyor - %1$s';

$txt['ph_last_edit'] = 'Son Düzenleme';
$txt['ph_last_time'] = 'Düzenleme Zamanı';
$txt['ph_view_edit'] = 'İletiyi Görüntüle';

// Untranslated
$txt['ph_original_edit'] = 'Orjinal';
// Untranslated
$txt['ph_current_edit'] = 'Şuanki';
// Untranslated
$txt['ph_current_original_edit'] = 'şuanki, original';

$txt['ph_no_edits'] = 'Konuda henüz bir düzenleme yok';

$txt['permissionname_posthistory_view'] = 'İleti düzenleme geçmişini görüntüle';
$txt['permissionhelp_posthistory_view'] = 'Eski İleti geçmişini görüntüle';
$txt['permissionname_posthistory_view_own'] = 'Kendi Konusunu';
$txt['permissionname_posthistory_view_any'] = 'Herhangibir Konuyu';
$txt['permissionname_simple_posthistory_view_own'] = 'Kendi İletilerinin geçmişini düzenleme';
$txt['permissionname_simple_posthistory_view_any'] = 'Herhangibir İletinin geçmişini düzenleme';

$txt['cannot_posthistory_view_any'] = 'Bu yazının ileti geçmişi görünmesin!';
// Post History END]]></add>
</operation>
</file>
</modification>



Nice
Title: Re: Post History
Post by: Groundhog on October 01, 2009, 04:21:18 PM
Quote from: Groundhog on September 12, 2009, 06:17:01 PM
Hi Niko

The mod installed without any errors but after editing a message no edits were recorded. I checked and the post_history folder hadn't been installed. I uploaded it manually and the ran the install.php file but it returned this error message:

Fatal error: Function name must be a string in /home/******/public_html/home/post_history/Subs-Install.php on line 11

I am running v2.0 RC1 and I installed the Post_History_0.1.zip

Did I do something wrong?

Thanks for the help.

Just wondering if you had any idea   :-\
Title: Re: Post History
Post by: dakpluto on November 12, 2009, 10:06:20 AM
Hoping this comes to RC2 soon.  This is a valuable plugin for my forum.
Title: Re: Post History
Post by: niko on November 13, 2009, 06:11:48 PM
Uploaded version with RC2.0 support. (0.2 Beta 2)
Title: Re: Post History
Post by: Eliana Tamerin on November 13, 2009, 06:29:23 PM
Suggestion, Niko. I've modded my own version to put the link before the Report to moderator link, since I think that makes more sense for the action. It's not modifying the post at all (which the buttons in that strip, aside from Quote, all do in some way), it's just accessing minor information. Which is similar to the IP that's logged for each post.

Plus, with smaller screens and fixed width themes, and even with Curve's new fixed proportions display template (which is a godsend), the buttons generally wind up dropping down to a new line. This isn't an ideal situation, and so I think putting the link down near the Report to moderator link would make more sense and prevent the template from looking cluttered.

Besides, when someone sees the  « Last Edit: Month Day, Year, HH:MM:SS PM by displayname », the link to viewing edits of the post will be right below it and users would connect the two thoughts much easier than if the button were at the top.
Title: Re: Post History
Post by: niko on November 14, 2009, 01:36:47 AM
Quote from: Eliana Tamerin on November 13, 2009, 06:29:23 PM
Suggestion, Niko. I've modded my own version to put the link before the Report to moderator link, since I think that makes more sense for the action. It's not modifying the post at all (which the buttons in that strip, aside from Quote, all do in some way), it's just accessing minor information. Which is similar to the IP that's logged for each post.

Plus, with smaller screens and fixed width themes, and even with Curve's new fixed proportions display template (which is a godsend), the buttons generally wind up dropping down to a new line. This isn't an ideal situation, and so I think putting the link down near the Report to moderator link would make more sense and prevent the template from looking cluttered.

Besides, when someone sees the  « Last Edit: Month Day, Year, HH:MM:SS PM by displayname », the link to viewing edits of the post will be right below it and users would connect the two thoughts much easier than if the button were at the top.

Good idea.
Title: Re: Post History
Post by: dakpluto on November 15, 2009, 08:29:54 AM
Thank you so much for the update!

And I agree with above on the location.  And the most ideal would be like Vbullitien and make the "last edit by" line clickable to the post history.

Oh, and I am have a little history with the current Beta 2.  The link to the post history is there, but there is no visible button.  I can hover my mouse where it should be and find it though.
Title: Re: Post History
Post by: Eliana Tamerin on November 15, 2009, 10:00:12 AM
Quote from: dakpluto on November 15, 2009, 08:29:54 AM
And I agree with above on the location.  And the most ideal would be like Vbullitien and make the "last edit by" line clickable to the post history.

Except SMF has a courtesy time (by default, 90 seconds) to edit before its logged on the post. The View Edits button will show up even if the Last Edit By... line isn't there. So you would miss out on all the edits that took place within 90 seconds.
Title: Re: Post History
Post by: Arcturus on November 19, 2009, 06:32:15 AM
Mod just installed. Can't believe I now have post revisions in my forum. This is totally awesome o_O Thank you very very very very much !
Title: Re: Post History
Post by: DirtRider on December 02, 2009, 09:26:11 AM
Installed it on RC2 shows it is active in Core Features however I don't see the option in the post at all. Is there a setting I am missing
Title: Re: Post History
Post by: DirtRider on December 03, 2009, 10:08:14 PM
Quote from: DirtRider on December 02, 2009, 09:26:11 AM
Installed it on RC2 shows it is active in Core Features however I don't see the option in the post at all. Is there a setting I am missing

Not too worry I have killed the mod seeing it does not seem to work
Title: Re: Post History
Post by: Nibogo on December 03, 2009, 10:20:14 PM
The mod is working great for me, the problem is that the button don't appear, you can click just after the Split Topic button.

So instead of put it back I just make that I can see the post history in the "  « Last Edit: December 03, 2009, 11:37:20 PM by NIBOGO »"

Great job Niko! :)
Title: Re: Post History
Post by: niko on December 04, 2009, 07:29:12 PM
New version released:

Better curve theme, now link is Last Edit line if it's enabled, otherwise it will show link in same place.
Popup is used if possible instead of loading whole new page.
Title: Re: Post History
Post by: Nibogo on December 04, 2009, 07:56:43 PM
Quote from: Niko on December 04, 2009, 07:29:12 PM
New version released:

Better curve theme, now link is Last Edit line if it's enabled, otherwise it will show link in same place.
Popup is used if possible instead of loading whole new page.

Works like a charm!

Thanks Niko

For all the people with the "Reason for Edit" Mod you must edit the part of the Post History Mod on Display.template.php with this code:

// Show last edit + has history?
if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['can_see_history'] && $message['has_history'])
echo '
<a href="', $scripturl, '?action=posthistory;topic=', $context['current_topic'], '.0;msg=', $message['id'], '" onclick="return reqWin(this.href + \';popup\');">&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], ' ', !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '</em> &#187;</a>';
// No last edit but history?
elseif ($message['can_see_history'] && $message['has_history'])
echo '
<a href="', $scripturl, '?action=posthistory;topic=', $context['current_topic'], '.0;msg=', $message['id'], '" onclick="return reqWin(this.href + \';popup\');">&#171; <em>', $txt['view_post_history'], '</em> &#187;</a>';
// or ..last edit but no history?
elseif ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], ' ', !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '</em> &#187;';


Would be nice if you include support for the Reason for Edit Mod, it's a very used mod and as soon as I have time I'll add support on that mod for the Post History, the problem goes when someone has the Reason for Edit Mod installed and try to install this mod.
Title: Re: Post History
Post by: dakpluto on December 05, 2009, 08:44:29 AM
Quote from: dakpluto on November 15, 2009, 08:29:54 AM

And I agree with above on the location.  And the most ideal would be like Vbullitien and make the "last edit by" line clickable to the post history.


!!!!!   Thank you, Thank you, Thank you!
Title: Re: Post History
Post by: Joker™ on December 05, 2009, 11:30:53 PM
do i have to enable any option to make it to work ....

it installed without any errors but i cant see any post history in edited posts anywhere
Title: Re: Post History
Post by: scimmiotto on December 06, 2009, 03:39:25 AM
Hi niko

i've just installed your mod but...where to manage it? and where old post are shown? i cannot see them.

tnx a lot!

Edit: ok i saw that we must click on "last modify" to see the last posts...but where is the administration part?

2nd edit: ok i saw that this administration part is in members permissions.

Tnx a lot, very useful mod  ;D
Title: Re: Post History
Post by: Joker™ on December 06, 2009, 04:10:24 AM
i made the permissions part but still how to see the last edited posts in posts

QuoteEdit: ok i saw that we must click on "last modify" to see the last posts...but where is the administration part?

i cant see any last modify thing in my posts
Title: Re: Post History
Post by: scimmiotto on December 06, 2009, 04:34:25 AM
u must modify a post, AFTER installing the package. Now u will see the string as a link to other posts:

[img=http://s1.postimage.org/bN8dA.jpg] (http://www.postimage.org/image.php?v=gxbN8dA)
Title: Re: Post History
Post by: Joker™ on December 06, 2009, 05:08:57 AM
Quote from: scimmiotto on December 06, 2009, 04:34:25 AM
u must modify a post, AFTER installing the package. Now u will see the string as a link to other posts:

[img=http://s1.postimage.org/bN8dA.jpg] (http://www.postimage.org/image.php?v=gxbN8dA)


thanx for replies .... i thought i will work on old post .... bad from me

it working on my side now ..... thanx once again
Title: Re: Post History
Post by: scimmiotto on December 06, 2009, 02:36:48 PM
no problem, we are all here to help each other :)
Title: Re: Post History
Post by: Boby_ on December 10, 2009, 05:41:24 AM
Very good mod!  Thanks a lot! :)

Is there a chance to implement a "Switch to old version of an edited post" feature in the next versions? :)
Title: Re: Post History
Post by: Eliana Tamerin on December 10, 2009, 07:11:13 AM
Quote from: Boby_ on December 10, 2009, 05:41:24 AM
Very good mod!  Thanks a lot! :)

Is there a chance to implement a "Switch to old version of an edited post" feature in the next versions? :)

Personally I'd just prefer a Quote button on those history pages.
Title: Re: Post History
Post by: t3ngu on December 11, 2009, 05:42:12 PM
Sorry to ask the same question, but I can't find where to edit the permission setting that everyone's talking about. I made a new post and tried to edit it, but the "last editted by" link won't show up.

I'd really like to get this mod to work, thanks in advance.
Title: Re: Post History
Post by: scimmiotto on December 19, 2009, 05:05:59 AM
are there any admin settings in this mod? i cannot see where they are.
Title: Re: Post History
Post by: niko on December 27, 2009, 11:22:27 AM
Quote from: scimmiotto on December 19, 2009, 05:05:59 AM
are there any admin settings in this mod? i cannot see where they are.

No, there are no settings apart from disable or enable. What settings are you looking for?

Next version will have also ability to view diff. See attachment for sneak peek. (It won't parse code in this case)
Title: Re: Post History
Post by: Eliana Tamerin on December 27, 2009, 11:41:52 AM
Niko, I was wondering, any chance to have a quote button or way to access the bbc version of the Edit, so that any malicious edits can be reversed?
Title: Re: Post History
Post by: niko on December 28, 2009, 12:08:00 PM
Quote from: Eliana Tamerin on December 27, 2009, 11:41:52 AM
Niko, I was wondering, any chance to have a quote button or way to access the bbc version of the Edit, so that any malicious edits can be reversed?

Yes. This is another feature added in next version :)

Also if anyone wants to translate, currently only Finnish and English are up to date.

Turkish translation needs updating:

// Post History Start
$txt['core_settings_item_posthistory'] = 'İleti Geçmişi';
$txt['core_settings_item_posthistory_desc'] = 'Veritabanında ki İleti geçmişleri.';

$txt['view_post_history'] = 'İleti Geçmişini Görüntüle';
$txt['title_view_post_history'] = 'İleti Geçmişi Görüntüleniyor - %1$s';

$txt['ph_last_edit'] = 'Son Düzenleme';
$txt['ph_last_time'] = 'Düzenleme Zamanı';
$txt['ph_view_edit'] = 'İletiyi Görüntüle';

$txt['ph_original_edit'] = 'Orjinal';
$txt['ph_current_edit'] = 'Şuanki';
$txt['ph_current_original_edit'] = 'şuanki, original';

$txt['ph_no_edits'] = 'Konuda henüz bir düzenleme yok';

// !!! Untranslated
$txt['compare_selected'] = 'Compare Selected';
// !!! Untranslated
$txt['restore'] = 'Restore';

$txt['permissionname_posthistory_view'] = 'İleti düzenleme geçmişini görüntüle';
$txt['permissionhelp_posthistory_view'] = 'Eski İleti geçmişini görüntüle';
$txt['permissionname_posthistory_view_own'] = 'Kendi Konusunu';
$txt['permissionname_posthistory_view_any'] = 'Herhangibir Konuyu';
// !!! Untranslated
$txt['permissionname_posthistory_restore'] = 'Restore older version';
// !!! Untranslated
$txt['permissionhelp_posthistory_restore'] = 'Allows user to start editing from older version of post.';
// !!! Untranslated
$txt['permissionname_posthistory_restore_own'] = 'Own post';
// !!! Untranslated
$txt['permissionname_posthistory_restore_any'] = 'Any post';
$txt['permissionname_simple_posthistory_view_own'] = 'Kendi İletilerinin geçmişini düzenleme';
$txt['permissionname_simple_posthistory_view_any'] = 'Herhangibir İletinin geçmişini düzenleme';
// !!! Untranslated
$txt['permissionname_simple_posthistory_restore_own'] = 'Restore older version of own post';
// !!! Untranslated
$txt['permissionname_simple_posthistory_restore_any'] = 'Restore older versions of someone else\'s post';

$txt['cannot_posthistory_view_any'] = 'Bu yazının ileti geçmişi görünmesin!';
// !!! Untranslated
$txt['cannot_posthistory_restore_own'] = 'You are not allowed to start editing from older version of your posts!';
// !!! Untranslated
$txt['cannot_posthistory_restore_any'] = 'You are not allowed to start editing from older version of someone else\'s post!';
// Post History END


Or translate into new language:

// Post History Start
$txt['core_settings_item_posthistory'] = 'Post History';
$txt['core_settings_item_posthistory_desc'] = 'Store history of edits of message content into database.';

$txt['view_post_history'] = 'View Edits of Post';
$txt['title_view_post_history'] = 'Viewing Post History for - %1$s';

$txt['ph_last_edit'] = 'Latest Edit By';
$txt['ph_last_time'] = 'Edit Time';
$txt['ph_view_edit'] = 'View Post';

$txt['ph_original_edit'] = 'original';
$txt['ph_current_edit'] = 'current';
$txt['ph_current_original_edit'] = 'current, original';

$txt['ph_no_edits'] = 'No one has edited this post yet';

$txt['compare_selected'] = 'Compare Selected';
$txt['restore'] = 'Restore';

$txt['permissionname_posthistory_view'] = 'View Edit History of Post';
$txt['permissionhelp_posthistory_view'] = 'Allows user to view past versions of post.';
$txt['permissionname_posthistory_view_own'] = 'Own post';
$txt['permissionname_posthistory_view_any'] = 'Any post';
$txt['permissionname_posthistory_restore'] = 'Restore older version';
$txt['permissionhelp_posthistory_restore'] = 'Allows user to start editing from older version of post.';
$txt['permissionname_posthistory_restore_own'] = 'Own post';
$txt['permissionname_posthistory_restore_any'] = 'Any post';
$txt['permissionname_simple_posthistory_view_own'] = 'View edit history of their own post';
$txt['permissionname_simple_posthistory_view_any'] = 'View edit history of someone else\'s post';
$txt['permissionname_simple_posthistory_restore_own'] = 'Restore older version of own post';
$txt['permissionname_simple_posthistory_restore_any'] = 'Restore older versions of someone else\'s post';

$txt['cannot_posthistory_view_any'] = 'You are not allowed to view history of this post!';
$txt['cannot_posthistory_restore_own'] = 'You are not allowed to start editing from older version of your posts!';
$txt['cannot_posthistory_restore_any'] = 'You are not allowed to start editing from older version of someone else\'s post!';
// Post History END
Title: Re: Post History
Post by: Alpay on December 28, 2009, 03:05:46 PM
New Turkish Translation * Niko :

// Post History Start
$txt['core_settings_item_posthistory'] = 'İleti Geçmişi';
$txt['core_settings_item_posthistory_desc'] = 'Veritabanında ki İleti geçmişleri.';

$txt['view_post_history'] = 'İleti Geçmişini Görüntüle';
$txt['title_view_post_history'] = 'İleti Geçmişi Görüntüleniyor - %1$s';

$txt['ph_last_edit'] = 'Son Düzenleme';
$txt['ph_last_time'] = 'Düzenleme Zamanı';
$txt['ph_view_edit'] = 'İletiyi Görüntüle';

$txt['ph_original_edit'] = 'Orjinal';
$txt['ph_current_edit'] = 'Şuanki';
$txt['ph_current_original_edit'] = 'şuanki, original';

$txt['ph_no_edits'] = 'Konuda henüz bir düzenleme yok';


$txt['compare_selected'] = 'Seçilenleri karşılaştırın';

$txt['restore'] = 'Eski Hali';

$txt['permissionname_posthistory_view'] = 'İleti düzenleme geçmişini görüntüle';
$txt['permissionhelp_posthistory_view'] = 'Eski İleti geçmişini görüntüle';
$txt['permissionname_posthistory_view_own'] = 'Kendi Konusunu';
$txt['permissionname_posthistory_view_any'] = 'Herhangibir Konuyu';

$txt['permissionname_posthistory_restore'] = 'İletinin önceki halini düzenleyebilir.';

$txt['permissionhelp_posthistory_restore'] = 'İletinin önceki halini düzenleyebilir.';

$txt['permissionname_posthistory_restore_own'] = 'Kendi İletisini';

$txt['permissionname_posthistory_restore_any'] = 'Herhangi bir iletiyi';
$txt['permissionname_simple_posthistory_view_own'] = 'Kendi İletilerinin geçmişini düzenleme';
$txt['permissionname_simple_posthistory_view_any'] = 'Herhangibir İletinin geçmişini düzenleme';

$txt['permissionname_simple_posthistory_restore_own'] = 'Kendi iletisinin İletinin geçmişini düzenleyebilir';

$txt['permissionname_simple_posthistory_restore_any'] = 'Herhangibir İletinin İletinin geçmişini düzenleyebilir';

$txt['cannot_posthistory_view_any'] = 'Bu yazının ileti geçmişi görüntüleyemezsiniz!';

$txt['cannot_posthistory_restore_own'] = 'Bu İletinin ileti geçmişini düzenleyemezsiniz!';

$txt['cannot_posthistory_restore_any'] = 'Herhangibir İletinin İletinin geçmişini düzenleyemezsiniz!';
// Post History END
Title: Re: Post History
Post by: niko on December 28, 2009, 05:52:19 PM
Thanks, Alpay!
Title: Re: Post History
Post by: Snogmarr on February 26, 2010, 06:55:05 PM
quick question if you dont mind

Am getting an error saying
feature_posthistory.png missing..
Have looked in the zip file and its not there
so is this to do with your mod?
Thanks
Title: Re: Post History
Post by: dakpluto on March 13, 2010, 08:51:47 AM
Need RC3 version :(
Title: Re: Post History
Post by: Snogmarr on March 13, 2010, 12:51:54 PM
guess not
Title: Re: Post History
Post by: niko on March 13, 2010, 02:52:53 PM
0.3 Released with RC3 support!
Title: Re: Post History
Post by: drhamza on March 13, 2010, 04:52:08 PM
thank you very much, beautiful mod, and i see you've developed a lot of stuff, good work

what table this mod depends on? arabic characters appear as questions marks and i need to convert it to utf-8 general
Title: Re: Post History
Post by: Bugo on March 13, 2010, 07:37:49 PM
Please add russian translation. Files in attachments.
Title: Re: Post History
Post by: Eliana Tamerin on March 14, 2010, 02:49:20 PM
Quote from: Niko on March 13, 2010, 02:52:53 PM
0.3 Released with RC3 support!

Getting white pages for some comparisons. Haven't been able to pin down a reason, though. Nothing in the error logs when it happens.
Title: Re: Post History
Post by: TurtleKicker on March 15, 2010, 11:45:43 AM
Awesome mod, can't wait to try this out on my test forum.

While it might be beyond the scope of this mod, does anyone know of a way to extend the functionality to deleted posts? That way, I could let users remove their own posts completely but still have a log of what was there before.

It doesn't have to be elegant. Even if it was something like a hidden "Recycle bin" board that all posts deleted by anyone other than an admin get moved to.
Title: Re: Post History
Post by: TurtleKicker on March 15, 2010, 12:09:09 PM
Update:

After installing this mod (SMF2 RC3), I get the following error when trying to Modify a post:


Database Error
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'ifnull'
File: /********/Sources/Post.php
Line: 730
Title: Re: Post History
Post by: Kolya on March 15, 2010, 08:08:01 PM
I installed the mod and it works flawlessly, but I would like to see 2 more features:

- add a permission to delete history items (eg by moderators)
- add a setting that allows to disregard edits which have been made within the grace period (Courtesy edit wait time)

Good work Niko and very much needed on my forums, I sent a donation your way.
Title: Re: Post History
Post by: niko on March 17, 2010, 01:27:47 PM
Quote from: Bugo on March 13, 2010, 07:37:49 PM
Please add russian translation. Files in attachments.

Is this complete translation? I did not add prev as it was missing some new strings added in 0.3

Quote from: Kolya on March 15, 2010, 08:08:01 PM
I installed the mod and it works flawlessly, but I would like to see 2 more features:

- add a permission to delete history items (eg by moderators)
- add a setting that allows to disregard edits which have been made within the grace period (Courtesy edit wait time)

Good work Niko and very much needed on my forums, I sent a donation your way.

Very possible ideas

Quote from: sremick on March 15, 2010, 11:45:43 AM
Awesome mod, can't wait to try this out on my test forum.

While it might be beyond the scope of this mod, does anyone know of a way to extend the functionality to deleted posts? That way, I could let users remove their own posts completely but still have a log of what was there before.

It doesn't have to be elegant. Even if it was something like a hidden "Recycle bin" board that all posts deleted by anyone other than an admin get moved to.

Might happen in future. I have had plans to do this as separate mod.

Quote from: sremick on March 15, 2010, 12:09:09 PM
Update:

After installing this mod (SMF2 RC3), I get the following error when trying to Modify a post:


Database Error
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'ifnull'
File: /********/Sources/Post.php
Line: 730

Quote from: drhamza on March 13, 2010, 04:52:08 PM
thank you very much, beautiful mod, and i see you've developed a lot of stuff, good work

what table this mod depends on? arabic characters appear as questions marks and i need to convert it to utf-8 general

smf_posts_history has wrong collation (ie latin or othet local encoding instead of utf8). To avoid this you should change database collation so every new one will get utf8 collation. (or otherway it's utf8 insted of whatever is your local encoding). This has been reported as a bug to get pckage functions to ensure correct collation.
Title: Re: Post History
Post by: TurtleKicker on March 17, 2010, 02:07:51 PM
Quote from: Niko on March 17, 2010, 01:27:47 PM
Might happen in future. I have had plans to do this as separate mod.
Actually, now that I look deeper into it, it looks like SMF already has this functionality built-in...? Or am I missing something? I tried it and it seems to work (for both individual posts and entire threads).

Quotesmf_posts_history has wrong collation (ie latin or othet local encoding instead of utf8). To avoid this you should change database collation so every new one will get utf8 collation. (or otherway it's utf8 insted of whatever is your local encoding). This has been reported as a bug to get pckage functions to ensure correct collation.
Well there's no "smf_posts_history" table but there is an "smf_messages_history"... is that what you meant? Anyhow, I'm still confused because both say "utf8"... smf_messages_history is "utf8_unicode_ci" at the moment, while some others are "utf8_general_ci".

Still not clear on what I need to do to fix this...
Title: Re: Post History
Post by: Kolya on March 17, 2010, 07:00:22 PM
Yeah, there already is a "Recycle bin" board function in SMF.

Here's one more suggestion for Post History:
When writing a post I would like to be able to set a bit in the [Additional Options...] that makes the history of this post visible for everyone.

That way I could show the history eg of a FAQ, to users who generally aren't allowed to see post histories.
And a user who gets accused of having edited out some important part of his post (it happens) could then retroactively set this bit and show the history of his post to anyone.
Title: Re: Post History
Post by: niko on March 18, 2010, 12:56:56 PM
Quote from: Kolya on March 17, 2010, 07:00:22 PM
Yeah, there already is a "Recycle bin" board function in SMF.

I think he meant like vbulletin has soft delete, posts history could be viewed from topic it was in.
Title: Re: Post History
Post by: TurtleKicker on March 18, 2010, 01:07:00 PM
Quote from: Niko on March 18, 2010, 12:56:56 PM
I think he meant like vbulletin has soft delete, posts history could be viewed from topic it was in.

Not sure which "he" you're referring to, but for myself I think that the Recycle Bin function I now found in SMF is sufficient. :)

Anyway, still need help on the last part of my post:
http://www.simplemachines.org/community/index.php?topic=312474.msg2543632#msg2543632

Title: Re: Post History
Post by: Eliana Tamerin on March 18, 2010, 04:11:07 PM
Niko, miss this one? Or can't reproduce?

Quote from: Eliana Tamerin on March 14, 2010, 02:49:20 PM
Quote from: Niko on March 13, 2010, 02:52:53 PM
0.3 Released with RC3 support!

Getting white pages for some comparisons. Haven't been able to pin down a reason, though. Nothing in the error logs when it happens.
Title: Re: Post History
Post by: Kolya on March 18, 2010, 05:38:27 PM
That happened to me too, just one time though, so I thought it was a network problem.
Title: Re: Post History
Post by: Eliana Tamerin on March 19, 2010, 12:05:59 PM
I can replicate it, I just can't consistently reproduce it. It seems tied to certain comparison combinations on my forum's posts.
Title: Re: Post History
Post by: niko on March 20, 2010, 02:01:31 PM
Quote from: Eliana Tamerin on March 18, 2010, 04:11:07 PM
Niko, miss this one? Or can't reproduce?

Quote from: Eliana Tamerin on March 14, 2010, 02:49:20 PM
Quote from: Niko on March 13, 2010, 02:52:53 PM
0.3 Released with RC3 support!

Getting white pages for some comparisons. Haven't been able to pin down a reason, though. Nothing in the error logs when it happens.

Haven't had time to try to reproduce
Title: Re: Post History
Post by: MordyT on March 22, 2010, 08:28:32 PM
tagged. Thanks for the great mod!
Title: Re: Post History
Post by: Kolya on March 23, 2010, 03:50:57 AM
Quote from: Niko on March 20, 2010, 02:01:31 PM
Quote from: Eliana Tamerin on March 14, 2010, 02:49:20 PM
Getting white pages for some comparisons. Haven't been able to pin down a reason, though. Nothing in the error logs when it happens.

Haven't had time to try to reproduce

Apparently it cannot handle posts that contain quotes in the last version.


Unrelated to this, I'm still very interested in a post-centric permission to show the history to anyone (as opposed to view history in the current user-centric permission system). Like a check-box when posting.
Title: Re: Post History
Post by: Eliana Tamerin on March 23, 2010, 07:43:43 AM
I've had it occur on posts which do not include quotes.
Title: Re: Post History
Post by: Kolya on March 25, 2010, 08:37:29 AM
That might well be. All I checked was that I could reliably reproduce the error when the latest version of the post contained a quote.
There might still be other ways to trigger this bug, eg a code section or something completely different.
Title: Re: Post History
Post by: flapjack on April 05, 2010, 08:53:45 PM
any chance updating it the way so it will allow to add to custom theme?
Title: Re: Post History
Post by: Eliana Tamerin on April 05, 2010, 09:09:13 PM
You can already add it to a custom theme, that's built into SMF 2. If the mod won't install on a particular theme, then you'll have to manually install it there, or look for support on that theme's support topic.
Title: Re: Post History
Post by: flapjack on April 05, 2010, 09:13:49 PM
for some reason this particular one doesn't give me that option
Title: Re: Post History
Post by: Kolya on May 24, 2010, 07:49:38 PM
Quote from: Niko on March 20, 2010, 02:01:31 PM
Quote from: Eliana Tamerin on March 18, 2010, 04:11:07 PM
Niko, miss this one? Or can't reproduce?

Quote from: Eliana Tamerin on March 14, 2010, 02:49:20 PM
Quote from: Niko on March 13, 2010, 02:52:53 PM
0.3 Released with RC3 support!

Getting white pages for some comparisons. Haven't been able to pin down a reason, though. Nothing in the error logs when it happens.

Haven't had time to try to reproduce

Any updates on this problem?
Title: Re: Post History
Post by: Enders on July 14, 2010, 11:13:07 AM
Quote from: flapjack on April 05, 2010, 08:53:45 PM
any chance updating it the way so it will allow to add to custom theme?

Definately.... Just copy and paste "PostHistory.template.php" from the themes/default to your themes folder.
Title: Re: Post History
Post by: Kolya on November 05, 2010, 07:54:48 AM
This mod still installs on SMF 2.0 RC4 with just a minor change:
In package-info.xml change the line: <install for="2.0 RC3"> to reflect the new version RC4.

If you already had the mod installed before the database tables already exist and you want to comment out the table creation in post_history/install.php like so: //doTables($tables);

So the mod still works, however the comparison bug where it just shows a white page on some comparisons also still exists. Would be really cool if you could have a look at this Niko.
Title: Re: Post History
Post by: dmacleo on November 12, 2010, 09:06:18 AM
this was one of the more important mods I used, I will try that fix to see.
Title: Re: Post History
Post by: Kolya on November 12, 2010, 08:16:47 PM
It's important for my for forum as well and I don't understand why this isn't getting more attention.
This should be an option in the core build. It's that important. Because it's about preserving the most precious thing on any forum: The content generated by the users.
vBB has this option. SMF has a mod, with patchy functionality and support.
Title: Re: Post History
Post by: WillyP on December 09, 2010, 09:54:14 PM
It seems to be working ok for me, I've tested it on rc3 and rc4, but haven't put it out on a live site yet.
Title: Re: Post History
Post by: Spoogs on December 09, 2010, 10:00:29 PM
works just fine on live sites too ;)
Title: Re: Post History
Post by: WillyP on December 14, 2010, 09:57:46 AM
After installing, then logging in... must reset password to log in again.  Any thoughts on this?  Tried on a number of different test servers, including rc3 and 4.
Title: Re: Post History
Post by: niko on December 18, 2010, 06:30:22 PM
Quote from: WillyP on December 14, 2010, 09:57:46 AM
After installing, then logging in... must reset password to log in again.  Any thoughts on this?  Tried on a number of different test servers, including rc3 and 4.

Any other mods? I can't see why this mod would cause that... it doesn't edit anything expect post/display pages.
Title: Re: Post History
Post by: WillyP on December 19, 2010, 05:40:31 PM
No, clean sites I made just to test this.
Title: Re: Post History
Post by: PLAYBOY on January 15, 2011, 08:27:52 PM
Is there anyway to make it for 1.1.12?
Title: Re: Post History
Post by: ChaosEnergy on February 19, 2011, 04:39:34 PM
will there be a rc5 version?
Title: Re: Post History
Post by: f_aston on March 20, 2011, 10:36:12 PM


I changed the .xml file to reflect version RC5.  It's installed fine and seems to be functioning perfectly.


I'll give an update if anything goes wrong, but it all looks good!  :)
Title: Re: Post History
Post by: Garou on April 07, 2011, 02:08:52 PM
A user mentioned to me that the "Last Edit: {date/time} by {name}"  displays the users login name rather then the display name. Two issues with this comes to mind.

First, if someone edits their own post, if their display name is different then their login name, it looks kind of weird since its showing one name in the poster information and then their login name with the edit information.

Second, while there are many reasons that the two names may be different, some users use the difference as a form of security. It makes it a little harder for someone to guess your password and log in as you when you log in with a different name then what is displayed everywhere else in the forum.

I had a user mention this to me and I feel it valid enough that I'm editing the function on the sites I work on. Soon as I figure it out ;)

I also though that Id mention it here because I do think its a valid point and you might want to change this in the mod.
Title: Re: Post History
Post by: niko on May 16, 2011, 11:21:27 AM
1.0 released for SMF 2.0 RC5. Mainly same as before except that it uses hooks when possible.
Title: Re: Post History
Post by: Spoogs on May 16, 2011, 12:37:57 PM
Thanks for the update
Title: Re: Post History
Post by: ScottyTooHotty on May 17, 2011, 10:06:59 AM
Very nice mod, thanks. Installed this yesterday but found when I went to set up the permissions I got a syntax error on line 44 of PostHistory.php. There seemed to be an extra '+' infront of the '=' so I removed it and it seems to work fine now, except for the fact that I can't find the permission to enable or disable for certain member groups.

EDIT: Forgot to mention that I got this error in the error log when I tried to assign the permissions

2: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument
File: /home/thelas13/public_html/Forum/Sources/ManagePermissions.php
Line: 869
Title: Re: Post History
Post by: niko on May 17, 2011, 10:28:42 AM
Line 44 was supposed to be: $permissionList['board'] += array( not $permissionList['post'] += array(

Change it and it should work. (Package is also fixed).
Title: Re: Post History
Post by: ScottyTooHotty on May 17, 2011, 01:51:19 PM
Nice one Niko, all fixed now thanks :D
Title: Re: Post History
Post by: Spoogs on May 19, 2011, 12:05:31 PM
Cant uninstall 'Modification parse error'
package-info.xml
Code (find on line 50) Select
<modification format="xml" type="file" reverse="true">install-rc2.xml</modification>
Code (replace with) Select
<modification format="xml" type="file" reverse="true">install.xml</modification>
Title: Re: Post History
Post by: MordyT on June 12, 2011, 03:27:45 AM
Does this work with 2.0 Gold?
Title: Re: Post History
Post by: Illori on June 12, 2011, 05:58:08 AM
yes it does with the use of version emulation to install it.
Title: Re: Post History
Post by: niko on October 16, 2011, 04:02:59 PM
1.0.2 updated for SMF 2.0.1 (no code changes).
Source code is now available at https://github.com/nikop/PostHistory
Title: Re: Post History
Post by: Kolya on October 18, 2011, 11:06:04 AM
Still throws white pages on many comparisons.
Title: Re: Post History
Post by: danielwmoore on November 28, 2011, 11:35:39 AM
Quote from: Kolya on March 17, 2010, 07:00:22 PM
Here's one more suggestion for Post History:
When writing a post I would like to be able to set a bit in the [Additional Options...] that makes the history of this post visible for everyone.

That way I could show the history eg of a FAQ, to users who generally aren't allowed to see post histories.
And a user who gets accused of having edited out some important part of his post (it happens) could then retroactively set this bit and show the history of his post to anyone.

I would like to see this as well.  I haven't downloaded yet, but it sounds like something I definitely want.  I would like to see the [Additional Options...] have a selection to decide whether the history is visible only to poster & moderators, or to everyone.  That would be invaluable, especially with our "Site Rules" topic, our FAQ, and in certain forum games where people may accuse others of changing a post after other gameplay has progressed.
Title: Re: Post History
Post by: niko on March 16, 2012, 01:56:53 PM
Released updated version for SMF 2.0.2 :)
Title: Re: Post History
Post by: Kolya on March 16, 2012, 03:33:10 PM
What was changed? Is there a changelog anywhere?
Title: Re: Post History
Post by: MaXiForum.cz on March 16, 2012, 04:16:51 PM
Nice!
I love this mod ;-)
Title: Re: Post History
Post by: dvk01 on April 21, 2012, 12:37:27 PM
it is a great mod but where can I get the image for the post history that should show in core features
all I get < forum name>/Themes/default/images/admin/feature_posthistory.png  (this file doesn't exist )
Title: Re: Post History
Post by: TheListener on April 21, 2012, 12:38:19 PM
Quote from: dvk01 on April 21, 2012, 12:37:27 PM
it is a great mod but where can I get the image for the post history that should show in core features
all I get < forum name>/Themes/default/images/admin/feature_posthistory.png  (this file doesn't exist )

Have you checked the default theme to see if it shows there?
Title: Re: Post History
Post by: dvk01 on April 21, 2012, 12:53:39 PM
Quote from: Old Fossil on April 21, 2012, 12:38:19 PM


Have you checked the default theme to see if it shows there?

it doesn't show in any theme
I only have core & curve installed
I have installed it on 2 different forums & the image is missing in both
Title: Re: Post History
Post by: bugstomper on June 11, 2012, 06:03:09 PM
Niko, I've been looking for a way to have a permissions setting that would allow a user to edit their posts but hold the edits for moderation before making them visible. The part that I thought would be hard about it is that it would require multiple versions of a post to exist in the database, a current post and a draft that is being held for approval.

It occurs to me that your mod has solved the multiple version problem. Do you think it would be possible to add a feature that when someone edits a post they might have a permission setting that makes the latest version that they have edited not visible, and have that show up in the version history and a moderator having the ability to make the latest version visible?

The purpose of this is to have a way to prevent spammers who sign up for a new account, post normal looking messages, then come back to edit them to add spam to their messages. Holding the edits for approval is sometimes better than completely blocking the ability to edit posts.
Title: Re: Post History
Post by: niko on July 23, 2012, 12:43:21 PM
Quote from: bugstomper on June 11, 2012, 06:03:09 PM
Niko, I've been looking for a way to have a permissions setting that would allow a user to edit their posts but hold the edits for moderation before making them visible. The part that I thought would be hard about it is that it would require multiple versions of a post to exist in the database, a current post and a draft that is being held for approval.

It occurs to me that your mod has solved the multiple version problem. Do you think it would be possible to add a feature that when someone edits a post they might have a permission setting that makes the latest version that they have edited not visible, and have that show up in the version history and a moderator having the ability to make the latest version visible?

The purpose of this is to have a way to prevent spammers who sign up for a new account, post normal looking messages, then come back to edit them to add spam to their messages. Holding the edits for approval is sometimes better than completely blocking the ability to edit posts.

Sorry for late reply, but I think this is good idea and possible to do.
Title: Re: Post History
Post by: Col on December 09, 2012, 01:47:09 PM
Does this mod track the individual changes within a post (like a wiki), or does it just store complete copies of each individual edited version of a post?
Title: Re: Post History
Post by: Col on December 12, 2012, 04:35:34 PM
Quote from: Col on December 09, 2012, 01:47:09 PM
Does this mod track the individual changes within a post (like a wiki), or does it just store complete copies of each individual edited version of a post?

Anyone?

Thanks.
Title: Re: Post History
Post by: niko on December 12, 2012, 11:09:10 PM
Complete copy of each version is stored
Title: Re: Post History
Post by: Kolya on December 13, 2012, 05:45:29 AM
Quote from: Col on December 09, 2012, 01:47:09 PM
Does this mod track the individual changes within a post (like a wiki), or does it just store complete copies of each individual edited version of a post?
Wikis also save complete versions of  articles and then can show the changes when comparing 2 versions.
Exactly like this mod does.
Title: Re: Post History
Post by: Eclipse16V on January 02, 2013, 03:45:06 AM
Doesn´t work with the Broken Link List Mod.

Fatal error: Cannot redeclare loadEdit() (previously declared in /xxx/Sources/PostHistory.php:221) in /xxx/Sources/BrokenLinksList.php on line 416

:(

Can you help me?
Title: Re: Post History
Post by: Hj Ahmad Rasyid Hj Ismail on January 02, 2013, 05:47:40 AM
A very good mod. The one I was looking for to improve forum post moderation.
Title: Re: Post History
Post by: Eclipse16V on January 02, 2013, 08:14:29 AM
Quote from: Eclipse16V on January 02, 2013, 03:45:06 AM
Doesn´t work with the Broken Link List Mod.

Fatal error: Cannot redeclare loadEdit() (previously declared in /xxx/Sources/PostHistory.php:221) in /xxx/Sources/BrokenLinksList.php on line 416

:(

Can you help me?
Error fixed.
Title: Re: Post History
Post by: SugarD-x on April 11, 2013, 07:38:23 PM
Sorry to bump this, but does anyone know if it's working fine with SMF 2.0.4, without emulation? I noticed it had to be updated for both 2.0.1 and 2.0.2, hence why I ask.
Title: Re: Post History
Post by: TheListener on April 11, 2013, 07:47:21 PM
Looking at the mods parser all the edits which are there show so there is no reason as to why the mod won't work.

Title: Re: Post History
Post by: SugarD-x on April 11, 2013, 07:54:17 PM
Quote from: Old Fossil on April 11, 2013, 07:47:21 PM
Looking at the mods parser all the edits which are there show so there is no reason as to why the mod won't work.
Thank you. :)

Edit: The "features" image for the button on the forums is missing from the mod completely, and isn't on the GitHub either. It's trying to display a broken image as a result. Does anyone have it?

It's supposed to upload as "<SMF Forum Root>/Themes/default/images/admin/feature_posthistory.png"

Edit #2: Since the image seems to be completely non-existent, I made my own. Feel free to use it until an official one is released, (assuming one ever is).

Just place it in the directory mentioned in my first edit of this post. Feel free to edit it as you please, too.
Title: Re: Post History
Post by: DSystem on December 29, 2013, 04:55:55 PM
Great MOD tested and worked in the SMF 2.0.6 :)

Regret not found this mod before.   :(
Title: Re: Post History
Post by: DEEPSNUYB on March 15, 2014, 04:52:59 AM
Hello.  I have manually installed this.  What else do I need to do to get it working specifically for 2.0.7?

It states
post_history/Database.php
This file should not be able to execute standalone. You may have to run the following queries manually.

What queries?

post_history/Subs-Install.php
This file should not be able to execute standalone. You may have to run the following queries manually.

What queries?

post_history/install.php
I ran this.  So I assume the install.php needs to be deleted.  But is this the only file that needs to be deleted?

Title: Re: Post History
Post by: sangham.net on March 15, 2014, 10:20:28 AM
Not sure if I am able to install this wonderful seeming tool for now. How ever, first of all a little thanks:

I have add a German-Language file and the new info package-info.xml which (i guess) will execute the installation. So the language file (if I understand the way right) should be add in the zip file and the package-info.xml should be replaced, if german language is wished.

Please wait for an approve of it if you are not much into this stuff, I am not 100% sure if I did it right.

<modification format="xml" type="file">language/german-utf8.xml</modification>

Thanks for the mode anyway!

(http://sangham.net/Smileys/sangham/sadhu_sangham_sw.gif)
Johann
Title: Re: Post History
Post by: DEEPSNUYB on March 16, 2014, 04:32:40 AM
Ok, besides removing all the codes manually and deleting the posthistory directory, what else do i need to manually do in mysql to remove all traces of this mod?
Title: Re: Post History
Post by: sangham.net on March 17, 2014, 02:45:50 PM
Installed and seems to work smooth. Thanks a lot!

I have attached an "NONOFFICIAL " "German uft-8 included Pack" in the case you like to risk it. But better wait on the mod-master or a Professional.

_()_
Johann

("incl German-beta of PostHistory-1.0.3.zip" not-blue part of the file name needs to be removed)
Title: Re: Post History
Post by: Ninja ZX-10RR on April 24, 2014, 09:53:10 PM
Quote from: DEEPSNUYB on March 15, 2014, 04:52:59 AM
Hello.  I have manually installed this.  What else do I need to do to get it working specifically for 2.0.7?

It states
post_history/Database.php
This file should not be able to execute standalone. You may have to run the following queries manually.

What queries?

post_history/Subs-Install.php
This file should not be able to execute standalone. You may have to run the following queries manually.

What queries?

post_history/install.php
I ran this.  So I assume the install.php needs to be deleted.  But is this the only file that needs to be deleted?
Nobody answered you probably because it's really easy to install..
Install it from the package manager and it will work immediately as soon as you set proper permissions. It will automatically add them to the permissions list.
And thanks to the author for this awesome mod. Thanks to margarett as well for linking me here because i was unable to find it (was looking for something like "undo admin edit" and those things)
Title: Re: Post History
Post by: aegersz on August 17, 2016, 09:08:27 PM
Is there any way to remove all the previous edits from the database in order to preserve space on old posts ?
Title: Re: Post History
Post by: Kolya on August 18, 2016, 02:14:58 AM
No. I use a cron job to delete old entries.
Title: Re: Post History
Post by: aegersz on August 18, 2016, 07:50:21 PM
Can you post the logic of your cron job here, please.
Title: Re: Post History
Post by: Kolya on August 19, 2016, 05:58:27 PM
Here you go.

Code (php) Select
<?php
// Connection details
$db['host'] = 'localhost';
$db['user'] = 'xxx';
$db['pass'] = 'xxx';
$db['db'] = 'xxx';

$lastYear time() - (365 24 60 60);

// MySQL we need ya..
$link mysqli_connect($db['host'], $db['user'], $db['pass']);
if (!
$link) die('Could not connect: ' mysqli_error($link));
//Select database
mysqli_select_db($link$db['db']);   

//Delete Message History older than a year   
$query "DELETE FROM smf_messages_history WHERE modified_time < ".$lastYear;
mysqli_query($link$query);

// Close database connection
mysqli_close($link);
?>



I call this PHP file once a month via cron job. I wouldn't do it too often because performance.
You may have a different database prefix, but most likely it's the same standard "smf_" as above.
Title: Re: Post History
Post by: aegersz on August 20, 2016, 04:21:47 AM
Fantastic. I will give it a go when I'm scheduling the next round of changes.

Thank you so much.
Title: Re: Post History
Post by: aegersz on August 21, 2016, 08:41:52 PM
BTW, Koyla, how did you get those nice colors into your php statments ?
Title: Re: Post History
Post by: Nibogo on August 21, 2016, 10:00:27 PM
Use: [code]YOUR PHP CODE[/code]
Title: Re: Post History
Post by: aegersz on August 21, 2016, 11:02:49 PM
thanks. Now i just have to figure out why my nano editor doesn't support colors (i tried the .nanorc in my $home dir but to no avail).
Title: Re: Post History
Post by: aegersz on August 22, 2016, 12:07:43 AM
fixed ! the colors are nice, thanks.
Title: Re: Post History
Post by: Gryzor on January 22, 2018, 10:23:08 AM
I guess this mod is out of development? Does anyone know of any alternatives?
Title: Re: Post History
Post by: aegersz on January 24, 2018, 04:52:14 PM
it may be so but it's been rock solid for me.

many mods are ok to install as long as you have a comfortable uninstall methodology.

some mods don't need to be developed further because they just work.
Title: Re: Post History
Post by: Kolya on January 24, 2018, 05:46:44 PM
That is true, the mod still works as it did.

Apart from that it has and always had some problems with sorting the previous entries and comparing them.
Title: Re: Post History
Post by: Gryzor on January 25, 2018, 01:57:34 AM
Well it does work, but it always throws errors in my log due -I suppose- to deprecated statements...
Title: Re: Post History
Post by: aegersz on January 25, 2018, 03:31:02 AM
what's a few errors between old mods ?

i gave up stressing about errors as long as everything seems to work and i get no complaints.

i often check them, of course.
Title: Re: Post History
Post by: Gryzor on January 25, 2018, 04:06:43 AM
Oh, I'm not stressing, it's just that the logs are getting messy :D
Title: Re: Post History
Post by: Kolya on January 25, 2018, 04:12:30 AM
What kind of errors?
Title: Re: Post History
Post by: Gryzor on January 25, 2018, 04:15:12 AM
Undefined index: view_post_history at Display.template.php. The offending line:


<a href="', $scripturl, '?action=posthistory;topic=', $context['current_topic'], '.0;msg=', $message['id'], '" onclick="return reqWin(this.href + \';popup\');">« <em>', $txt['view_post_history'], '</em> »</a>';
Title: Re: Post History
Post by: aegersz on January 25, 2018, 04:45:12 AM
never seen that one but i only stopped by to say that if you choose to use this great mod, see the pruning posts a page or two back.

it is a batch process so if you or your host runs cron (sorry, Windows only for clients here) then i highly recommend scheduling the pruning task monthly.

what appeals so much to me about this mod is that i can audit any "suspect" posting activity.

if i am not wrong, the edit list is hidden from members and they should be unaware of the versions saved.
Title: Re: Post History
Post by: Gryzor on January 25, 2018, 05:10:55 AM
Correct, the edits list is only visible to mods/admins, and that's a good thing indeed.

For everyone else, this is the post aegersz is referring to: https://www.simplemachines.org/community/index.php?topic=312474.msg3887573#msg3887573
Title: Re: Post History
Post by: Kolya on January 25, 2018, 09:53:03 AM
Quote from: Gryzor on January 25, 2018, 04:15:12 AM
Undefined index: view_post_history at Display.template.php.

The simple fix would be to go into that file and just replace
', $txt['view_post_history'], '
with
View Edits of Post

A better fix would be to open Themes/default/languages/Modifications.english.php (or whatever language you use) and add this line somewhere:
$txt['view_post_history'] = 'View Edits of Post';

For reference here are the complete language strings this mod adds. If you use a different language than English you might want to translate all of these and add them to Modifications.yourlanguage.php
// Post History Start
$txt['core_settings_item_posthistory'] = 'Post History';
$txt['core_settings_item_posthistory_desc'] = 'Store history of edits of message content into database.';

$txt['view_post_history'] = 'View Edits of Post';
$txt['title_view_post_history'] = 'Viewing Post History for - %1$s';

$txt['ph_last_edit'] = 'Latest Edit By';
$txt['ph_last_time'] = 'Edit Time';
$txt['ph_view_edit'] = 'View Post';

$txt['ph_original_edit'] = 'original';
$txt['ph_current_edit'] = 'current';
$txt['ph_current_original_edit'] = 'current, original';

$txt['ph_no_edits'] = 'No one has edited this post yet';

$txt['compare_selected'] = 'Compare Selected';
$txt['restore'] = 'Restore';

$txt['permissionname_posthistory_view'] = 'View Edit History of Post';
$txt['permissionhelp_posthistory_view'] = 'Allows user to view past versions of post.';
$txt['permissionname_posthistory_view_own'] = 'Own post';
$txt['permissionname_posthistory_view_any'] = 'Any post';
$txt['permissionname_posthistory_restore'] = 'Restore older version';
$txt['permissionhelp_posthistory_restore'] = 'Allows user to start editing from older version of post.';
$txt['permissionname_posthistory_restore_own'] = 'Own post';
$txt['permissionname_posthistory_restore_any'] = 'Any post';
$txt['permissionname_simple_posthistory_view_own'] = 'View edit history of their own post';
$txt['permissionname_simple_posthistory_view_any'] = 'View edit history of someone else\'s post';
$txt['permissionname_simple_posthistory_restore_own'] = 'Restore older version of own post';
$txt['permissionname_simple_posthistory_restore_any'] = 'Restore older versions of someone else\'s post';

$txt['cannot_posthistory_view_any'] = 'You are not allowed to view history of this post!';
$txt['cannot_posthistory_restore_own'] = 'You are not allowed to start editing from older version of your posts!';
$txt['cannot_posthistory_restore_any'] = 'You are not allowed to start editing from older version of someone else\'s post!';
// Post History END
Title: Re: Post History
Post by: Kolya on January 25, 2018, 09:56:26 AM
Quote from: Gryzor on January 25, 2018, 05:10:55 AM
Correct, the edits list is only visible to mods/admins

This mod adds a bunch of permissions in SMF. These permissions decide who can see older post versions or even restore them.
Title: Re: Post History
Post by: Gryzor on January 28, 2018, 03:55:08 AM
Quote from: Kolya on January 25, 2018, 09:53:03 AM
A better fix would be to open Themes/default/languages/Modifications.english.php (or whatever language you use) and add this line somewhere:
$txt['view_post_history'] = 'View Edits of Post';


Ahhh thanks so much, this seems to have hit the spot! :)
Title: Re: Post History
Post by: SMiFFER on February 02, 2018, 05:37:36 PM
I am using this mod and I like it very much.

One question though: The messages-history file in my database gets a bit big now

Is there any option to "purge" outdated changes?
Title: Re: Post History
Post by: Kolya on February 03, 2018, 06:46:26 AM
See here: https://www.simplemachines.org/community/index.php?topic=312474.msg3887573#msg3887573

This still seems to be the only solution.
Title: Re: Post History
Post by: aegersz on February 04, 2018, 07:19:23 AM
If you use linux then add something like this into your crontab for weekly execution:

0 0 * * 0 UUUU Prune_Post_History

where UUUU is the designated user's name who runs the task

I run mine every 6 months now
Title: Re: Post History
Post by: SMiFFER on February 16, 2018, 08:07:14 AM
Quote from: Kolya on February 04, 2018, 09:55:54 AM
Please post in the thread and I will explain there as good as I can.

Okay! I do!
But I did not want to disrupt this thread with my newbie-questions.

Unfortunately you have deleted/not quoted what I had asked you.
Title: Re: Post History
Post by: SMiFFER on February 16, 2018, 08:29:39 AM
OK, I'll try to recall.

I wrote:
QuoteI am using this mod and I like it very much.
One question though: The messages-history file in my database gets a bit big now
Is there any option to "purge" outdated changes?

In the offered solution (AVAILABLE HERE (https://www.simplemachines.org/community/index.php?msg=3887573))
you list a source code of a php file.

My questions would have been how to make use of that code
Save as what file? And where?
What adjustments are necessary to make it run on my side of the table?
And how to run it?


This might sound too newbie, I really have never looked much into php, which is why I preffered to email you.

My apologies if that maybe sounds too stupid for you.

Title: Re: Post History
Post by: Kolya on February 16, 2018, 09:12:40 AM
You save that code as a PHP file. Name it anything you want (eg post_history_removal.php), just make sure it has the .php extension.
Enter your database details in the code, below "//Connection details".
Then upload the file to your webspace where you keep your forum. The folder is not important, you just need to remember it for when you call this file.
Now call the file with your browser. Say if you uploaded it to the root directory of http://www.my-awesome-smf.com then you need to enter in your browser: http://www.my-awesome-smf.com/post_history_removal.php
This will delete all post history entries that are older than a year.
There will be no feedback in the browser, it will just show a white page.

For advanced usage you can let your server regularly (eg once a month) call this file automatically, by using a cron job. This is exactly what cron jobs do: It's like a scheduled task in Windows. It will regularly call a specific file.
How you set up a cron job will be specific to your hosting service. But generally (provided you have managed hosting and didn't set up the server yourself) you will have some kind of server backend, like cPanel where you can find cronjobs.
You just create a new job there, enter the URL from above (http://www.my-awesome-smf.com/post_history_removal.php) and choose how often you want to let it run.
Title: Re: Post History
Post by: Kolya on February 16, 2018, 09:16:59 AM
I should add that there are better ways of getting into the database (through SMF functions) instead of writing down the connection details into a PHP file.
I didn't know this yet when I wrote the code you linked above. Maybe I'll update it sometime or maybe someone else will.
Of course the best solution would be if someone integrated it into the mod and let the removal code run as a scheduled task in SMF.
Title: Re: Post History
Post by: Kindred on February 16, 2018, 11:57:28 AM
do the following



Code (in ScheduledTasks.php, at end of file - add the following) Select

function scheduled_purge_post_history()
{
global $modSettings, $sourcedir, $mbname, $txt, $smcFunc, $scripturl;

if (((int) $modSettings['posthistory_timelimit']) > 0) {
$datestamp = date('Y-m-d H:i:s', strtotime('-'.((int) $modSettings['posthistory_timelimit']).' day'));

$result = $smcFunc['db_query']('', '
DELETE FROM {db_prefix}smf_messages_history
WHERE date < {string:datestamp}',
array(
'datestamp' => $datestamp,
)
);
}

return true;
}



Code (in ManageSettings.php, find) Select

// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!


Code (Just after that code comment line, add the following) Select

'',
$txt['posthistory_timelimit'],
array('int', 'posthistory_timelimit', 'subtext' => $txt['posthistory_timelimit_desc']),
'',

      
Code (in Modifications.english.php, add the following to the section already added for Post History MOD) Select

$txt['posthistory_timelimit'] = 'Maximum Age of Data (days)';
$txt['posthistory_timelimit_desc'] = 'Set the maximum time to save post history records';


Code (in Help.english.php, add the following) Select

$helptxt['posthistory_timelimit'] = 'This setting will run as a scheduled task and automatically purge all post history records older than the setting, in days. Set this value to 0 to retain all data, always.';


Code (in the smf_scheduled_tasks table of the database, add a row) Select

INSERT INTO `smf_scheduled_tasks` (`id_task`, `next_time`, `time_offset`, `time_regularity`, `time_unit`, `disabled`, `task`) VALUES (NULL, '0', '0', '1', 'd', '1', 'posthistory');




this will add a setting in admin > configuration > modification settings
this will add a scheduled task (disabled by default) that can be set to run automatically or run manually - which will delete all history older than the setting above.
Title: Re: Post History
Post by: Kolya on February 16, 2018, 02:18:26 PM
That's pretty sweet. Thank you Kindred!
Title: Re: Post History
Post by: SMiFFER on February 17, 2018, 09:41:20 AM
Many thanks for your help and efforts!
I will take a look, try it and report back in.
Again: VERY MUCH APPRECIATED!!
Title: Re: Post History
Post by: aegersz on February 24, 2018, 03:00:01 AM
hey, that is cool.

it's good to see such a great feature get additional support and seamless integration.
Title: Re: Post History
Post by: SMiFFER on February 25, 2018, 01:57:54 PM
ok, trying this out.

a question for the part with adding a task

where do I enter this:

INSERT INTO `smf_scheduled_tasks` (`id_task`, `next_time`, `time_offset`, `time_regularity`, `time_unit`, `disabled`, `task`) VALUES (NULL, '0', '0', '1', 'd', '1', 'posthistory');


everything else is done.

Title: Re: Post History
Post by: Kindred on February 25, 2018, 06:10:16 PM
In the database...   probably using phpmyadmin, if that's what your host uses.
Title: Re: Post History
Post by: Kolya on February 25, 2018, 07:15:34 PM
Have you thought about creating a pull request for your changes, Kindred?
https://github.com/nikop/PostHistory
Title: Re: Post History
Post by: SMiFFER on February 27, 2018, 04:26:16 PM
Quote from: Kindred on February 25, 2018, 06:10:16 PM
In the database...   probably using phpmyadmin, if that's what your host uses.

Ah, so the following is not a command line then and I can just enter the values into the respective fields manually?


INSERT INTO `smf_scheduled_tasks` (`id_task`, `next_time`, `time_offset`, `time_regularity`, `time_unit`, `disabled`, `task`) VALUES (NULL, '0', '0', '1', 'd', '1', 'posthistory');


Then that is really much easier that I thought :)
I had thought that is a command line and looked where to enter that - DOH!
Title: Re: Post History
Post by: SMiFFER on April 19, 2018, 11:59:03 AM
OUCH!

Since I did that - and I was not aware till I took at the logs just now... somehow all scheduled tasks are NOT running.

It looks as though I did something wrong here, all these tasks have not been run since two months:

(http://abload.de/thumb/alloffheqlm.png) (http://abload.de/img/alloffheqlm.png)

What can I do to fix this?
A backup of the old file is of course there.

Any idea where to begin?
Title: Re: Post History
Post by: tranhiep_116 on April 19, 2018, 01:21:22 PM
Thanks for your give to me
Title: Re: Post History
Post by: Arnox on May 11, 2018, 08:09:45 PM
Fix for 2.0.14 and up so it won't spam the error log with "expected to be a reference, value given" errors anymore.
Title: Re: Post History
Post by: SMiFFER on May 12, 2018, 03:47:32 AM
Quote from: Arnox on May 11, 2018, 08:09:45 PM
Fix for 2.0.14 and up so it won't spam the error log with "expected to be a reference, value given" errors anymore.

AAAAAH! There it is!!!! Thanks a lot, my error log got cluttered with that error already..

What line is the fix?
Title: Re: Post History
Post by: SMiFFER on May 12, 2018, 03:53:40 AM
I have the log full with

2: mysql_num_rows() expects parameter 1 to be resource, object given
Apply Filter: Only show the errors from this file
File: ../forum/Sources/Subs-Post.php
Line: 1601

Is that the same?
Title: Re: Post History
Post by: Arnox on May 12, 2018, 05:50:44 AM
Quote from: SMiFFER on May 12, 2018, 03:53:40 AM
I have the log full with

2: mysql_num_rows() expects parameter 1 to be resource, object given
Apply Filter: Only show the errors from this file
File: ../forum/Sources/Subs-Post.php
Line: 1601

Is that the same?

That is from something different.
Title: Re: Post History
Post by: Arnox on May 12, 2018, 06:13:09 AM
EVERYONE DO NOT DOWNLOAD THE OLD 1.0.4 ZIP I UPLOADED EARLIER. IT STILL HAS THE OLD CODE BECAUSE I'M STUPID, AND I CAN'T MODIFY THE POST NOW. PLEASE USE THE ONE BELOW INSTEAD.

Quote from: SMiFFER on May 12, 2018, 03:47:32 AM
Quote from: Arnox on May 11, 2018, 08:09:45 PM
Fix for 2.0.14 and up so it won't spam the error log with "expected to be a reference, value given" errors anymore.

AAAAAH! There it is!!!! Thanks a lot, my error log got cluttered with that error already..

What line is the fix?

PH_actions. actionArray specifically. It should just be "$actionArray". No leading '&'.

BTW, please redownload. For some reason, I put in the old unedited PostHistory.php file into the zip. Sorry. DX
Title: Re: Post History
Post by: Kindred on May 12, 2018, 04:56:51 PM
the strange  thing is...  I have this installed on 2.0.15 with no errors at all.
Title: Re: Post History
Post by: Arnox on May 12, 2018, 06:00:39 PM
Quote from: Kindred on May 12, 2018, 04:56:51 PM
the strange  thing is...  I have this installed on 2.0.15 with no errors at all.

I think it only starts happening if you upgrade to 2.0.14 with it installed. And since it doesn't uninstall completely, the problem remains. Or at least that's what I think is happening.

Could you test something for me though? Just make an edit to any post and then try to view the edits. The popout seems to have the right URL but instead of showing me the edit history, it just dumps me right back to the forum main page. What's even more frustrating is that it's not printing out an error in the error log at all.
Title: Re: Post History
Post by: Kindred on May 12, 2018, 10:06:36 PM
I did...   I had it installed, upgraded to 2.0.14 and 2.0.15 with no issues.

And it works just as it is supposed to, as of last week, which is the last time I used the history function
Title: Re: Post History
Post by: Arnox on May 13, 2018, 12:44:13 AM
Quote from: Kindred on May 12, 2018, 10:06:36 PM
I did...   I had it installed, upgraded to 2.0.14 and 2.0.15 with no issues.

And it works just as it is supposed to, as of last week, which is the last time I used the history function

Hm... Do you have any idea at all why it's redirecting the popout back to the home page instead of bringing up a post's edit history?
Title: Re: Post History
Post by: Arnox on May 13, 2018, 01:47:32 AM
Quote from: Kindred on May 12, 2018, 10:06:36 PM
I did...   I had it installed, upgraded to 2.0.14 and 2.0.15 with no issues.

And it works just as it is supposed to, as of last week, which is the last time I used the history function

Also, are you actually running PHP 7.0 or above? Or PHP 5.6 and below?

I recall post history working beautifully when I had 5.6.
Title: Re: Post History
Post by: Arnox on May 13, 2018, 02:48:41 AM
EDIT: FIXED IT. ****ING GOT 'EM.

To solve why the popout was dropping me back into the main page, I had to verse myself on how SMF very basically works internally.

So after poring over the install files and finding jack (or at least nothing that stood out to me), I decided to take a look at the main edit history URL.

"(my main forum domain)/index.php?action=posthistory;topic=5464.0;msg=69296"

I then started tracing exactly where each step was going. So as we can obviously see, it's starting out by making a usual request for the index.php of the forum. The starting point for most everything. The next part was the action it was calling. SMF has a long list of "actions" in its index.php that point to a file in the Sources directory and then a code function within that file. Usually the main starting code function.

Then I experimented and looked at what happened when I purposefully put in a bad (nonexisting) action call in the URL. So

"(my main forum domain)/index.php?action=ali;topic=5464.0;msg=69296"

The action "ali" is nonsense and doesn't exist in the index.php either. And there, I saw that it dumped me right back to the home page again. I had successfully duplicated the error. So now we know what exactly the error is.

I then took a look into my index.php and looked for a "posthistory" action. It didn't exist whatsoever. Hmmmmm... Now what's really strange is that it seemingly never HAD to exist in the index.php before for Post History to work. And I know this for an absolute fact too because all my old forum backups with Post History never had a "posthistory" action in any of their index.php's either. I looked. Nevertheless, nothing else seemed to make sense, so this simply had to be it.

I made a new action then in my index.php right beneath the 'post2' action.

'posthistory' => array('PostHistory.php', 'PostHistory'),

We're saying here that there is now indeed a posthistory action, and if it's called, bring up the main "PostHistory.php" file that is in the Sources directory and execute the "PostHistory" code function there.

After that, everything worked just fine. 1.0.5 zip below has the index.php install actions added now to avoid any future problems.
Title: Re: Post History
Post by: Kolya on May 13, 2018, 11:55:30 AM
I'm running the original code by Niko. It never produced errors in the log and survived upgrading the forum just fine.

That's not too say that it didn't have problems. Comparisons of complex posts tend to fail. And the order of edits isn't chronological.

But the problems you fixed sound self produced. Glad it works for you now, but when you find that the mod should have never worked according to your logic and yet you know it did, then it's time to rethink your approach.
Title: Re: Post History
Post by: Arnox on May 13, 2018, 01:08:10 PM
Quote from: Kolya on May 13, 2018, 11:55:30 AM
I'm running the original code by Niko. It never produced errors in the log and survived upgrading the forum just fine.

That's not too say that it didn't have problems. Comparisons of complex posts tend to fail. And the order of edits isn't chronological.

But the problems you fixed sound self produced. Glad it works for you now, but when you find that the mod should have never worked according to your logic and yet you know it did, then it's time to rethink your approach.

Are you running PHP 7.0 or above or are you using an earlier version?
Title: Re: Post History
Post by: Kolya on May 13, 2018, 01:20:23 PM
I'm running PHP 5.5.12
Title: Re: Post History
Post by: Arnox on May 13, 2018, 03:30:22 PM
Quote from: Kolya on May 13, 2018, 01:20:23 PM
I'm running PHP 5.5.12

That's why.

PHP 7.x brought a WHOLE lot of changes to how things are written. It's also a little more strict in what it accepts and what it doesn't. Things you could do that might have flown in 5.x might not work anymore in 7.0. For example, the leading '&' in actionArray and no posthistory action listed in index.php still work in 5.x but with 7.x, forget it. You need to fix it or drop the mod.
Title: Re: Post History
Post by: Kindred on May 13, 2018, 08:28:25 PM
I believe that we are on 7.1, but you never know for sure, with godaddy
Title: Re: Post History
Post by: Arnox on May 14, 2018, 01:52:25 AM
Quote from: Kindred on May 13, 2018, 08:28:25 PM
I believe that we are on 7.1, but you never know for sure, with godaddy

You can check your current PHP version by going here: (your domain)/index.php?action=admin;area=credits

Or at least what version your host is telling the forum it is.
Title: Re: Post History
Post by: Kindred on May 14, 2018, 06:29:49 AM
lol.... yes, I know....    but with godaddy, you never know what reality is.
Title: Re: Post History
Post by: Storebror on February 08, 2019, 07:50:44 AM
This is one of my all time favourite mods.
Is there any chance to update it to become compatible with SMF 2.1?

Cheers!
Mike
Title: Re: Post History
Post by: Kindred on February 08, 2019, 08:13:55 AM
since 2.1 is still only in RC, many mod authors may not choose to make updates until final.
Title: Re: Post History
Post by: Arantor on February 08, 2019, 08:29:48 AM
Author hasn't been here in over 3 years.