Anmeldung

if (check_plain($_GET[nid])) {
//get translated nid
$nid = check_plain($_GET[nid]);
$node = node_load($nid);
/*
print '

';
  print_r($node);
  print '

';
*/
$query = "SELECT * FROM {node} WHERE tnid = '%d' AND nid != '%d'";
$node_translated = db_fetch_object(db_query($query, $node->tnid, $node->nid));

$query = "SELECT count(*) FROM {webform_submitted_data} WHERE data = '%s' OR data = '%s' AND cid='5'";
$count = db_result(db_query($query, $node->nid, $node_translated->nid));

if ($count >= $node->field_programm_maxparticipants[0]['value']) {
$order = ($count - $node->field_programm_maxparticipants[0]['value'] + 1);
print t('Leider ist der Workshop bereits voll. Wenn Du Dich dennoch jetzt anmeldest, kommst du auf den folgenden Platz auf der Warteliste: ') . $order .'
';
print t('The workshop is already full. If you register now you will be on a waiting list. Your position on the list will be number: ') .$order;

} else {
print t('Die Anmeldung ist bindend. Bitte so bald als möglich mit uns in Verbindung setzen falls Du doch nicht teilnehmen kannst!') .'
';
print t('The registration is obligatory. Please contact us if you registered but cannot participate!');
}
} else {
$year = date('Y');
print t('Das direkte Ausfüllen des Anmeldeformulars ist nicht möglich! Bitte benutze den Anmeldelink auf der jeweiligen Workshopseite!') .'
'. l('Programm', 'programm/'. $year) .'
';
print t('You cannot register directly. Please use the registration button on the workshop site!') .'
'. l('Programm', 'programm/'. $year);
}

?>