Login   Register  
PHP Classes
elePHPant
Icontem

File: example_p2p.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Md. Aminul Islam  >  Tiny P2P  >  example_p2p.php  >  Download  
File: example_p2p.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: Tiny P2P
Manage a social networking a friends
Author: By
Last change:
Date: 2007-06-19 21:46
Size: 1,982 bytes
 

Contents

Class file image Download
<?
    
/*
        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);
?>