I'm trying to make a variable for an edit button. In template.php, I've put this code
function phptemplate_preprocess_node(&$vars) {
if ($user->uid == $node->uid || in_array('moderator', array_values($user->roles))|| $user->uid == 1){
$vars['edit'] = l('Edit', 'node/' . $node->nid . '/edit');
}
}
Then I print $edit in the tpl file. It prints an edit link, but the url looks like this: "node/2%Fedit". What am I doing wrong?