diff -urp pathauto_old/pathauto.module pathauto/pathauto.module --- pathauto_old/pathauto.module 2008-06-20 17:13:59.000000000 -0400 +++ pathauto/pathauto.module 2008-06-20 17:08:46.000000000 -0400 @@ -743,6 +743,10 @@ function pathauto_user($op, &$edit, &$us $src = 'user/'. $user->uid .'/track'; $alias = pathauto_create_alias('tracker', $op, $placeholders, $src, $user->uid); } + if (module_exists('contact')) { + $src = 'user/'. $user->uid .'/contact'; + $alias = pathauto_create_alias('contact', $op, $placeholders, $src, $user->uid); + } } break; case 'delete': @@ -758,6 +762,7 @@ function pathauto_user($op, &$edit, &$us path_set_alias('blog/'. $user->uid .'/feed'); path_set_alias('user/'. $user->uid .'/track'); path_set_alias('user/'. $user->uid .'/track/feed'); + path_set_alias('user/'. $user->uid .'/contact'); break; default: Only in pathauto: .pathauto_user_contact.patch.swp diff -urp pathauto_old/pathauto_user.inc pathauto/pathauto_user.inc --- pathauto_old/pathauto_user.inc 2008-06-20 17:14:37.000000000 -0400 +++ pathauto/pathauto_user.inc 2008-06-20 17:10:16.000000000 -0400 @@ -81,6 +81,30 @@ function tracker_pathauto($op) { } /** + * Implementation of hook_pathauto() for contact form aliases + */ +function contact_pathauto($op) { + switch ($op) { + case 'settings': + $settings = array(); + $settings['module'] = 'contact'; + $settings['token_type'] = 'user'; + $settings['groupheader'] = t('Personal contact form path settings'); + $settings['patterndescr'] = t('Pattern for the personal contact form paths'); + $settings['patterndefault'] = t('users/[uid]/contact'); + $patterns = module_invoke_all('token_list', 'user'); + foreach ($patterns['user'] as $pattern => $description) { + $settings['placeholders'][t('['. $pattern .']')] = t($description); + } + $settings['bulkname'] = t('Bulk generate aliases for personal contact form paths that are not aliased'); + $settings['bulkdescr'] = t('Generate aliases for all existing perosnal contact form pages which do not already have aliases.'); + return (object) $settings; + default: + break; + } +} + +/** * Bulk generate aliases for all users without aliases */ function user_pathauto_bulkupdate() { @@ -148,3 +172,25 @@ function tracker_pathauto_bulkupdate() { "Bulk generation of user tracker pages completed, one alias generated.", "Bulk generation of user tracker pages completed, @count aliases generated.")); } + +/** + * Bulk generate aliases for all users without aliases + */ +function contact_pathauto_bulkupdate() { + $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT(CONCAT('user/', CAST(uid AS CHAR)), '/contact') = src WHERE uid > 0 AND src IS NULL"; + $result = db_query_range($query, 0, variable_get('pathauto_max_bulk_update', 50)); + + $count = 0; + $placeholders = array(); + while ($user = db_fetch_object($result)) { + $placeholders = pathauto_get_placeholders('user', $user); + $src = 'user/'. $user->uid.'/contact'; + if ($alias = pathauto_create_alias('contact', 'bulkupdate', $placeholders, $src)) { + $count++; + } + } + + drupal_set_message(format_plural($count, + "Bulk generation of contact pages completed, one alias generated.", + "Bulk generation of contact pages completed, @count aliases generated.")); +}