include '../Class/Img_ctl.php'; $mapLoad = new mapLoad(); $auth = new Auth(); $hash_tag = new Hash_tag(); $Img_ctl = new Img_ctl(); session_start(); // num 값이 있는 경우 num값 만큼만 가져옴 (기본값 5) if (isset($_POST['num'])) { $maps = $mapLoad->getMapFeedCapture($_SESSION['user_id'], $_POST['num']); } else { $maps = $mapLoad->getMapFeedCapture($_SESSION['user_id']); } $map_list[] = null; // 결과 담을 변수 foreach ($maps as $map) { $user_info = $auth->user_info($map['user_id']); // 각 맵의 사용자 정보 가져옴 $tag = $hash_tag->get_tag_id_by_map($map['map_id']); // 태그 정보 foreach ($tag as $tag_id) { $tag_name .= "#" . $hash_tag->get_tag_name($tag_id) . " "; // 태그 네임 저장 } if ($Img_ctl->is_map_liker($map['map_id'], $_SESSION['user_id'])) { $is_like = 'true'; } else { $is_like = 'false'; } array_push($map_list, $map + array('is_like' => $is_like, 'nickname' => $user_info['nickname'], 'tag_name' => $tag_name)); // tag 이름 가져옴 $tag_name = null;
<?php include '../Class/Auth.php'; session_start(); $Auth = new Auth(); if (!empty($_POST['user_id'])) { $follow_result = $Auth->get_follow($_POST['user_id']); } else { $follow_result = $Auth->get_follow($_SESSION['user_id']); } $follow_list = array(); foreach ($follow_result as $user_id) { $user_info = $Auth->user_info($user_id); // 나중에 세션 데이터를 사용 user_id를 $_SSESION['user_id'] 를 사용한다. //$is_follow = $Auth->is_follow($my_id, $user_id); array_push($follow_list, array('user_id' => $user_id, 'nickname' => $user_info['nickname'], 'user_photo' => $user_info['user_photo'], 'is_follow' => 'true')); } echo urldecode(json_encode($follow_list));
<?php include '../Class/Img_ctl.php'; include '../Class/Auth.php'; session_start(); if ($_SESSION['is_login'] === true) { $Img_ctl = new Img_ctl(); $Auth = new Auth(); $comments = $Img_ctl->getComments($_POST['img_id'], 0); $co_result = array(); foreach ($comments as $comment) { $user_info = $Auth->user_info($comment['user_id']); $profile_img = array('user_photo' => $user_info['user_photo']); array_push($co_result, $comment + $profile_img); } $result = array('result' => 'true', 'comments' => $co_result); } else { $result = array('result' => 'false', 'msg' => '로그인이 필요합니다'); } echo urldecode(json_encode($result)); ?>
<?php include '../Class/Auth.php'; session_start(); $Auth = new Auth(); if (!empty($_POST['user_id'])) { $user = $Auth->user_info($_POST['user_id']); } else { $user = $Auth->user_info($_SESSION['user_id']); } //var_dump(urlencode($user[0]['user_photo'])); if (!empty($user)) { $result = array('email' => $user['email'], 'phone' => $user['phone'], 'nickname' => $user['nickname'], 'career' => $user['career'], 'user_photo' => $user['user_photo'], 'follower' => $user['follower'], 'following' => $user['following']); } else { $result = array('result' => 'false'); } echo urldecode(json_encode($result));
include '../Class/Img_ctl.php'; //session_start(); //if ($_SESSION['is_login']) { $mapLoad = new mapLoad(); $userLoad = new Auth(); $hash_tag = new Hash_tag(); $Img_ctl = new Img_ctl(); $mapArray = array(); // POST로 온 tag_name 가져옴 $result_map_id = $hash_tag->get_map($_POST['tag_name']); if (!empty($result_map_id)) { // 각 맵ID 별로 가져옴 foreach ($result_map_id as $map_id) { $map_info = $mapLoad->get_map_info($map_id); // 맵정보 $user_info = $userLoad->user_info($map_info['user_id']); // 유저정보 $tag = $hash_tag->get_tag_id_by_map($map_id); // 태그 정보 foreach ($tag as $tag_id) { $tag_name .= "#" . $hash_tag->get_tag_name($tag_id) . " "; // 태그 네임 저장 } if ($Img_ctl->is_img_liker($_POST['img_id'], $_SESSION['user_id'])) { $is_like = 'ture'; } else { $is_like = 'false'; } array_push($mapArray, array('user_id' => $map_info['user_id'], 'nickname' => $user_info['nickname'], 'user_photo' => $user_info['user_photo'], 'map_id' => $map_id, 'map_name' => $map_info['map_name'], 'map_capture' => $map_info['map_capture'], 'description' => $map_info['description'], 'liker' => $map_info['liker'], 'is_like' => $is_like, 'tag_name' => $tag_name)); $tag_name = ""; }