Index: notifications_attach/notifications_attach.info =================================================================== --- notifications_attach/notifications_attach.info (revision 0) +++ notifications_attach/notifications_attach.info (revision 0) @@ -0,0 +1,7 @@ +; $Id$ +name = Attachments +description = Attaches information regarding attachments to nodes to outgoing notifications +package = "Notifications" +dependencies[] = notifications +dependencies[] = upload +core = 6.x \ No newline at end of file Index: notifications_attach/notifications_attach.module =================================================================== --- notifications_attach/notifications_attach.module (revision 0) +++ notifications_attach/notifications_attach.module (revision 0) @@ -0,0 +1,27 @@ +notifications['events'] as $event) { + // Find all attachments to node. + $attach_result = db_query("SELECT * FROM {upload} WHERE nid = %d", $event->params['nid']); + // Retrieve file data for each attachment. + while($attach_row = db_fetch_object($attach_result)) { + $attachments[] = db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $attach_row->fid)); + } + } + // Attach files information to message. + $message->files = $attachments; +} \ No newline at end of file