| @@ 445-468 (lines=24) @@ | ||
| 442 | $polls[] = $row['id_poll']; |
|
| 443 | $smcFunc['db_free_result']($request); |
|
| 444 | ||
| 445 | if (!empty($polls)) |
|
| 446 | { |
|
| 447 | $smcFunc['db_query']('', ' |
|
| 448 | DELETE FROM {db_prefix}polls |
|
| 449 | WHERE id_poll IN ({array_int:polls})', |
|
| 450 | array( |
|
| 451 | 'polls' => $polls, |
|
| 452 | ) |
|
| 453 | ); |
|
| 454 | $smcFunc['db_query']('', ' |
|
| 455 | DELETE FROM {db_prefix}poll_choices |
|
| 456 | WHERE id_poll IN ({array_int:polls})', |
|
| 457 | array( |
|
| 458 | 'polls' => $polls, |
|
| 459 | ) |
|
| 460 | ); |
|
| 461 | $smcFunc['db_query']('', ' |
|
| 462 | DELETE FROM {db_prefix}log_polls |
|
| 463 | WHERE id_poll IN ({array_int:polls})', |
|
| 464 | array( |
|
| 465 | 'polls' => $polls, |
|
| 466 | ) |
|
| 467 | ); |
|
| 468 | } |
|
| 469 | ||
| 470 | // Get rid of the attachment, if it exists. |
|
| 471 | require_once($sourcedir . '/ManageAttachments.php'); |
|
| @@ 3019-3044 (lines=26) @@ | ||
| 3016 | $remove_pms[] = $row['sender']; |
|
| 3017 | $smcFunc['db_free_result']($request); |
|
| 3018 | ||
| 3019 | if (!empty($remove_pms)) |
|
| 3020 | { |
|
| 3021 | $smcFunc['db_query']('', ' |
|
| 3022 | DELETE FROM {db_prefix}personal_messages |
|
| 3023 | WHERE id_pm IN ({array_int:pm_list})', |
|
| 3024 | array( |
|
| 3025 | 'pm_list' => $remove_pms, |
|
| 3026 | ) |
|
| 3027 | ); |
|
| 3028 | ||
| 3029 | $smcFunc['db_query']('', ' |
|
| 3030 | DELETE FROM {db_prefix}pm_recipients |
|
| 3031 | WHERE id_pm IN ({array_int:pm_list})', |
|
| 3032 | array( |
|
| 3033 | 'pm_list' => $remove_pms, |
|
| 3034 | ) |
|
| 3035 | ); |
|
| 3036 | ||
| 3037 | $smcFunc['db_query']('', ' |
|
| 3038 | DELETE FROM {db_prefix}pm_labeled_messages |
|
| 3039 | WHERE id_pm IN ({array_int:pm_list})', |
|
| 3040 | array( |
|
| 3041 | 'pm_list' => $remove_pms, |
|
| 3042 | ) |
|
| 3043 | ); |
|
| 3044 | } |
|
| 3045 | ||
| 3046 | // Any cached numbers may be wrong now. |
|
| 3047 | cache_put_data('labelCounts:' . $user_info['id'], null, 720); |
|
| @@ 833-853 (lines=21) @@ | ||
| 830 | } |
|
| 831 | ||
| 832 | // I'm sorry, but... well, no one was choosing you. Poor options, I'll put you out of your misery. |
|
| 833 | if (!empty($delete_options)) |
|
| 834 | { |
|
| 835 | $smcFunc['db_query']('', ' |
|
| 836 | DELETE FROM {db_prefix}log_polls |
|
| 837 | WHERE id_poll = {int:id_poll} |
|
| 838 | AND id_choice IN ({array_int:delete_options})', |
|
| 839 | array( |
|
| 840 | 'delete_options' => $delete_options, |
|
| 841 | 'id_poll' => $bcinfo['id_poll'], |
|
| 842 | ) |
|
| 843 | ); |
|
| 844 | $smcFunc['db_query']('', ' |
|
| 845 | DELETE FROM {db_prefix}poll_choices |
|
| 846 | WHERE id_poll = {int:id_poll} |
|
| 847 | AND id_choice IN ({array_int:delete_options})', |
|
| 848 | array( |
|
| 849 | 'delete_options' => $delete_options, |
|
| 850 | 'id_poll' => $bcinfo['id_poll'], |
|
| 851 | ) |
|
| 852 | ); |
|
| 853 | } |
|
| 854 | ||
| 855 | // Shall I reset the vote count, sir? |
|
| 856 | if (isset($_POST['resetVoteCount'])) |
|
| @@ 1578-1601 (lines=24) @@ | ||
| 1575 | } |
|
| 1576 | ||
| 1577 | // Get rid of the redundant polls. |
|
| 1578 | if (!empty($deleted_polls)) |
|
| 1579 | { |
|
| 1580 | $smcFunc['db_query']('', ' |
|
| 1581 | DELETE FROM {db_prefix}polls |
|
| 1582 | WHERE id_poll IN ({array_int:deleted_polls})', |
|
| 1583 | array( |
|
| 1584 | 'deleted_polls' => $deleted_polls, |
|
| 1585 | ) |
|
| 1586 | ); |
|
| 1587 | $smcFunc['db_query']('', ' |
|
| 1588 | DELETE FROM {db_prefix}poll_choices |
|
| 1589 | WHERE id_poll IN ({array_int:deleted_polls})', |
|
| 1590 | array( |
|
| 1591 | 'deleted_polls' => $deleted_polls, |
|
| 1592 | ) |
|
| 1593 | ); |
|
| 1594 | $smcFunc['db_query']('', ' |
|
| 1595 | DELETE FROM {db_prefix}log_polls |
|
| 1596 | WHERE id_poll IN ({array_int:deleted_polls})', |
|
| 1597 | array( |
|
| 1598 | 'deleted_polls' => $deleted_polls, |
|
| 1599 | ) |
|
| 1600 | ); |
|
| 1601 | } |
|
| 1602 | ||
| 1603 | // Cycle through each board... |
|
| 1604 | foreach ($boardTotals as $id_board => $stats) |
|