<?
/*
Invitation Status:
1. Pending = Send Request But Not Yet Approved or Deny
2. Approved = Accept My Request
3. Deny = Deny My Request
*/
include "P2P.cls.php";
$ObjP2P=new P2PMembers();
//Find All Member Ids (All Registered Members)
//$ObjP2P->ConditionForAllMember="MemberStatus='Active Member'"; //You can set any condition here.
$AllMemIds=$ObjP2P->AllRegisteredMemberIds();
echo "Total Member: ".count($AllMemIds)."<br>";
foreach($AllMemIds as $CurId)
echo "<br>".$CurId;
//Find All Member Ids Who Accept/Pending/Deny My Request. (Using Table: p2p_network)
//Find who still Pending my request.
$ObjP2P->MyMemberId=81; //Set Member Id whose Friend(Accept/Pending/Deny) ids you want to get.
$ObjP2P->InviteStatus="Pending";
$AllPendingMemIds=$ObjP2P->AllMemberIdsByInviteStatus();
if(is_array($AllPendingMemIds))
{
echo "<br>Total Pending: ".count($AllPendingMemIds);
foreach($AllPendingMemIds as $CurId)
echo "<br>".$CurId;
}
else
echo "<br>".$ObjP2P->Error;
//Find who Accept my request.
$ObjP2P->MyMemberId=81; //Set Member Id whose Friend(Accept/Pending/Deny) ids you want to get.
$ObjP2P->InviteStatus="Approved";
$AllApprovedMemIds=$ObjP2P->AllMemberIdsByInviteStatus();
if(is_array($AllApprovedMemIds))
{
echo "<br>Total Approved: ".count($AllApprovedMemIds);
foreach($AllApprovedMemIds as $CurId)
echo "<br>".$CurId;
}
else
echo "<br>".$ObjP2P->Error;
//Find who Deny my request.
$ObjP2P->MyMemberId=81; //Set Member Id whose Friend(Accept/Pending/Deny) ids you want to get.
$ObjP2P->InviteStatus="Deny";
$AllDenyMemIds=$ObjP2P->AllMemberIdsByInviteStatus();
if(is_array($AllDenyMemIds))
{
echo "<br>Total Denied: ".count($AllDenyMemIds);
foreach($AllDenyMemIds as $CurId)
echo "<br>".$CurId;
}
else
echo "<br>".$ObjP2P->Error;
//print_r($AllMemids);
?>
|