当前位置: 首页>>代码示例>>PHP>>正文


PHP Relation::fetchFriendList方法代码示例

本文整理汇总了PHP中Relation::fetchFriendList方法的典型用法代码示例。如果您正苦于以下问题:PHP Relation::fetchFriendList方法的具体用法?PHP Relation::fetchFriendList怎么用?PHP Relation::fetchFriendList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Relation的用法示例。


在下文中一共展示了Relation::fetchFriendList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

     $latitude = $_POST['latitude'];
     $longitude = $_POST['longitude'];
     echo json_encode($Profile->returnCoordinates($latitude, $longitude));
     break;
 case 'update_slider':
     $user_id = $_POST['id'];
     $slider = $_POST['slider'];
     $Profile->updateSlider($user_id, $slider);
     break;
 case 'fetch_profile':
     $user_id = $_POST['user_id'];
     $results = $Profile->fetchProfile($user_id);
     $results['images'] = $Profile->fetchImages($results['name'], $results['surname'], $results['id']);
     $results['age'] = $Profile->fetchAge($results['dob']);
     $results['location'] = $Profile->returnLocation($results['latitude'], $results['longitude']);
     $results['friends'] = $Relation->fetchFriendList($user_id);
     $results['relation'] = $Relation->checkRelation($_SESSION['ifitness_id'], $results['id']);
     $results['relation_t'] = $Relation->checkText($results['relation']);
     echo json_encode($results);
     break;
 case 'friend_request':
     $user_1 = $_POST['user_1'];
     $user_2 = $_POST['user_2'];
     $info = $Profile->fetchProfile($user_1);
     $data = array('user_id' => $user_2, 'other_id' => $user_1, 'person_name' => $info['name'], 'person_lastname' => $info['surname'], 'type' => 1);
     echo $Relation->requestFriend($user_1, $user_2);
     echo $Relation->createNotification($data);
     break;
 case 'remove_request':
     $user_1 = $_POST['user_1'];
     $user_2 = $_POST['user_2'];
开发者ID:jacobd1808,项目名称:Showcase,代码行数:31,代码来源:ajaxController.php

示例2: Profile

<?php

$Profile = new Profile($conn);
$Relation = new Relation($conn);
if (isset($_GET['accept'])) {
    $id = $_SESSION['ifitness_id'];
    $other_id = $_GET['accept'];
    $not_id = $_GET['id'];
    $your_profile = $Profile->fetchProfile($id);
    $his_profile = $Profile->fetchProfile($other_id);
    $Relation->acceptRequest($id, $other_id, $his_profile['name'], $his_profile['surname']);
    $Relation->acceptRequest($other_id, $id, $your_profile['name'], $your_profile['surname']);
    $remove = $Relation->removeNotification($not_id);
    if ($remove) {
        $feedback = array("type" => 'valid', "message" => 'Request Accepted');
    }
} else {
    if (isset($_GET['refuse'])) {
        $id = $_GET['refuse'];
        $Relation->removeNotification($id);
    }
}
$friends = $Relation->fetchFriendList($_SESSION['ifitness_id']);
开发者ID:jacobd1808,项目名称:Showcase,代码行数:23,代码来源:friendController.php


注:本文中的Relation::fetchFriendList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。