From: Michael Date: Sat, 13 May 2017 03:28:33 +0000 (+0000) Subject: We delete now with dba::delete - if available X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc5ba4ee150756c200c862c7e0071aecaa81d180;p=friendica-addons.git We delete now with dba::delete - if available --- diff --git a/twitter/twitter.php b/twitter/twitter.php index 74121d29..74245fa2 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -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");