Thursday, March 11, 2010

Get number of invitations sent in Social engine 4

How to get number of invitations sent in Social engine 4.


In Social Engine you send invitation to your friends or any other person.
But you want to know that how many invitations you had beed sent.
Just use listed below my code, you will get the number of invitations which
you had sent.

<?php
if(Engine_Api::_()->user()->getViewer()->getIdentity()) {
    $currentUserID=Engine_Api::_()->user()->getViewer()->getIdentity();
        // or echo $viewer->getIdentity();
        $sSqlInviter="select count(user_id) as totalInviterSent from engine4_inviter_invites where user_id=".$currentUserID;
        $dbInviterSqli=Zend_Db_Table_Abstract::getDefaultAdapter();
        $stmtInviter=$dbInviterSqli->query($sSqlInviter);
        $rowInviter=$stmtInviter->fetch();
        $totalInviterSent=$rowInviter['totalInviterSent'];
        echo "<b> You have sent $totalInviterSent invitations yet.</b>";
} else {
    echo "No, User is not login";
}
?>



No comments:

Post a Comment