sarjona

blocks/myoverview/db/upgrade.php

Feb 25th, 2022
1,190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1.     $instances = $DB->get_recordset_select('block_instances', $instanceselect, $instanceparams);
  2.  
  3.     $total = $DB->count_records_select('block_instances', $instanceselect, $instanceparams);
  4.     if ($total > 0) {
  5.         // Show a progress bar.
  6.         $pbar = new progress_bar('deleteblockinstances', 500, true);
  7.         $pbar->update($i, $total, "Deleting block instance - $i/$total.");
  8.         foreach ($instances as $instance) {
  9.             delete_block_instance($instance);
  10.             // Update progress.
  11.             $pbar->update($i, $total, "Deleting block instance - $i/$total.");
  12.             $i++;
  13.         }
  14.         $instances->close();
  15.     }
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment