By Techjoomla on Monday, 29 June 2015
Posted in General Issues
Replies 5
Likes 0
Views 683
Votes 0
Hi,

We are creating a mobile app for easysocial, to show activity stream in app we get data from site using RESTFUL api.
In this API we use, Stream library function for retrieving stream data. As given below

$options = array('userId' => $target_user, 'startlimit' => 0, 'limit' => 20);
$stream->get($options);
$result = $stream->toArray();

This return array of stream item object array, but if the SEF global configuration is set to yes or 1 . All urls in stream data appear as SEF url form, is that any method or function is present in easysocial.
So we can get all urls in stream data in non-sef form. While joomla SEF is on.
Please reply me ASAP.
Hello Parth,

Hm, unfortunately right now there's no way to do this. Do you need the "raw" urls?
·
Monday, 29 June 2015 18:38
·
0 Likes
·
0 Votes
·
0 Comments
·
hi,

I need raw ( NON - SEF ) urls, When joomla global configuration SEF set as yes ( 1 )
·
Tuesday, 30 June 2015 18:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Parth,

I am sorry for the delay of this reply.

I'm not really sure if this is what you want but you can alter the url to be non-sef from /components/com_easysocial/themes/wireframe/stream/default.item.php at line 167 and edit the following line,
<a href="<?php echo FRoute::stream( array( 'id' => $stream->uid , 'layout' => 'item' ) ); ?>"><?php echo $stream->friendlyDate; ?></a>
// with
<a href="/index.php?option=com_easysocial&view=stream&id=<?php echo $stream->uid; ?>&layout=item"><?php echo $stream->friendlyDate; ?></a>


Hope these help.
·
Wednesday, 01 July 2015 14:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
Thanks for your feedback,
Unfortunately, this solution won't work in my case.
Is there any function present at easysocial, where i am passing
Single self, url as param and the function will return me non-sef url.
this type function will help us to create non-sef urls in API.
·
Thursday, 02 July 2015 21:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Parth,

I believed I've reply you on this matter on our conversation via skype group chat. Currently the stream contents was generated from various app and the steam lib has no control over how the contents was generated. Anyway, if you need the links in the content to returned in non-sef, you will need to 'trick' Joomla. Try this:

Before you calling the stream lib to return you the stream activities, do this:

$jrouter = JFactory::getApplication()->getRouter();
$jrouter->setMode(JROUTER_MODE_RAW);


The above will tell Joomla Jrouter to use 'non-sef' mode. Once you've retrieved the data from stream lib, you will need to set the jrouter to back to sef mode.


$jrouter->setMode(JROUTER_MODE_SEF);


By the way, in future if you have any questions regarding EasySocial integration with your mobile app, please do send us a message in our skype group chat. We will assist you from there

Hope this help and have a nice day!
Sam
·
Friday, 03 July 2015 11:46
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post