0

I'm using PHPFox for my website. Suppose I want to see the profile of user with user id 126. Whenever I click on any user name following URL appears in the address bar http://34.144.60.142/profile-126/(In case of user_id 126. For other users some other number may appear like profile-244 for user with user_id 244).

From the above URL I'm not at all getting how the profile request is processed and profile data is fetched.

Can someone please explain me how the routing is done in PHPFox in detail.

Thanks.

PHPLover
  • 1
  • 51
  • 158
  • 311

2 Answers2

0
actually when we didn't allow user name in registration then phpfox automatically set a user name "profile-user_id" for eg : if any user have user_id 126 then it's username must be "profile-126" and it's unique.

when you visit any user profile page like 

http://34.144.60.142/profile-126/

http://34.144.60.142/profile-244/

so phpfox fetch data from that username and particular profile will display.
Ankit Agrawal
  • 6,034
  • 6
  • 25
  • 49
  • This thing I already know but my issue is how the profile data is fetched by using which classes and methods? If you could focus on this thing it would be great. – PHPLover Jan 28 '15 at 08:44
  • $aRow = Phpfox::getService('user')->get($mUser, false); – Ankit Agrawal Jan 28 '15 at 09:58
  • Thanks for your immense help. But just one query I still have. Will it work for logged in as well as non-logged in users. I mean after logging in can I see the profile of other people? One more thing how could I get the data regarding relationship of other users with logged in user? – PHPLover Jan 28 '15 at 12:05
  • you can pass user_id or user name of particular user in functions – Ankit Agrawal Jan 28 '15 at 13:30
  • No, you didn't get my point. I want to get the relationship status of logged in user with all other users. How should I get this? – PHPLover Jan 28 '15 at 14:49
0
on profile.index controller

system get user name by using this syntax

$mUser = $this->request()->get('req1');

now system fetch user data from user name by using predefine function.

$aRow = Phpfox::getService('user')->get($mUser, false);

this function exists in module/user/include/service/user.class.php service class.
Ankit Agrawal
  • 6,034
  • 6
  • 25
  • 49
  • Thanks for your answer. But I want something more than that. I want data custom data for a particular user. How to get it? Can you simply explain in the way you mentioned get user Profile as above? It would be of great help to me. – PHPLover Jan 28 '15 at 10:51
  • you can get all custom data from this function $aCustomFields= Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), $iUserId, $iUserGroupId, false, Phpfox::getUserId()); – Ankit Agrawal Jan 28 '15 at 11:16
  • Thanks for your immense help. But just one query I still have. Will it work for logged in as well as non-logged in users. I mean after logging in can I see the profile of other people? One more thing how could I get the data regarding relationship of other users with logged in user? – PHPLover Jan 28 '15 at 12:09