We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Add {$USERNAME} to a custom widegrt | Forum

Ebenezer Obasi
Ebenezer Obasi Feb 11 '14
Please I'm sorry if this has been posted elsewhere. I have tried searching the entire forum but no result.


I want to include {$username} to a custom widget so that if 'paul' logs in to the members zone he can see welcome paul on a custom widget title.

dave Leader
dave Feb 11 '14
in your php file try this
            
   $memid = BOL_UserService::getInstance()->findUserIdByCookie(trim($_COOKIE['ow_login']));

 $memusername = BOL_UserService::getInstance()->getUserName($memid);

 $this->assign('memusername', $memusername);

and then in your language or html file reference   {$memusername}  to show it  so it would be something like

Welcome Back {$memusername}


Team please move this to custom coding, thanks ;)
ross Team
ross Feb 11 '14
Topic was moved from General Questions.
Ebenezer Obasi
Ebenezer Obasi Feb 15 '14
Thanks dave. I will try this code.