CCK-Feld am Benutzernamen anhängen - function phptemplate_username
am 19.07.2009 - 11:35 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.
Werk kann mir helfen?
Danke!
Gruß,
deepz0ne
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

ich vermute du hast dann
am 19.07.2009 - 12:25 Uhr
ich vermute du hast dann auch schon sicher das feld erstellt.
Falls ja dann gebe dir mithilfe des Devel Moduls die Variable $account in theme_username mal aus:
dsm($account);
--------------
Blog www.freeblogger.org: Deutscher IRC-Channel: irc.freenode.net #drupal.de ... Jabber-me: dwehner@im.calug.de
SirFiChi ist auch dein Halbgott.