Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
42291c61
Commit
42291c61
authored
Feb 02, 2011
by
Andrew Davis
Committed by
David Mudrák
Feb 18, 2011
Browse files
MDL-26010 External blog synchronization removes non-relevant post records
parent
99faefb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
blog/lib.php
View file @
42291c61
...
...
@@ -264,7 +264,9 @@ 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'
);
$sql
=
"SELECT id, uniquehash FROM
{
post
}
WHERE "
.
$DB
->
sql_compare_text
(
'content'
)
.
" = :blogid AND module = 'blog_external' 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
)
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment