YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Page Index Toggle Pages: 1
Topic Tools
 
Access Yabb Username in Template (Read 2,002 times)
 Jun 1st, 2010 at 5:24pm
There are no actions to perform.  

SteveInTN 
YaBB Newbie
*
Offline
Posts: 19


None
Access Yabb Username in Template
Hello, is there a way that I can access the Yabb username in the template?  I'm thinking it is something along the lines of:

{yabb username}

But I cannot find the right combo.  Any help would be appreciated.  I'm sure this is a simple one for everyone here.  I've searched for about 30 minutes and cannot find it.

Thanks,

Steve
 
 
IP Logged  
 Reply #1 - Jun 1st, 2010 at 5:32pm
There are no actions to perform.  

SteveInTN 
YaBB Newbie
*
Offline
Posts: 19


None
Re: Access Yabb Username in Template
{yabb uname}

Gives me more than just the username
 
 
IP Logged  
 Reply #2 - Jun 1st, 2010 at 5:57pm
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: Access Yabb Username in Template
Hi,

I don't believe a tag exists just for the name, so you'd have to make a simple code edit...

Find this line in Sources/Subs.pl

Code Select All
    $yydefaultimages = $defaultimagesdir; 


And add after:

Code Select All
    $yyname = ${$uid.$username}{'realname'}; 


You'll then be able to use {yabb name}
 
 
IP Logged  
 Reply #3 - Jun 1st, 2010 at 6:28pm
There are no actions to perform.  
Captain John 
Ex Member


None
Re: Access Yabb Username in Template
Are you sure you want to expose (display) the username ?  The display name is used in memberlist and posts.  Some users repeatedly use the same name (user name) to login to other sites, could reduce their security.
 
 
IP Logged  
 Reply #4 - Jun 1st, 2010 at 6:42pm
There are no actions to perform.  

SteveInTN 
YaBB Newbie
*
Offline
Posts: 19


None
Re: Access Yabb Username in Template
Thank you VERY MUCH Derek!
 
 
IP Logged  
 Reply #5 - Jun 1st, 2010 at 6:45pm
There are no actions to perform.  

SteveInTN 
YaBB Newbie
*
Offline
Posts: 19


None
Re: Access Yabb Username in Template
Capt John,  I wanted to access it so I could pass it off to a widget I developed.
 
 
IP Logged  
 Reply #6 - Jun 1st, 2010 at 6:59pm
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: Access Yabb Username in Template
You're welcome.

The code I posted up though does use the display name and not the username - If you wanted the username instead let me know...

You might also want to change it to this, so if a user isn't logged in, it will use 'Guest' as their name, otherwise nothing will display...

Code Select All
    if ($iamguest) {
        $yyname = "$maintxt{'28'}";
    } else {
	$yyname = "${$uid.$username}{'realname'}";
    } 


CJ - The username wouldn't be visible to anyone but the user anyway...
« Last Edit: Jun 1st, 2010 at 7:05pm by Derek Barnstorm »  
 
IP Logged  
 Reply #7 - Jun 1st, 2010 at 7:06pm
There are no actions to perform.  

SteveInTN 
YaBB Newbie
*
Offline
Posts: 19


None
Re: Access Yabb Username in Template
Derek,  that is precisely what I wanted.  If user isn't logged in then no value and my widget restricts what they can do.  Thanks again!
 
 
IP Logged  
 Reply #8 - Jun 1st, 2010 at 7:10pm
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: Access Yabb Username in Template
Okay, cool. No problem.
 
 
IP Logged  
Page Index Toggle Pages: 1
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.