Index: og_files.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/og_files/Attic/og_files.module,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 og_files.module
--- og_files.module	17 May 2008 13:42:16 -0000	1.1.2.2
+++ og_files.module	28 Nov 2008 01:16:33 -0000
@@ -289,8 +289,15 @@ function og_files_nodeapi(&$node, $op, $
     case 'update':
       db_query('DELETE FROM {og_files} WHERE gid = %d',$node->nid);
     case 'insert':
-      if(isset($node->og_files_enabled)) {
-        db_query("INSERT INTO {og_files} VALUES (%d,'%s')",$node->nid, '');
+      if ($node->og_files_enabled) {
+        db_query("INSERT INTO {og_files} VALUES (%d,'%s')", $node->nid, '');
+        $path = og_files_base_path($node->nid);
+        if (!is_dir($path)) {
+          if (mkdir($path, 0777))
+            drupal_set_message(t('The directory %path has been created.', array('%path' => $path)));
+          else
+            drupal_set_message(t("Can't create directory %path.", array('%path' => $path)));
+        }
       }
       break;
     case 'load':
@@ -302,4 +309,4 @@ function og_files_nodeapi(&$node, $op, $
       db_query('DELETE FROM {og_files} WHERE gid = %d',$node->nid);
       break;
   }
-}
\ No newline at end of file
+}
