Skip to content

Instantly share code, notes, and snippets.

@septor
Created September 7, 2013 21:35
Show Gist options
  • Save septor/6479543 to your computer and use it in GitHub Desktop.
Save septor/6479543 to your computer and use it in GitHub Desktop.
Remove unread PMs older than a year, and remove all PMs older than 5 years **THIS IS UNTESTED**
<?php
// drop this in your root e107 directory
include("class2.php");
// unread in the last 12 months
$sql->db_Delete("private_msg", "pm_sent < ".(time() - 31556926)." AND pm_read = 0") or die(mysql_error());
// older than 5 years
$sql->db_Delete("private_msg", "pm_sent < ".(time() - 157784630)) or die(mysql_error());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment