Only in pathauto: .pathauto.module.marks diff -urp pathauto_old/pathauto.module pathauto/pathauto.module --- pathauto_old/pathauto.module 2007-09-17 22:31:44.000000000 +0200 +++ pathauto/pathauto.module 2007-10-15 17:12:30.000000000 +0200 @@ -515,6 +515,10 @@ function pathauto_user($op, &$edit, &$us $src = 'user/'. $user->uid .'/track'; $alias = pathauto_create_alias('tracker', $op, $placeholders, $src); } + if (module_exists('contact')) { + $src = 'user/'. $user->uid .'/contact'; + $alias = pathauto_create_alias('contact', $op, $placeholders, $src); + } } break; case 'delete': @@ -530,6 +534,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: diff -urp pathauto_old/pathauto_user.inc pathauto/pathauto_user.inc --- pathauto_old/pathauto_user.inc 2007-08-21 23:51:25.000000000 +0200 +++ pathauto/pathauto_user.inc 2007-10-15 17:19:54.000000000 +0200 @@ -78,6 +78,29 @@ 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['groupheader'] = t('Personal contact form path settings'); + $settings['patterndescr'] = t('Pattern for the personal contact form paths'); + $settings['patterndefault'] = t('users/[user]/contact'); + $patterns = token_get_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() { @@ -143,3 +166,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('user/', uid, '/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.")); +}