Permalink
Browse files

Merge branch 'master' of git.moodle.org:/git/integration

  • Loading branch information...
2 parents f5c452a + ed3eb9e commit 395181f9bb2813fe4f133237f003de2b78ae7b3d @stronk7 stronk7 committed Feb 18, 2011
Showing with 10 additions and 4 deletions.
  1. +10 −4 blog/lib.php
View
@@ -261,10 +261,16 @@ function blog_sync_external_entries($externalblog) {
}
}
- //Look at the posts we have in the database to check if any of them have been deleted from the feed.
- //Only checking posts within the time frame returned by the rss feed. Older items may have been deleted or
- //may just not be returned anymore. We cant tell the difference so we leave older posts alone.
- $dbposts = $DB->get_records_select('post', 'created > :ts', array('ts' => $oldesttimestamp), '', 'id, uniquehash');
+ // Look at the posts we have in the database to check if any of them have been deleted from the feed.
+ // Only checking posts within the time frame returned by the rss feed. Older items may have been deleted or
+ // may just not be returned anymore. We can't tell the difference so we leave older posts alone.
+ $sql = "SELECT id, uniquehash
+ FROM {post}
+ WHERE module = 'blog_external'
+ AND " . $DB->sql_compare_text('content') . " = " . $DB->sql_compare_text(':blogid') . "
+ AND created > :ts";
+ $dbposts = $DB->get_records_sql($sql, array('blogid' => $externalblog->id, 'ts' => $oldesttimestamp));
+
$todelete = array();
foreach($dbposts as $dbpost) {
if ( !in_array($dbpost->uniquehash, $uniquehashes) ) {

0 comments on commit 395181f

Please sign in to comment.