Forums

Displaying Name without ID

bandunger 07 Aug, 2010
Hello all forum, i have search content of the forum related with this topic. But there is no answer my question

How to display name of user (not login name) in chrono connectivity? I mean no of_user_id number ?

Thanks for all member.🙂
GreyHead 07 Aug, 2010
Hi bandunger,

In the header box
<?php
$user =& JFactory::getuser();
echo $user->name;
?>


Bob
bandunger 07 Aug, 2010
Thanks for your answer, but this is still not work in my code. Here my code :

GreyHead 07 Aug, 2010
Hi bandunger,

I don't' see the code there?

Where do you want the username to show up? Is this to replace the {cf_user_id} in the body? That's not at all clear from your posts.

Bob

PS I do see a ?> tag that looks wrong?
bandunger 07 Aug, 2010
Yes I want to change {cf_user_id} with name of user. What should I do ?

About the tag ?> is my last code, now I remove it.
GreyHead 07 Aug, 2010
Hi bandunger,

In the body section put this code:
<?php
$user =& JFactory::getuser($MyRow->cf_user_id);
?>
. . .
<td . . .> <?php echo $user->name; ?></td>
. . .


Bob
bandunger 08 Aug, 2010
Thanks Bob, it's very helpful.

This script is work.



This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger