Display the username or full name of users on the Oxwall Newsfeed status update textarea. Effectively replacing ‘What’s happening?’ with a custom message.
Last updated on May 23rd, 2019 at 02:40 am
You might be a little bit surprised at the sequence at which articles are being published here, a bit weird right? Over the last few days, I have been working to correct that, so from now onward the articles here will follow at a steady sequence: This is to make sure that our readers don’t miss any of our updates.
This version of our Oxwall custom code modification will see us modify the default placeholder text in the update status textarea. Now your users will see something like What’s happening {$userName}? ( {$UserName} will be automatically replaced by the user’s name) instead of What’s happening?, if you used Facebook before 2012 you will understand what I’m saying.
Here is a demonstration. In place of this:
You will have something like this:
Amazing right? Here we go….
Step #1: Assign Current User Display Name to Language Key
Backup and edit this file /ow_plugins/newsfeed/components/update_status.php from your cpanel or code editor.
Find and replace this code:
$field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );
with:
//Get current user displayname
$userName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
//Assign displayname to language key
$field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation',array('userName'=>$userName)) );
Save your changes.
Step #2: Modify Newsfeed Status Language Value
Logon to your admin account. Change the text value for language key newsfeed+status_field_invintation to What’s happening {$userName}?
To locate the key value, simply search for “What’s happening?” (without quote) on the language setting page.
- Go to Admin Dashboard > Settings > Language
- Select Newsfeed from the Show Select field.
- Enter What’s happening? on the text input box and click Go
- Change What’s happening? to What’s happening {$userName}?
Save your changes and enjoy!
Did you get the answer you were searching for?
Save hours of searching online or wasting money testing unnecessary plugins, get in touch with me and let's discuss a suitable plan for your project. Best thing about this service is that you are never placed on hold and get to talk to an expereinced Oxwall/Skadate developer.
Get Answers for Free!
Ask a question related to this topic and get immediate answers from other community members in 48hrs or less. Contribute by answering members questions.
Ask Question
Premium Service
Whether it's a custom plugin, theme or dedicated support needed to get you started on your project, get professional 24/7 support tailored to your need.
Get in Touch
Or just leave a comment...