Conditions | 4 |
Paths | 5 |
Total Lines | 34 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
28 | public function run() |
||
29 | { |
||
30 | global $modSettings; |
||
31 | |||
32 | if (empty($modSettings['enableFollowup'])) |
||
33 | return false; |
||
34 | |||
35 | $db = database(); |
||
36 | |||
37 | // The old FU request :P |
||
38 | $request = $db->query('', ' |
||
39 | SELECT |
||
40 | fu.derived_from |
||
41 | FROM {db_prefix}follow_ups AS fu |
||
42 | LEFT JOIN {db_prefix}messages AS m ON (fu.derived_from = m.id_msg) |
||
43 | WHERE m.id_msg IS NULL |
||
44 | LIMIT {int:limit}', |
||
45 | array( |
||
46 | 'limit' => 100, |
||
47 | ) |
||
48 | ); |
||
49 | $remove = array(); |
||
50 | while ($row = $db->fetch_assoc($request)) |
||
51 | $remove[] = $row['derived_from']; |
||
52 | $db->free_result($request); |
||
53 | |||
54 | if (empty($remove)) |
||
55 | return true; |
||
56 | |||
57 | require_once(SUBSDIR . '/FollowUps.subs.php'); |
||
58 | removeFollowUpsByMessage($remove); |
||
59 | |||
60 | return true; |
||
61 | } |
||
62 | } |