By John Whelan on Thursday, 22 May 2014
Posted in General Issues
Replies 19
Likes 0
Views 861
Votes 0
I have three applications from JReviews that appear in my user's profile page:

1) My Reivews
2) My Listings
3) My Profile Ratings

How do I change the order in which these appear? I'd like to have them render as follows:

1) My Profile Ratings
2) My Reviews
3) My Listings
I was wondering the same thing. I'm okay with how it is for now, but eventually would love to be able to change the order so that the most important app can be placed first.
·
Thursday, 22 May 2014 02:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey guys,

Currently you can't really "order" the apps right now but it's planned for the future
·
Thursday, 22 May 2014 03:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for the heads up on this, glad to hear that it's planned for the future.
·
Thursday, 22 May 2014 03:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Out of curiosity - what determines the order in which they appear? I might take a stab at hardcoding it in for the moment.
·
Thursday, 22 May 2014 03:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello John,

There's no "ordering" column for it right now yet They are ordered by the primary key which is ID I believe.
·
Thursday, 22 May 2014 11:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Does that mean you could uninstall the apps and reinstall them in the order that you'd like them to appear?
·
Thursday, 22 May 2014 12:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, that could work as well
·
Thursday, 22 May 2014 14:15
·
0 Likes
·
0 Votes
·
0 Comments
·
I tried a couple of ways to reorder the apps but to no avail:

1) I changed the primary key IDs in the database
2) I uninstalled and reinstalled the apps

Any other thoughts on how ES chooses the app order on a user's profile?
·
Monday, 02 June 2014 09:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello John,

Try this, edit the file /components/com_easysocial/views/profile/view.html.php and at line 191 locate the codes below,


$options = array( 'view' => 'profile' , 'uid' => $user->id , 'key' => SOCIAL_TYPE_USER);


Replace it with,


$options = array( 'view' => 'profile' , 'uid' => $user->id , 'key' => SOCIAL_TYPE_USER, 'order' => 'desc', 'sort' => 'id');


This would force MySQL to sort apps by id in a descending order. Currently it's actually being sorted by MySQL as we do not explicitly sort apps
·
Tuesday, 03 June 2014 00:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark,

I tried this with both 'order' => 'desc' and 'order' => 'asc' and neither seem to change the ordering of the apps. For my site, there is a particular use case that I have in mind for being able to control the order of the apps. Is there another approach that you can suggest?

- John W.
·
Friday, 06 June 2014 05:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello John,

The codes above enforces the sorting based on the app id. If you want to reorganize your apps ordering, you'll probably want to uninstall them and re-install the apps again so that they get a fresh set of id.
·
Friday, 06 June 2014 11:07
·
0 Likes
·
0 Votes
·
0 Comments
·
OK. I'll give that a shot. Thanks Mark.
·
Saturday, 07 June 2014 02:55
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Saturday, 07 June 2014 15:19
·
0 Likes
·
0 Votes
·
0 Comments
·
I've tried multiple different ways of getting the apps to order in a descending manner, but just cannot get it to work. My apps and their ID's are as follows:

113 - Ratings of me
112 - My reviews
111 - My listings

No matter what I try and no matter what the appID, the order that they appear is always as follows:

My reviews
My Listings
Ratings of me

How can I verify that the code that you provided above actually produces a result set with the apps ordered by ID descending as it does not appear to work.

- JW
·
Thursday, 26 June 2014 03:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello John,

The code that I have provided above ensures that the apps are sorted by "id".
·
Thursday, 26 June 2014 10:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark,

That's weird because that's not the behavior that I'm seeing. Let me check it again.

- JW
·
Thursday, 26 June 2014 11:44
·
0 Likes
·
0 Votes
·
0 Comments
·
To be honest, I really have no idea as to why it isn't sorting and I probably guess the id is not correct.
·
Thursday, 26 June 2014 11:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Doing a bit more troubleshooting on this - some questions:

1) Would it matter that these JReviews apps are set as widgets to appear above the stream in the user's profile?
2) Those apps are set as 'default' apps - might that have any impact?
3) Looking at the code as follows:
		$appsModel 	= Foundry::model( 'Apps' );
$options = array( 'view' => 'profile' , 'uid' => $user->id , 'key' => SOCIAL_TYPE_USER, 'order' => 'desc', 'sort' => 'id');
$apps = $appsModel->getApps( $options );
and doing a var_dump ($apps) outputs 'array(0) { } '
·
Thursday, 26 June 2014 14:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello John,

Perhaps if you could supply us with your site's access and FTP, and phpmyadmin, I will help you to quickly check on this when I have some free time
·
Friday, 27 June 2014 00:25
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post