本文整理汇总了PHP中Relationship::session_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::session_id方法的具体用法?PHP Relationship::session_id怎么用?PHP Relationship::session_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::session_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find_connection
public function find_connection($uid)
{
$db = new Database();
$db->connect();
$userid = Relationship::session_id();
$viewable = FALSE;
$id = $userid;
$relationshipquery = "\n\t\t\t\t\tselect rt.name as relationship\n\t\t\t\t\tfrom relationship r\n\t\t\t\t\tleft join relationshiptype rt on r.realtionshiptypeid=rt.id\n\t\t\t\t\tjoin user s on s.id=r.senderid \n\t\t\t\t\tjoin user rc on rc.id=r.receiverid\n\t\t\t\t\twhere ((r.senderid ='" . $id . "' and r.receiverid='" . $uid . "')\n\t\t\t\t\tor (r.senderid ='" . $uid . "' and r.receiverid='" . $id . "'))\n\t\t\t\t\tand r.confirmed=1\n\t\t\t\t\tand r.realtionshiptypeid>0\n\t\t\t\t\tand s.accountstatusid>0\n\t\t\t\t\tand rc.accountstatusid>0\n\t\t\t\t\torder by r.realtionshiptypeid DESC\n\t\t\t\t\t";
$db->query($relationshipquery);
$tmp = $db->getresult();
if (strlen($tmp['relationship']) > 2) {
$viewable = "You are " . strtolower($tmp['relationship']) . ".";
} else {
$viewable = FALSE;
}
return $viewable;
}