--- pathauto.module	Sat Apr  2 15:00:08 2005
+++ pathauton.module	Wed Apr  6 17:41:56 2005
@@ -95,6 +95,11 @@
         $description .= '<dd>'.t('As category, but including its supercategories.').'</dd>';
     }
   }
+  $description .= '<dt>'.'[user]'.'</dt>';
+  $description .= '<dd>'.t('The name of the user who created the node.</dd>');
+  $description .= '<dt>'.'[nid]'.'</dt>';
+  $description .= '<dd>'.t('The id number of the node.</dd>');
+      
   $description .= '<dt>'.'[type]'.'</dt>';
   $description .= '<dd>'.t('The node type (e.g., "page", "story", etc.).</dd>');
   if (module_exist('book')) {
@@ -120,16 +125,24 @@
   $description .= '<dt>'.'[week]'.'</dt>';
   $description .= '<dd>'.t('The week number (1-52) of the year the node was created.').'</dd>';                        
   $description .= '</dl>';
-  $items .= form_textfield('Pattern for the path',
-                           'pathauto_pattern',
-                           variable_get('pathauto_pattern','[title]'),
-                           65,
-                           128,
-                           $description,
-                           NULL,
-                           FALSE);
 
-  $examples = t('<b>Examples:</b>'.
+  $nodetypes = node_list();
+  foreach ($nodetypes as $ntype) {
+    if (module_exist('flexinode') and !strncasecmp($ntype, 'flexinode-', 10)) {
+       $ntype = flexinode_node_name($ntype);
+    }     
+
+    $items .= form_textfield('Pattern for all '.$ntype.' paths',
+                             $ntype.'_pathauto_pattern',
+                             variable_get($ntype.'_pathauto_pattern','[title]'),
+                             65,
+                             128,
+                             '',
+                             NULL,
+                             FALSE);
+  }
+
+  $description .= t('<b>Examples:</b>'.
         '<p>The following examples of aliases generated from various patterns are all based on a node titled '.
         '"This is a (sample) node", created at 11:23 (am) on February 6, 2005, '.
         'with a category of Sports, which is a subcategory of News, in the '.
@@ -143,7 +156,7 @@
         '</dl>'
       );
 
-  $output .= form_group(t('Format settings'), $items, $examples);
+  $output .= form_group(t('Format settings'), $items, $description);
 
   // %%% Should only show when there are unaliased nodes
   $items = '';
@@ -185,6 +198,15 @@
     $placeholders['[sec]']  = date('s', $node->created);
     $placeholders['[week]'] = date('W', $node->created);
 
+    // Node Id info
+    $placeholders['[nid]'] = $node->nid;
+
+    // User name info
+    $result = db_query("SELECT name FROM {users} WHERE uid = '%u'", $node->uid);
+    $userinfo = db_fetch_object($result);
+    $placeholders['[user]'] = $userinfo->name;  
+		    
+
     // Category info
     if (module_exist('taxonomy')) {
       $firsttermid = $node->taxonomy[0];
@@ -216,7 +238,7 @@
     }
     
     // Retrieve and apply the pattern
-    $pattern = strtolower(variable_get('pathauto_pattern', '[title]'));
+    $pattern = strtolower(variable_get($placeholders['[type]'].'_pathauto_pattern', '[title]'));
     $alias = str_replace(array_keys($placeholders), $placeholders, $pattern);
     $alias = strtolower($alias);
     // Two or more slashes should be collapsed into one
@@ -258,7 +280,7 @@
 
 // Generate aliases for all nodes without aliases
 function _pathauto_bulkupdate() {
-  $query = 'SELECT nid,title,created,src,dst FROM {node} '.
+  $query = 'SELECT nid,title,type,uid,created,src,dst FROM {node} '.
     "LEFT JOIN {url_alias} ON CONCAT('node/', nid) = src ".
     'WHERE dst is null';
   $result = db_query($query);
