pragmaMx Support Forum

Archive => veraltete bzw. unsupportete Systeme und Module => Alt Archive => PHPNuke 5.2-6.0 & VKP 5.5 => Thema gestartet von: Dema in 24 Mai 2003, 18:14:00

Titel: Username im block
Beitrag von: Dema in 24 Mai 2003, 18:14:00
Hallo

Ich hab eine frage und zwar will ich den username in einen block einfügen wie kann ich das machen ich hab das so gemacht

function themeuser() {
global $user, $cookie;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}

if ($username == "Anonymous") {
$theuser = "  Create an account";
} else {
$theuser = "Hallo $username!";
}
}
$content = "
$theuser
"

aber das geht nicht kann mir einer helfen??
 
Titel: Re: Username im block
Beitrag von: jogi24 in 24 Mai 2003, 18:23:19
hi
@

hier deine lösung

global $cookie;
       $content .= "<center><h3>Hallo  $cookie[1]</h3><b>\n";

 ;)
Titel: Re: Username im block
Beitrag von: Dema in 24 Mai 2003, 18:31:59
cool es geht aber wie kann ich das machen wenn z.b. ein gast drin ist das er dann hallo gast schreibt und nicht nur hallo
Titel: Re: Username im block
Beitrag von: Andi in 24 Mai 2003, 19:12:43
 ;)  

$var = (empty($cookie[1])) ? "Gast" : $cookie[1];
$content .= "Hallo $var";