function sitehelper_form_alter($form_id, &$form) {
global $user;
switch ($form_id) {
// Only do this for the review type's form
case 'minfo_node_form':
// Get the parent node's id from the url (url created from a different node)
if(arg(1) == 'add') {
$pnid = $_GET['pnid'];
$newpnid = intval($pnid);
$pnode = node_load($newpnid);
// Set the parentnid field's value
$form['field_parentnid'][0]['value']['#value'] = $newpnid;
}
if($user->uid != '1') {
// Hide the field
$form['field_parentnid'][0]['value']['#access'] = FALSE;
}
break;
}
}