]> git.mxchange.org Git - friendica-addons.git/commitdiff
We delete now with dba::delete - if available
authorMichael <heluecht@pirati.ca>
Sat, 13 May 2017 03:28:33 +0000 (03:28 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 13 May 2017 03:28:33 +0000 (03:28 +0000)
twitter/twitter.php

index 74121d295e7a8084d467a122880174b59a512737..74245fa276245feed513770ba9f5139df91103ee 100644 (file)
@@ -688,7 +688,15 @@ function twitter_expire($a,$b) {
        if ($days == 0)
                return;
 
-       $r = q("DELETE FROM `item` WHERE `deleted` AND `network` = '%s'", dbesc(NETWORK_TWITTER));
+       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");