<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
$result = db_query("SELECT nid FROM {node} where type='{whatever my
custom type is}'");<br>
while ($row=db_fetch_object($result)){<br>
node_delete($row->nid);<br>
}<br>
<br>
If your talking about images through imagefield, then that will
delete the files also. <br>
<br>
One thing to note: Depending on how many nodes you have, this can
choke. It is generally best to do bulk deletes like this through the
batch api in batches of 50 or so. <br>
<pre class="moz-signature" cols="72">Jamie Holly
<a class="moz-txt-link-freetext" href="http://www.intoxination.net">http://www.intoxination.net</a>
<a class="moz-txt-link-freetext" href="http://www.hollyit.net">http://www.hollyit.net</a></pre>
<br>
On 1/26/2011 4:48 PM, <a class="moz-txt-link-abbreviated" href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a> wrote:
<blockquote cite="mid:4D4096A7.30008@ayendesigns.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<p style="margin-bottom: 0cm; margin-top: 0pt;">I have my module
-install- working fine...creating the needed vocabulary, cck
content type with fields, adding the content type to the
vocabulary. Now I'm working on the uninstall, and the seemingly
infinite cleanup that's needed, not that anyone would ever want
to remove my module, once installed!</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;">I believe I have
the vocabulary and its data, and the cck content type and its
data accounted for with:</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
taxonomy_del_vocabulary($vid);
<p style="margin-bottom: 0cm; margin-top: 0pt;">
drupal_load('module', 'content');<br>
content_notify('uninstall', 'my_module');</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;">and that brings me
to nodes et al. There will be nodes (and node revisions) to be
removed, and each node can have multiple field instances (cck
image field). I don't seem to see a magic function that, given a
node type, will remove all associated node data for that type.
Also, I think I should remove the files that were uploaded as
cck image content. Any tips on a good example of a complete
"undo"? :)<br>
</p>
<div class="moz-signature">-- <br>
<p style="margin-bottom: 0in;"><img
src="cid:part1.02080401.00030606@earthlink.net"
name="ayenlogo" valign="top" align="LEFT" border="0"
vspace="30"> <font style="font-size: 8pt;" size="1">Ayen
Designs </font><font face="Times New Roman, serif"><font
style="font-size: 8pt;" size="1"> <br>
388 Bullsboro Drive #105 · Newnan, Georgia 30263</font></font>
<br>
<font face="Times New Roman, serif"><font style="font-size:
8pt;" size="1"> 404-271-9734<br>
Web:<a moz-do-not-send="true"
href="http://ayendesigns.com">ayendesigns.com</a><br>
Blog: <a moz-do-not-send="true"
href="http://theaccidentalcoder.com">theAccidentalCoder.com</a><br>
Drupal: <a moz-do-not-send="true"
href="http://drupal.org/user/367108">j. ayen green</a><br>
IRQ: j_ayen_green<br>
IM (Yahoo) baalwww (MSN) <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:baalwww@yahoo.com">baalwww@yahoo.com</a><br>
Skype: ayendesigns <br>
<br>
Ayen Designs is a tradename of the computer services
division of <img
src="cid:part2.07010008.01010505@earthlink.net"
name="acmelogo" align="absmiddle"></font></font></p>
</div>
</blockquote>
</body>
</html>