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

What do i do to have a plugin use "Username" code | Forum

Webster Molaudi
Webster Molaudi Jun 8 '18

Hi OXwallers,


I got a plugin called "Butler" https://developers.oxwall.com/store/item/1467 for my website https://www.myvirgo.info. But now my problem is when i put {username} is doesn't render or rather pull the username from the plugin widget .


How can i enable or fix this in the plugin files or widget to pull the user's username instead of pull just text as below.



Lee
Lee Jun 8 '18
Remove the underscore. Should read, {$username}
Webster Molaudi
Webster Molaudi Jun 10 '18
it still didn't work :(
Steve
Steve Jun 10 '18


within 1 minute

Okay this works and to prove it you can see the pic at the end of this post. but do this to achive what you want.


PUTTING USERNAME IN NEWSFEED


You can do this in /ow_plugins/newsfeed/components/UpdateStatus.php
Just a correction.. Its update_status.php actually.
Change the below line $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );
to
$userName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());$field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation',array('userName'=>$userName)) );
And then in your language page, change text for the keystatus_field_invintation.
What’s happening? to What’s happening {$userName}?




The Forum post is edited by Steve Jun 14 '18
Attachments:
  example.jpg (172Kb)
Oxwall Türkiye
Oxwall Türkiye Jun 14 '18

a user entry must be defined on the dedicated php page for each run.

Language definition

function definition

path definition.


You can retrieve the identification information of a username from userservice.php.


Contact PM for further assistance in this regard.