dopetalk
Technology => SMF Forum Code Modifications => Topic started 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
-
see http://www.simplemachines.org/community/index.php?topic=312474.msg3524389#msg3524389 for the image (png)
-
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:
<?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 !
-
moved to root, as it should be and added to cron to automatically run once a week prior to DB Optimization.