--- ad.module	2008-04-17 12:50:45.000000000 -0400
+++ ad.module.patched	2008-04-18 16:05:17.000000000 -0400
@@ -1,5 +1,5 @@
 <?php
-// $Id: ad.module,v 1.2.2.29.2.71 2008/04/17 16:50:45 jeremy Exp $
+// $Id: ad.module,v 1.2.2.29.2.59 2008/01/11 19:37:33 jeremy Exp $
 
 /**
  * @file
@@ -900,6 +900,14 @@
   // Allow ad type module to act on nodeapi events.  The adapi hook provides 
   // access to additional variables not available in the nodeapi hook.
   if ($node->adtype) {
+    if ($op == 'submit') {
+      $taxonomy = array();
+      $result = db_query('SELECT n.tid, d.vid FROM {term_node} n INNERT JOIN {term_data} d ON n.tid = d.tid WHERE nid = %d', $node->nid);
+      while ($term = db_fetch_object($result)) {
+        $taxonomy[$term->vid][] = $term->tid;
+      }
+      $node->taxonomy = $taxonomy;
+    }
     // Don't use module_invoke, as in pre-PHP5 the changes to $node won't be
     // passed back.
     $function = "ad_$node->adtype" .'_adapi';
