table.' '. 'WHERE link_id = '.$id; $rs = $con->select($strReq); $l_label = $rs->f('label'); $l_href = $rs->f('href'); $l_title = $rs->f('title'); $l_lang = $rs->f('lang'); $l_rel = $rs->f('rel'); if (!$rs->isEmpty() && $action == 'edit_link') { $l_label = strip_tags(trim($_POST['l_label'])); $l_title = strip_tags(trim($_POST['l_title'])); $l_href = strip_tags(trim($_POST['l_href'])); $l_lang = strip_tags(trim($_POST['l_lang'])); if (!$l_label || !$l_href) { $err = __('You must provide at least a label and an URL'); } else { $rel = ''; if (isSet($_POST['identity'])) $rel .= 'me'; else { if (isSet($_POST['friendship'])) { if (in_array($_POST['friendship'], array('contact','acquaintance','friend'))) { $rel .= ' '.$_POST['friendship']; } } if (isSet($_POST['physical'])) { $rel .= ' met'; } if (isSet($_POST['professional'])) { $pros = array(); foreach ($_POST['professional'] as $pro) { if (in_array($pro, array('co-worker','colleague'))) { $pros[] = $pro; } } $rel .= ' '.implode(' ',$pros); } if (isSet($_POST['geographical'])) { if (in_array($_POST['geographical'],array('co-resident','neighbor'))) { $rel .= ' '.$_POST['geographical']; } } if (isSet($_POST['family'])) { if (in_array($_POST['family'],array('child','parent','sibling','spouse','kin'))) { $rel .= ' '.$_POST['family']; } } if (isSet($_POST['romantic'])) { $roms = array(); foreach ($_POST['romantic'] as $rom) { if (in_array($rom,array('muse','crush','date','sweetheart'))) { $roms[] = $rom; } } $rel .= ' '.implode(' ',$roms); } } if ($blogroll->updLink($id,$l_label,$l_href,$l_title,$l_lang, $rel) == false) { $err = $blogroll->con->error(); } else { header('Location: '.$url); exit; } } } # Affichage $mySubMenu->addItem( ''.__('Back').'',array($url),$icon,false); buffer::str('

'.__('Edit link').'

'); if ($err != '') { buffer::str( '

'.__('Error(s)').' :

'. '

'.$err.'

'. '
' ); } if ($rs->isEmpty()) { buffer::str('

'.__('No link').'

'); } else { buffer::str( '
'. '
'.__('Edit link').''. '

'. ''. form::field('l_label',40,255,htmlspecialchars($l_label)).'

'. '

'. ''. form::field('l_href',40,255,htmlspecialchars($l_href)).'

'. '

'. ''. form::field('l_title',40,255,htmlspecialchars($l_title)).'

'. '

'. ''. form::field('l_lang',2,2,htmlspecialchars($l_lang)) . '

'. '

'.form::hidden('action','edit_link'). form::hidden('page','edit_link'). form::hidden('id',$id). dcNonce::form(). '

'. '
'. '
'.__('XFN').''. '

'. ''. form::checkbox('identity', 'me', ($l_rel == 'me')).__('Another link for myself').'

'. '

'. ''. form::radio('friendship', 'contact', (strpos($l_rel, 'contact'))).__('Contact'). form::radio('friendship', 'acquaintance', (strpos($l_rel, 'acquaintance'))).__('Acquaintance'). form::radio('friendship', 'friend', (strpos($l_rel, 'friend'))).__('Friend'). form::radio('friendship', '').__('None'). '

'. '

'. ''. form::checkbox('physical', 'met', (strpos($l_rel, 'met'))).__('Met'). '

'. '

'. ''. form::checkbox('professional[1]', 'co-worker', (strpos($l_rel, 'co-worker'))).__('Co-worker'). form::checkbox('professional[2]', 'colleague', (strpos($l_rel, 'colleague'))).__('Colleague'). '

'. '

'. ''. form::radio('geographical', 'co-resident', (strpos($l_rel, 'co-resident'))).__('Co-resident'). form::radio('geographical', 'neighbor', (strpos($l_rel, 'neighbor'))).__('Neighbor'). form::radio('geographical', '').__('None'). '

'. '

'. ''. form::radio('family', 'child', (strpos($l_rel, 'child'))).__('Child'). form::radio('family', 'parent', (strpos($l_rel, 'parent'))).__('Parent'). form::radio('family', 'sibling', (strpos($l_rel, 'sibling'))).__('Sibling'). form::radio('family', 'spouse', (strpos($l_rel, 'spouse'))).__('Spouse'). form::radio('family', 'kin', (strpos($l_rel, 'kin'))).__('Kin'). form::radio('family', '').__('None'). '

'. '

'. ''. form::checkbox('romantic[1]', 'muse', (strpos($l_rel, 'muse'))).__('Muse'). form::checkbox('romantic[2]', 'crush', (strpos($l_rel, 'crush'))).__('Crush'). form::checkbox('romantic[3]', 'date', (strpos($l_rel, 'date'))).__('Date'). form::checkbox('romantic[4]', 'sweetheart', (strpos($l_rel, 'sweetheart'))).__('Sweetheart'). '

'. '
'. '
' ); } ?>