Pages

Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Monday, May 6, 2013

Social Engine 4-Fetching and displaying a menu from backend

1. Create a menu from admin backend by going to Layout->Menu Editor from menu

2. Now go to database and in table "engine4_core_menus" find the entry for your menu and give the same name under "name" field(if already not there)

3. Now in controller to assign the menu to a view variable use

 $this->view->navigation=Engine_Api::_()->getApi('menus','core')->getNavigation('credit_main');  

where 'credit_main' is the 'name' of your menu from table "engine4_core_menus"

To render menu in view use


 echo $this->navigation()->menu()->setContainer($this->navigation)->render();  



Friday, May 3, 2013

Social Engine 4-Get User Info

$user_id=Engine_Api::()_->user()->getviewer()->getIdentity();

$user_info=Engine_Api::_()->user()->getUser($user_id);

Then you get an array $user_info

Now to get let us suppose email of user we use

$user_info['email'];

print_r($user_info) to get data array and check other key's

The other keys are


  1. user_id
  2. email
  3. username
  4. displayname
  5. photo_id
  6. status
  7. status_date
  8. password
  9. salt
  10. locale
  11. language
  12. timezone
  13. search
  14. show_profileviews
  15. level_id
  16. invites_used
  17. extra_invites
  18. enabled
  19. verified
  20. approved
  21. creation_date
  22. creation_ip
  23. modified_date
  24. lastlogin_date
  25. lastlogin_ip
  26. update_date
  27. member_count
  28. view_count