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

trouble with mobile site {$username} not working | Forum

Jeroen
Jeroen Feb 23 '14
hello i need a littlebit of help


i wanna develop the mobile page.. with username in the dashboard and newsfeed.


i fix it in the desktop version

    //  $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );  $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('username' => $displayName)));


but this is not working in the mobile pages


/ow_plugins/newsfeed/mobile/components/update_status.php


how to get this working


greets doomer

The Forum post is edited by Jeroen Feb 23 '14
ross Team
ross Feb 24 '14
Topic was moved from Bug reports and troubleshooting.
Wilson
Wilson Mar 6 '14

I’m having I think the same issue. It works on desktop version in the “Newsfeed” but in the ‘Newsfeed mobile version  its showing the script code {$userName}…see my attached pic. Any help on this would be very thankful.

Wilson

Attachments:
  newsfeed-name-mol.jpg (23.89Kb)
Daisy Team
Daisy Mar 20 '14
First of all you should not redefine the $field variable. The code should look the following way:

        $field = new Textarea('status');
        $field->setHasInvitation(true);
        $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('userName' => $displayName)));
        $this->addElement($field);
 

The string you are talking about is hardcoded in the mobile newsfeed template, therefore you need to pass the $displayName variable to it:

/newsfeed/mobile/views/components/update_status.html

To make this work for the mobile you should perform the following steps:

1. Go to /newsfeed/mobile/components/update_status.php and add the following strings onto the 44, 45 lines:

        $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $this->assign('displayName', $displayName);

2. Go to /newsfeed/mobile/components/update_status.php and add the following strings onto the 102, 103 lines:

        $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('userName' => $displayName)));

3. Go to /newsfeed/mobile/views/components/update_status.html file and add the userName=$displayName variable to the text string. It should look the following way:

 <textarea class="owm_invitation">{text key="newsfeed+status_field_invintation" userName=$displayName}</textarea>
The Forum post is edited by Daisy Mar 20 '14
Jeroen
Jeroen Mar 22 '14
Yesss you make my day :)))
Wilson
Wilson Mar 24 '14
I disable mobile version for now…gonna wait for more improvements before enable it again…but thanks for the input and code information Daisy!

Wilson
Harry
Harry Dec 18 '14
I tried this on 1.72 and no matter what i do ( uppercase, lowercase, mixed, etc ) all I get is the variable name and no actual display name.  The same is true with the desktop version ( using the other code, of course ).
Daisy Team
Daisy Jan 19 '15
To make this work for 1.7.2 version, you should perform the following steps:

1. Go to /newsfeed/mobile/components/update_status.php file, search for the following strings:

$field = new Textarea('status');
        $field->setHasInvitation(true);
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );
        $this->addElement($field);

 and add the following strings onto the 110, 111 lines:

        $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('userName' => $displayName)));

2. Go to /ow_plugins/newsfeed/components/update_status.php file, search for the following strings:

$field = new Textarea('status');
        $field->setHasInvitation(true);
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );
        $this->addElement($field);

 and add the following strings onto the 204, 205 lines:

        $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('userName' => $displayName)));


3. Go to /newsfeed/mobile/views/components/update_status.html file and add the userName=$displayName variable to the text string. It should look the following way:

 <textarea class="owm_invitation">{text key="newsfeed+status_field_invintation" userName=$displayName}</textarea>
Marcel
Marcel Sep 14 '15
Its not work in the 1.8 moblile?

i have:

/ow_plugins/newsfeed/components

$field = new Textarea('status');
        $field->setHasInvitation(true);
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );
        $this->addElement($field);
        $displayName =     BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('userName' => $displayName)));

ow_plugins/newsfeed/mobile/components

        $field = new Textarea('status');
        $field->setHasInvitation(true);
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation') );
        $this->addElement($field);
        $displayName = BOL_UserService::getInstance()->getDisplayName(OW::getUser()->getId());
        $field->setInvitation( OW::getLanguage()->text('newsfeed', 'status_field_invintation', array('userName' => $displayName)));


ow_plugins/newsfeed/mobile/views/components

<div class="owm_newsfeed_status_update owm_bg_color_2 clearfix" id="newsfeed-status-form-inv">
    <span class="owm_newsfeed_status_update_add_icon"></span>
     <textarea class="owm_invitation">{text key="newsfeed+status_field_invintation" userName=$displayName}</textarea>
Marcel
Marcel Sep 14 '15
Works fine on the website but not on the moblie version