<?php include '../Class/mapLoad.php'; include '../Class/Auth.php'; include '../Class/Hash_tag.php'; 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 {
<?php include '../Class/mapLoad.php'; $maps = new mapLoad(); for ($i = 0; $i < 10; $i++) { $mapArray['mapInfo' . $i] = $maps->getMap(2); // $resultArray에 담기 //array_push($mapArray, $tempArray); } echo urldecode(json_encode($mapArray));
<?php include '../Class/mapLoad.php'; include '../Class/Auth.php'; include '../Class/Hash_tag.php'; include '../Class/Img_ctl.php'; session_start(); if ($_SESSION['is_login']) { $mapLoad = new mapLoad(); $auth = new Auth(); $hash_tag = new Hash_tag(); $Img_ctl = new Img_ctl(); $map = $mapLoad->get_map_info($_POST['map_id']); //var_dump($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_img_liker($_POST['img_id'], $_SESSION['user_id'])) { $is_like = 'ture'; } else { $is_like = 'false'; } $map_info = $map + array('is_like' => $is_like, 'nickname' => $user_info['nickname'], 'tag_name' => $tag_name); // tag 이름 가져옴 } else { $map_info = array('result' => 'false', 'msg' => '로그인이 필요합니다');
<?php include '../Class/mapLoad.php'; session_start(); if ($_SESSION['is_login'] === true) { $mapLoad = new mapLoad(); if ($mapLoad->set_description($_POST['map_id'], $_POST['description'])) { $result = array('result' => 'true'); } else { $result = array('result' => 'false'); } } else { $result = array('result' => 'false', 'msg' => '로그인이 필요합니다'); } echo urldecode(json_encode($result));
<?php include '../Class/mapLoad.php'; $maps = new mapLoad(); for ($i = 0; $i < 10; $i++) { $mapArray['mapInfo' . $i] = $maps->getMapCapture(2); // $resultArray에 담기 //array_push($mapArray, $tempArray); } echo urldecode(json_encode($mapArray));
<?php include '../Class/mapLoad.php'; include '../Class/Auth.php'; include '../Class/Hash_tag.php'; include '../Class/Img_ctl.php'; session_start(); $mapLoad = new mapLoad(); $auth = new Auth(); $hash_tag = new Hash_tag(); $Img_ctl = new Img_ctl(); if (isset($_POST['user_id']) && isset($_POST['num'])) { // user_id 와 num 값이 있는경우 $maps = $mapLoad->getMapCaptureById($_POST['user_id'], $_POST['num']); } else { if (isset($_POST['user_id'])) { // user_id 만 있는경우 num 기본값 5 $maps = $mapLoad->getMapCaptureById($_POST['user_id']); } else { if (isset($_POST['num'])) { // num 값만 있는 경우 $maps = $mapLoad->getMapCaptureById($_SESSION['user_id'], $_POST['num']); } else { // 아무 값도 없는경우 num 기본값 5 $maps = $mapLoad->getMapCaptureById($_SESSION['user_id']); } } } $map_list[] = null; // 결과 담을 변수 foreach ($maps as $map) {
<?php include '../Class/mapLoad.php'; include '../Class/Auth.php'; include '../Class/Hash_tag.php'; include '../Class/Img_ctl.php'; $mapLoad = new mapLoad(); $auth = new Auth(); $hash_tag = new Hash_tag(); $Img_ctl = new Img_ctl(); // num 값이 있는 경우 num값 만큼만 가져옴 (기본값 5) if ($_POST['num']) { $maps = $mapLoad->getMapAllCapture($_POST['num']); } else { $maps = $mapLoad->getMapAllCapture(); } $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';
<?php include '../Class/mapLoad.php'; include '../Class/Img_ctl.php'; session_start(); if ($_SESSION['is_login'] === true) { $mapLoad = new mapLoad(); $Img_ctl = new Img_ctl(); $map_album = $mapLoad->getMap($_POST['map_id']); if ($Img_ctl->is_img_liker($_POST['img_id'], $_SESSION['user_id'])) { $is_like = 'ture'; } else { $is_like = 'false'; } $map_album += array('is_like' => $is_like); } else { $map_album = array('result' => 'false', 'msg' => '로그인이 필요합니다'); } echo urldecode(json_encode($map_album));
<?php include '../Class/mapLoad.php'; include '../Class/Img_ctl.php'; session_start(); if ($_SESSION['is_login'] === true) { $mapLoad = new mapLoad(); $Img_ctl = new Img_ctl(); $result = $mapLoad->get_image($_POST['img_id'], $_SESSION['user_id']); // POST값으로 바꿀것 if ($Img_ctl->is_img_liker($_POST['img_id'], $_SESSION['user_id'])) { $is_like = 'true'; } else { $is_like = 'false'; } $result += array('is_like' => $is_like); $comments = array('comments' => $Img_ctl->getComments($_POST['img_id'], 0)); // POST값으로 바꿀것 } else { $result = array('result' => 'false', 'msg' => '로그인이 필요합니다'); } echo urldecode(json_encode($result + $comments));
<?php include '../Class/mapLoad.php'; $mapLoad = new mapLoad(); $maps = $mapLoad->getMapAllCapture(); for ($i = 0; $i < count($maps); $i++) { $mapArray['mapInfo' . $i] = $maps[$i]; } echo urldecode(json_encode($mapArray));
<?php include '../Class/mapLoad.php'; include '../Class/Hash_tag.php'; include '../Class/Img_ctl.php'; session_start(); if ($_SESSION['is_login'] === true) { $mapReg = new mapLoad(); $reg_result = $mapReg->upload_img(array('map_id' => $_POST['map_id'], 'loc_x' => $_POST['loc_x'], 'loc_y' => $_POST['loc_y'], 'place_id' => $_POST['place_id'], 'description' => $_POST['description'])); /* // 사진에는 해쉬태그 불필요? // tag_name과 맵을 넣은 결과값이 true일 경우만 if (!empty($_POST['tag_name']) && $reg_result['db_result']) { // POST 로 온 map_id 에 해당하는 태그들 DB에 넣음 // 해시태그 갯수만큼 불러와야함 (추후에 배열로 받는걸로 바꿔야함) $hash_tag = new Hash_tag; $tag = explode(" ", trim($_POST['tag_name'])); foreach ($tag as $tag_name) { $hash_result = $hash_tag->set_tag($tag_name, $reg_result['map_id']); if (!$hash_result) break; } } else { $hash_result = false; } */ $Img_ctl = new Img_ctl(); // 저장 경로 $file_path = '../Static/image/'; // 저장 결과 $upload_result = $Img_ctl->image_upload($file_path, $reg_result['img_id']);
<?php include '../Class/mapLoad.php'; include '../Class/Auth.php'; include '../Class/Hash_tag.php'; 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 {
<?php include '../Class/mapLoad.php'; include '../Class/Hash_tag.php'; session_start(); if ($_SESSION['is_login'] === true) { $mapReg = new mapLoad(); $reg_result = $mapReg->upload_map(array('user_id' => $_SESSION['user_id'], 'map_name' => $_POST['map_name'], 'map_locate' => $_POST['map_locate'], 'map_type' => $_POST['map_type'])); // tag_name과 맵을 넣은 결과값이 true일 경우만 if (!empty($_POST['tag_name']) && $reg_result['db_result']) { // POST 로 온 map_id 에 해당하는 태그들 DB에 넣음 // 해시태그 갯수만큼 불러와야함 (추후에 배열로 받는걸로 바꿔야함) $hash_tag = new Hash_tag(); $tag = explode(" ", trim($_POST['tag_name'])); foreach ($tag as $tag_name) { $hash_result = $hash_tag->set_tag($tag_name, $reg_result['map_id']); if (!$hash_result) { break; } } } else { $hash_result = true; } if ($reg_result['db_result'] && $hash_result) { $result = array('result' => 'true', 'map_id' => (string) $reg_result['map_id']); } else { $result = array('result' => 'false'); } } else { $result = array('result' => 'false', 'msg' => '로그인이 필요합니다'); }
<?php include '../Class/mapLoad.php'; $mapLoad = new mapLoad(); $img_info = $mapLoad->get_image($_POST['img_id']); echo urldecode(json_encode($img_info));