Hey there,

Maybe this is possible already, but I don't quite get how to do it.. I'm trying to do redirect a user to his user edit page by using drupal_goto('user/'.$account->uid.'/edit') and would love if that sent him to 'user/me/edit' automatically.. I know I can just write 'me' in the drupal_goto, but I would really prefer not to hardcode stuff..

Any ideas would be greatly appreaciated!

Thanks,
Martin

Comments

nohup’s picture

you can use me_variable_get('me_alias') instead of $account->uid this will let you configure the alias and keep your code functional as well.

arski’s picture

Hmm, well that works, but that makes the code me-module dependent, which is not necessarily something one would need.. is there no way I could just write in the user id and have the module take care of the rest for me? Like it does when I generate links using the l() function for example? I tried doing something like the following, but that didn't insert the 'me' bit instead of the uid, otherwise it would have been a nice option:
drupal_goto(url('user/'.$account->uid.'/edit'))

Thanks.

nohup’s picture

The 'me' module does not do that. You can try the solution in #3 at http://drupal.org/node/1003146, it should give you the 'username' instead of 'me' as the alias.