Wednesday, December 16, 2009

Get current logged user user_id in Social Engine 4

How to get current logged user user_id in Social Engine 4

As you know that Social engine used Zend framework.
In any page if you need current logged in user's user_id then you can find it via this
one piece of line code:

$currentUserID=Engine_Api::_()->user()->getViewer()->getIdentity();
echo $currentUserID;


now current logged in user's id stored in the variable $currentUserID,
you can use it in your code as you want.

7 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. This comment has been removed by a blog administrator.

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete