dopetalk

Technology => SMF Forum Code Modifications => Topic started by: Chip on August 10, 2016, 03:57:12 AM

Title: Post History
Post by: Chip on August 10, 2016, 03:57:12 AM
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 (see Moderate the Board permissions).

Features
 
. Save version of post when edited
. Compare changes between versions
. Restore old version if needed
. Uses hooks to minimize edits needed to

Only documented recently
Title: Re: Post History
Post by: Chip on August 16, 2016, 12:56:58 PM
see http://www.simplemachines.org/community/index.php?topic=312474.msg3524389#msg3524389 for the image (png)
Title: Re: Post History
Post by: Chip on August 22, 2016, 11:01:49 PM
http://www.simplemachines.org/community/index.php?topic=312474.msg3887573#msg3887573

PrunePostHistory.php

Clear Post History over a year old via a (monthly) cron job:

Code: [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);
?>

DO NOT RUN WITHOUT CONSULTING CHIPPER !
Title: Re: Post History
Post by: Chip on September 06, 2016, 08:21:42 AM
moved to root, as it should be and added to cron to automatically run once a week prior to DB Optimization.
SimplePortal 2.3.6 © 2008-2014, SimplePortal