I've been going back in and modifying some existing posts – and I thought it would be useful to see a list of posts that were recently edited.
This function would go in your my-hacks.php file. I created it quickly for my own uses – wanted to keep it here for "code storage" – but you will probably want to customize the code so that it does what you want it to.
function displayRecentlyUpdatedPosts () {
global $wpdb, $tableposts;
$now = current_time('mysql');
$arcresults = $wpdb->get_results("SELECT ID, post_date, post_title, post_modified FROM $tableposts WHERE post_modified < '$now' AND post_status = 'publish' AND post_modified != post_date ORDER BY post_modified DESC LIMIT 20");
if ($arcresults) {
foreach ($arcresults as $arcresult) {
if ($arcresult->post_date != '0000-00-00 00:00:00') {
$url = get_permalink($arcresult->ID);
$arc_title = stripslashes($arcresult->post_title);
if ($arc_title) {
$text = strip_tags($arc_title);
} else {
$text = $arcresult->ID;
}
$post_date = substr($arcresult->post_modified, 0, 10);
$post_day = substr($arcresult->post_modified, 8, 2);
$post_year = substr($arcresult->post_modified, 0, 4);
$post_month = substr($arcresult->post_modified, 5, 2);
$post_hour = substr($arcresult->post_modified, 11, 2);
$post_min = substr($arcresult->post_modified, 14, 2);
$post_sec = substr($arcresult->post_modified, 17, 2);
$amPm = "am";
if ($post_hour > 12) {
$post_hour = $post_hour – 12;
$amPm = "pm";
}
echo "<p>".$post_month.".".$post_day.".".$post_year." ".$post_hour.":".$post_min." ".$amPm."<br /><a href="".$url."">".$text."</a></p>";
}
}
}
}