MyBB Community Forums

Full Version: show user name variable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

is there any variable in (MyBB-1.6 and/or MyBB-1.8) so we can use in template
for:
show user name of any user?
Hi,

sorry I don't get, what you want to know... You want to access a username in a template - but the name of which user?
Maybe do you mean: {$mybb->user['username']} ? this shows only your own username
(2014-08-21, 11:11 AM)niere8 Wrote: [ -> ]Maybe do you mean: {$mybb->user['username']} ? this shows only your own username

may something like:

{$mybb->user['username']} or {$username}
but for any users ... not for own username !


anyone know which core file generate user links? i want user profile links have the title if possible:

<a href="profilelink" title="username">username</a>
You want the inc/functions.php file. Do a search for the function build_profile_link.
<a href="{$user['profilelink']}" title="{$mybb->user['username']}">{$mybb->user['username']}</a>

and it will have hes / hers username as title

[attachment=32252]
(2014-08-23, 01:06 PM)ekoice Wrote: [ -> ]<a href="{$user['profilelink']}" title="{$mybb->user['username']}">{$mybb->user['username']}</a>

and it will have hes / hers username as title
no i think this code just show own username !



(2014-08-21, 08:53 PM)dragonexpert Wrote: [ -> ]You want the inc/functions.php file.  Do a search for the function build_profile_link.




Thanks i do with this code:
<a href=\"{$mybb->settings['bburl']}/".get_profile_link($uid)."\" title=\"{$username}\"{$target}{$onclick}>{$username}</a>


But like always issue with styled usernames!
<a href="http://domain.com/user-1.html" title="USER STYLE CRASH HERE">user name</a>
we need variable that don't get username style !




---------------------------------
and is there easy way to change link format from this:
http://domain.com/user-1.html

to:
http://domain.com/username.html
or
http://domain.com/username

i know google_seo_plugin do this ... but i don't use that plugin.
You can always use the strip_tags function on the variable $username.