Merge pull request #413 from annando/dba-twitter

We delete now with dba::delete - if available
pull/412/merge
Hypolite Petovan 2017-05-13 00:32:56 -04:00 committed by GitHub
commit e7ead45845
1 changed files with 9 additions and 1 deletions

View File

@ -688,7 +688,15 @@ function twitter_expire($a,$b) {
if ($days == 0)
return;
if (method_exists('dba', 'delete')) {
$r = dba::select('item', array('id'), array('deleted' => true, 'network' => NETWORK_TWITTER));
while ($row = dba::fetch($r)) {
dba::delete('item', array('id' => $row['id']));
}
dba::close($r);
} else {
$r = q("DELETE FROM `item` WHERE `deleted` AND `network` = '%s'", dbesc(NETWORK_TWITTER));
}
require_once("include/items.php");