Support Forum

Add @username to the left columm

CA Carlos
Carlos
Member

Hello! i would like to know if is possible to add the @username just below the “name to show” on the left column of a single topic view…

 

I know that it mus be added on the first row of the spTopicView.php but i dont know hoy to call it… 

 

The “show” name is

 

sp_PostIndexUserName(‘tagClass=spPostUserName spCenter’);

but i dont know how to call to the @username 

 

 

can anyone help me?

 

 

 

 considere registrandote

 

8 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member
  1. By @username – do you mean the login name (as opposed to the display name which the forum currently uses for all user display)?
  2. I do not really know what you mean by ‘name to show’. Can you explain? Or perhaps an image?
  3. And then – which user do you mean? The user who is currently looking at the site?
CA Carlos
Carlos
Member

Hi Yellow Swordfish

Thanks for answering

For Q1. Exactly i want to show the login name and at the same time the display name

Q2. I wanted to say the ” display name ” instead of “name to show” ( sorry for my poor english)

Q3. What i want to do is put the login name down to the display name 

 

In your case could be 

AVATAR
Yellow Swordfish

@yellowswordfish (loginname)

Location 

 

ect…

 

I just wanted to let know that i know the place where to put it, i need only the Function that is calling to the login name 

YS Yellow Swordfish
Yellow Swordfish
Member

We do not actually have a supplied template function for that as we have never been asked for it before. Most users want to hide and protect their login name and not let it be known. But – something like this will work:

echo '<div class="spPostUserLocation spCenter">';
echo $spThisPostUser->user_login;
echo '</div>';

although note that this re-uses the class used for the location data.

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

CA Carlos
Carlos
Member

Thanks, i wil try it…

 

The main reasons is that i have a large forum of 38.000 users… if they try to mention one to another it becomes a total nighmare if you dont know the login name…

CA Carlos
Carlos
Member

It worked! many thanks!!!

 

Anychange to show a @ in front of the login name? 

CA Carlos
Carlos
Member

Any chance to show a @ in front of the login name? 

YS Yellow Swordfish
Yellow Swordfish
Member

Just echo it out before the login name:

echo '@' . $spThisPostUser->user_login;

that will work.