uid) {
// global $user;
// $profile = profile_load_profile($user);
//$user->profile_name
//user picture
if ($user->picture) {
$userimage = '
';
print '
' . l($userimage, 'user/' . $user->uid, $options = array('html' => TRUE)) . '
';
}
print '';
print '- ' . l($user->name, 'user/' . $user->uid . '') . '
';
print '- ' . l(t('edit'), 'user/' . $user->uid . '/edit') . '
';
print '- ' . l(t('Sign out'), 'logout') . '
';
print '
';
}
}
/*
Quick & handy function for adding time ago
*/
function mothership_time_ago($timestamp,$granularity = 2, $langcode = NULL){
$difference = time() - $timestamp;
$text = format_interval($difference, $granularity, $langcode) ." ". t("ago");
return $text;
}
/*
return only the terms from a vocabulary in the node
*/
function return_terms_from_vocabulary($node, $vid){
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid');
// $vocabulary = taxonomy_vocabulary_load($vid);
// $content .=''.$vocabulary->name.'
';
$termslist = '';
if ($terms) {
$content .= '';
foreach ($terms as $term) {
$termslist = $termslist . '' . l($term->name, 'taxonomy/term/'.$term->tid) .' | ';
}
//TODO make a better split option hardcoded is kinda sad ;)
$content.= trim ($termslist," |").'';
}
return $content;
}