1
i wrote a very little script to delete all unreaded pms after 30 days.running this with cronjob everyday:
define("user", "");
define("pass", "");
define("host", "localhost");
define("db", "");
$cxn = mysql_connect(host ,user, pass);
mysql_select_db(db);
$delete_time = time() - ( 30 * 24 * 60 * 60 ); // 30 days/month * 24 hrs/day
// * 60 minutes/hour * 60 seconds/min.
$sql = "DELETE from `xoops_priv_msgs` WHERE `read_msg` = '0' AND `msg_time` < '$delete_time'";
//This script would delete everything older than 30 days that has been not read.
$result = mysql_query($sql, $cxn);
?>
xoops_priv_msgs table size is about 300 Mb.
what can i do to prevent server heavy loading?