/[drupal]/contributions/tricks/empty_forum.php
ViewVC logotype

Contents of /contributions/tricks/empty_forum.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Thu Sep 15 17:07:51 2005 UTC (4 years, 2 months ago) by weitzman
Branch: MAIN
File MIME type: text/x-php
empty all posts in a forum. useful for large forums where web UI is too slow, especially because we have no damn 'check all' feature in admin/node
1 <?PHP
2
3 // change the number below to the forum you want emptied.
4 //then visit this page in your browser or run with command line php
5 $tid = 2;
6
7 require "./includes/bootstrap.inc";
8 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
9 $sql = 'SELECT nid from term_node where tid=%d';
10 $result = db_query($sql, $tid);
11 while ($row = db_fetch_object($result)) {
12 node_delete(array('nid' => $row->nid, 'confirm' => 1));
13 }

  ViewVC Help
Powered by ViewVC 1.1.2