Skip to content

Commit

Permalink
blog MDL-25341 removed some whitespaces inserted by netbeans
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjdavis committed Dec 22, 2010
1 parent bb8a75e commit c484c85
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions blog/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ function blog_sync_external_entries($externalblog) {
if (empty($rss->data)) {
return null;
}

//used to identify blog posts that have been deleted from the source feed
$oldesttimestamp = null;
$uniquehashes = array();
Expand All @@ -188,7 +187,7 @@ function blog_sync_external_entries($externalblog) {
continue;
}
}

$uniquehashes[] = $entry->get_permalink();

$newentry = new stdClass();
Expand All @@ -200,7 +199,7 @@ function blog_sync_external_entries($externalblog) {
$newentry->format = FORMAT_HTML;
$newentry->subject = $entry->get_title();
$newentry->summary = $entry->get_description();

//used to decide whether to insert or update
//uses enty permalink plus creation date if available
$existingpostconditions = array('uniquehash' => $entry->get_permalink());
Expand All @@ -211,17 +210,17 @@ function blog_sync_external_entries($externalblog) {
if (!empty($entrydate)) {
$existingpostconditions['created'] = $entrydate;
}

//the post ID or false if post not found
$postid = $DB->get_field('post', 'id', $existingpostconditions);

$timestamp = null;
if (empty($entrydate)) {
$timestamp = time();
} else {
$timestamp = $entrydate;
}

//only set created if its a new post so we retain the original creation timestamp if the post is edited
if ($postid === false) {
$newentry->created = $timestamp;
Expand Down Expand Up @@ -254,7 +253,7 @@ function blog_sync_external_entries($externalblog) {
$DB->update_record('post', $newentry);
}
}

//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.
Expand Down

0 comments on commit c484c85

Please sign in to comment.