本文整理汇总了PHP中Relationship::pending_requests方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::pending_requests方法的具体用法?PHP Relationship::pending_requests怎么用?PHP Relationship::pending_requests使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::pending_requests方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewable_profile
public function viewable_profile($uid)
{
if ($uid == 4) {
return "Master and Commander";
}
$sess = new SessionData('account');
$id = $sess->Retrieve('id');
if ($id == $uid) {
return "This is you.";
}
$relation = new Relationship();
$their_friends = $relation->user_friends($uid, 0, 5000);
$my_friends = $relation->my_friends();
$connections = count(array_intersect($my_friends, $their_friends));
$retvalue = $relation->find_connection($uid);
if ($retvalue) {
$retvalue .= "<br>You have <a href='search.php?mfriends={$uid}&hide=y'>" . $connections . " friend";
if ($connections != 1) {
$retvalue .= "s";
}
$retvalue .= "</a> in common.";
return $retvalue;
}
if ($connections > 0) {
$retvalue = "This is a friend of a friend.<br>You have <a href='search.php?mfriends={$uid}&hide=y'>" . $connections . " friend";
if ($connections != 1) {
$retvalue .= "s";
}
$retvalue .= "</a> in common.";
return $retvalue;
}
$pendingrequest = $relation->pending_requests();
if (in_array($uid, $pendingrequest)) {
$retvalue = "Pending Request.<br>You have <a href='search.php?mfriends={$uid}&hide=y'>" . $connections . " friend";
if ($connections != 1) {
$retvalue .= "s";
}
$retvalue .= "</a> in common.";
return $retvalue;
}
return FALSE;
}
示例2: log
// Validates Session
$sess->Login();
}
$log = new log($_SERVER["PHP_SELF"]);
$db = new Database();
// Creates database object
if (!$db->connect()) {
echo "<p>Error connecting to the database</p>";
}
$id = $sess->Retrieve('id');
$profile = new Profile($id);
$friendarray = $profile->friendsids($id, 0, 5000);
$resultsperpage = 20;
// Adjustable up to 50
$relationpend = new Relationship();
$requestsyourpending = $relationpend->pending_requests();
?>
<title>TheFacebook | Requests</title>
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="favicon.ico">
<center>
<table class="bordertable" cellspacing=0 cellpadding=0 border=0 width=700>
<tr><td>
<table class="bottomborder" cellspacing=0 cellpadding=0 border=0 width=100%>
<tr><td width=350 bgcolor=#3B5998>
示例3: strtolower
$success = FALSE;
break;
}
$error .= "<br>";
} else {
$error = "</b></font>A request has been sent to " . $profile->retrieve("name") . " to confirm your request.";
if ($_REQUEST['confirm'] == "Confirm") {
$error = "</b></font>Confirmed! <a href='profile.php?id=" . $fid . "'>View their profile</a> or <a href='reqs.php'>Go Back to Pending Requests</a>";
}
if ($_REQUEST['deny'] == "Deny") {
$error = "</b></font>The request has been removed. <a href='reqs.php'>Go Back to Pending Requests</a>";
}
$success = true;
}
}
$yourpending = $relation->pending_requests();
if (in_array($fid, $yourpending)) {
$success = true;
$relationshipwanted = strtolower($relation->getname('relationshiptype', $relation->getrelationshiptype($id, $fid)));
$error = "</b></font><form method=post action=addfriend.php><input type=hidden name=id value='" . $fid . "'><a href='profile.php?id=" . $fid . "'>" . $profile->retrieve("name") . "</a> would like you to confirm that you are " . $relationshipwanted . ". <input class=inputsubmit type=submit name='confirm' value='Confirm'><input class=inputsubmit type=submit name='deny' value='Deny'></form>";
}
?>
<title>TheFacebook | Add Friend</title>
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="favicon.ico">
<center>
<table class="bordertable" cellspacing=0 cellpadding=0 border=0 width=700>