Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-28 12:11:02

K2member
Member
Registered: 2006-10-24
Posts: 19

How to display nickname instead of real name (txp:author)

Hi,
is it possible to display my username instead of my real name when using <txp:author>?
Or am I able to add a new tag which does this?

Thanks

Last edited by K2member (2009-02-28 12:11:53)

Offline

#2 2009-02-28 13:08:58

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: How to display nickname instead of real name (txp:author)

Hi

insert this code into an article form :

<txp:php>
global $thisarticle;
$name0 = fetch('name','txp_users','name',$thisarticle['authorid']);
echo '<p>::: '.$name0.' :::</p>';
</txp:php>

NB: Change the echo string to match your need.

Cheers

Offline

#3 2009-02-28 14:15:17

K2member
Member
Registered: 2006-10-24
Posts: 19

Re: How to display nickname instead of real name (txp:author)

Thanks – looks ugly but it works ;)

Offline

#4 2009-03-01 07:57:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: How to display nickname instead of real name (txp:author)

K2member wrote:

Thanks – looks ugly but it works ;)

If you want less ugly, try one of these plugins:


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#5 2009-03-01 10:05:48

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: How to display nickname instead of real name (txp:author)

Thanks bloke,

I searched for an existing plugin but havent found one! (i must improve my search skills ;) ).

I think it s better with a plugin!

Offline

Board footer

Powered by FluxBB