CCK-Feld am Benutzernamen anhängen - function phptemplate_username
am 15.07.2009 - 11:06 Uhr in
Hallo,
ich möchte gerne global ein CCK-Feld "field_profile_age" (=computed field)am Benutzernamen anhängen. Dass ich die Funktion "function phptemplate_username" in der template.php hinzufügen muss, und dort die Änderungen vornehmen muss, habe ich schon recherchiert. Nur wie, weiß ich leider nicht. Schön wärs, wenn ich auch die Schriftgröße des angezeigten Feldes mit CSS anpassen könnte.
Hat jemand Tipps?
Danke!
Gruß,
Hendrik
Die originale Funktion ist:
function theme_username($object) {
if ($object->uid && $object->name) {
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($object->name) > 20) {
$name = drupal_substr($object->name, 0, 15) .'...';
}
else {
$name = $object->name;
}
if (user_access('access user profiles')) {
$output = l($name, 'user/'. $object->uid, array('attributes' => array('title' => t('View user profile.'))));
}
else {
$output = check_plain($name);
}
}
else if ($object->name) {
// Sometimes modules display content composed by people who are
// not registered members of the site (e.g. mailing list or news
// aggregator modules). This clause enables modules to display
// the true author of the content.
if (!empty($object->homepage)) {
$output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));
}
else {
$output = check_plain($object->name);
}
$output .= ' ('. t('not verified') .')';
}
else {
$output = check_plain(variable_get('anonymous', t('Anonymous')));
}
return $output;
}- Anmelden oder Registrieren um Kommentare zu schreiben

Hat niemand den "goldenen"
am 15.07.2009 - 19:45 Uhr
Hat niemand den "goldenen" Tipp?