Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

blog MDL-20617 adding checking for deleted blog posts

  • Loading branch information...
commit cc52e53dd1133e7cf0fee699b73c9fc976257fe9 1 parent afce96f
@andyjdavis andyjdavis authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 blog/lib.php
View
7 blog/lib.php
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.