Permalink
Browse files

blog MDL-20617 adding checking for deleted blog posts

  • Loading branch information...
1 parent afce96f commit cc52e53dd1133e7cf0fee699b73c9fc976257fe9 @andyjdavis andyjdavis committed Dec 20, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 blog/lib.php
View
@@ -163,6 +163,8 @@ function blog_sync_external_entries($externalblog) {
if (empty($rss->data)) {
return null;
}
+
+ $oldesttimestamp = null;
foreach ($rss->get_items() as $entry) {
// If filtertags are defined, use them to filter the entries by RSS category
@@ -220,6 +222,11 @@ function blog_sync_external_entries($externalblog) {
$newentry->created = $timestamp;
}
$newentry->lastmodified = $timestamp;
+
+ if (empty($oldesttimestamp) || $timestamp<$oldesttimestamp) {
+ //found an older post
+ $oldesttimestamp = $timestamp;
+ }
$textlib = textlib_get_instance();
if ($textlib->strlen($newentry->uniquehash) > 255) {

0 comments on commit cc52e53

Please sign in to comment.