By cbais on Wednesday, 04 March 2015
Posted in Technical Issues
Replies 11
Likes 0
Views 879
Votes 0
When You set the max. amount of friends in the access part of a profiletype (see screenshot_01), this rule is not working on the frontend at all places....also some other things are wrong with this access setting. Let me begin ;-)

In all points/cases I mention below, the example is with a member that has a profiletype with the limit of 3 friends max.


1. As long as a member has not 3 friends, he can do as many friendsrequests as he wants. Example: A member has just registered to the site. He has no friends yet. He has the limit of 3 friends max. When this user does 200 friend requests at the same time he or she can easily get more friends then 3. He can do friend requests as long as the limit of 3 friends is not reached. and therefor end up with hundreds of friends!

Possible solution: not only check if the amount of friends is reached with every friend request, but also limit the amount of requests a user can do when the limit friends is set.


2. When the member has 3 (or more) friends, he cannot do requests anymore, however there is a workaround for the user, to still be able to make new friends! This is a bug. It should not be possible. The place where there is no check in the software for the friendslimit is the memberslist! When user who cannot have more friends browses through the userlist, he can still send friend request and make new friends that way! (Screenshot_02)

3. with popup member info, there is a button 'add friend'. When clicking nothing happens if the user has reached his friends limit. This is fine, cause the member should not be able to make new friends anyway. However, it would be nicer for the user, if he received a message that he has reached his friends limit. Now the user is left in the dark about why that button does not work.... (see screenshot_03)

4. this is the case it works as it should work everywhere. Just added this screenshot to clearify the way it should be at all places where a member can send a friend request. See screenshot_04 for the correct working. This is on a user profile.



p.s. Because of the closed (private) behaviour of this community, I removed all names and other information that can lead to users or the site on the screenshots.

p.s.2. I added new site details to this post. The login codes that I gave with the other post of mine, about stream comments disappearing should also still work... Also I added a normal user account login. With this account You can go into the frontend and test it for Yourself. This account already has the max amount of friends and he should not be able to make new friends on the site. Point 1 cannot be tested with this profile. ;-)
Hello cbais,

Sorry for the late reply. Please replace the attached file in: ../administrator/components/com_easysocial/includes/user/user.php and see how it goes.
·
Thursday, 05 March 2015 15:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Nik Faris,

Thanks!
I tried the new user.php file....

Regarding point 1: It looks like You changed something. I created a new user and with the 4th request he gets the popupwindow telling him that he has reached the limit. It would be nice if there would be another languagestring for this also, so I can inform the user with another message. Right now he gets the message: You have reached Your maximum amount of site friends. However, with request fail, I want to give the user another message. something like: You cannot send anymore friend request etc etc....

Regarding point 2, it looks like the friend request is not send when pressing add friend in the userlist, but the user can still press the button. Afterwards the button goes to pending. It looks like the request is send! However when refreshing the page, the pending is gone and he/she can again add users as friends. So I think in real code it is fixed. The request in the userlist is not send, but the user is left in the dark. For the user it looks like the request is send actually. conclusion: almost fixed ;-)

Regarding problem 3, nothing has changed. There is still no notification for the user that he/she is not allowed to have more friends.
·
Thursday, 05 March 2015 16:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Cbais,

For point number 2 and 3, Please download the attachment below and paste it inside your:
#2. /components/com_easysocial/views/friends/view.ajax.php
#3. /media/com_easysocial/scripts/site/profile/popbox.js

Regarding on your point #1, perhaps you can centralized the error message that related to friend exceed limit when sending request. by changing the language string inside your language file into any error message that you find suitable for the users. You can find the language string inside your /language/en-GB/en-GB.com_easysocial.ini and change the following string:
COM_EASYSOCIAL_FRIENDS_EXCEEDED_DIALOG_DESC="Sorry, but you have already exceeded your friends limit. Please contact the site administrator to upgrade your account."

//replace with

COM_EASYSOCIAL_FRIENDS_EXCEEDED_DIALOG_DESC="Your custom message here."


Hope these help
·
Thursday, 05 March 2015 18:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Regarding point 1: already have a custom message there ;-). I was thinking that it might be handy if there are two language strings for this. One to inform the user that he has reached the maximum of friends. The other to inform the user that he cannot send anymore requests, because he reached the limit. However. no priority here. Only one language string will work too. Will try to make it more general, to fix this....

Regarding point 2: much better now! The user gets the popup telling him that he reached the limit. Only one minor point left. The button remains on loading state after closing the popup. After refresh this is gone offcourse. (See attached screenshot).

Regarding point 3: I still see no difference. The button is stil there and when pressing it, nothing happens....
·
Thursday, 05 March 2015 18:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Cbais,

Ah I'm sorry I accidentally sent the old file instead. Please try the attachment below and paste it inside /media/com_easysocial/scripts/site/profile/popbox.js
·
Thursday, 05 March 2015 18:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Also with this version, no difference, stil valid is:

Regarding point 2: much better now! The user gets the popup telling him that he reached the limit. Only one minor point left. The button remains on loading state after closing the popup. After refresh this is gone offcourse. (See attached screenshot).

Regarding point 3: I still see no difference. The button is stil there and when pressing it, nothing happens....
·
Thursday, 05 March 2015 19:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello cbais,

I'm sorry. My colleague forgot to mention that you have to recompile the js when there is a changes in js file which is in your case, the popbox.js. You can compile the js by running this URL http://www.yoursite.com/index.php?option=com_easysocial&compile=true&minify=true. However, I've tried to compile it but failed. Can you provide your FTP so we can fix this since I can access your FTP using the access provided in the first post. Please advise.
·
Friday, 06 March 2015 01:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Nik Faris,

Tried to run that URL myself. Indeed with no succes....

Added new ftp login to the sitedetails of this reply
·
Friday, 06 March 2015 03:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello cbais,

I've compile the js for you. Please give it a try.
·
Friday, 06 March 2015 10:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeah! it works now! Thanks!

only little thing is the loading button in the memberlist, but that is not a real problem.

Will those fixes be in the next release?
·
Saturday, 07 March 2015 17:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Cbais,

I am sorry for the delay of this reply.

Yes this fixes will be include in the next release
·
Monday, 09 March 2015 12:20
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post