function tracker_pathauto_bulkupdate in Pathauto 5
Same name and namespace in other branches
- 5.2 pathauto_user.inc \tracker_pathauto_bulkupdate()
- 6 pathauto_user.inc \tracker_pathauto_bulkupdate()
File
- ./
pathauto_user.inc, line 166
Code
function tracker_pathauto_bulkupdate() {
$query = "SELECT uid,name,src,dst FROM {users} LEFT JOIN {url_alias} ON CONCAT('user/', uid) = src WHERE uid > 0";
$result = db_query($query);
$user = db_fetch_object($result);
$count = 0;
$placeholders = array();
while ($user) {
$placeholders[t('[user]')] = pathauto_cleanstring($user->name);
$placeholders[t('[uid]')] = $user->uid;
$src = 'user/' . $user->uid . '/track';
if ($alias = pathauto_create_alias('tracker', 'bulkupdate', $placeholders, $src)) {
$count++;
}
$user = db_fetch_object($result);
}
drupal_set_message(format_plural($count, "Bulk update of user tracker pages completed, one alias generated.", "Bulk update of user tracker pages completed, @count aliases generated."));
}