diff --git a/Get.php b/Get.php index 6762de9..abffb41 100644 --- a/Get.php +++ b/Get.php @@ -170,6 +170,20 @@ function userSearch() } } + function checkCName($cname) + { + if($result = Gets::checkToken()) + { + $cname_lenght = strlen($cname); + if($cname_lenght < 16){ + $query = mysqli_query($this->connect(), "some query"); + }else{ + /**code */ + } + + } + } + function getContacts() { } diff --git a/Post.php b/Post.php index e56be2c..b056fd5 100644 --- a/Post.php +++ b/Post.php @@ -1,4 +1,5 @@ connect(),"INSERT INTO `files`(`name`, `path`, `owner_id`, `hash_sum`, `time_upload`) - VALUES ('$file','$path','$uid','$sha', '$date')"); - mysqli_query($this->connect(), "UPDATE `users` SET `photo` = '$path' WHERE `id` = '$uid'"); - $array["name"]=$file; - $array["path"]=$path; - Jsons::jsonOutput(true, $array); + $path = 'http://'.$_SERVER['SERVER_NAME'].'/'.$uploaddir.$file; + $date = date("Y-m-d H:i:s"); + mysqli_query($this->connect(),"INSERT INTO `files`(`name`, `path`, `owner_id`, `hash_sum`, `time_upload`) + VALUES ('$file','$path','$uid','$sha', '$date')"); + mysqli_query($this->connect(), "UPDATE `users` SET `photo` = '$path' WHERE `id` = '$uid'"); + $array["name"]=$file; + $array["path"]=$path; + Jsons::jsonOutput(true, $array); } else { Jsons::jsonOutput(false,'photo', 'some error push form-data to redgroul'); } - }else{ Jsons::jsonOutput(false,""); } @@ -270,7 +270,7 @@ function setOnline() function uploadFile() { if($result = Gets::checkToken()){ - $uid = $result['uid']; + /* $uid = $result['uid']; $type_file = explode('.',$_FILES['userfile']['name']); if(end($type_file) == 'jpg' or end($type_file) == 'jpeg' or end($type_file) == 'png'); { @@ -305,13 +305,13 @@ function uploadFile() } else { Jsons::jsonOutput(false,""); } - } + }*/ } } function report() { - /* $message_id = $_POST['message_id']; + $message_id = $_POST['message_id']; if(!empty($report_id = $_POST['report_user_id']) and !empty($_POST['type_report']) and !empty($_POST['message_id'])){ if($result = Gets::checkToken()){ $reporter = $result['id']; @@ -334,7 +334,7 @@ function report() empty($_POST['type_report']) ? $err['type_report'] = "empty" : $_POST['type_report']; empty($_POST['message_id']) ? $err['message_id'] = "empty" : $_POST['message_id']; Jsons::jsonOutput(false, $err); - }*/ + } } @@ -405,4 +405,15 @@ function createDialog() } } + + function createChannel() + { + if($result = Gets::checkToken()) + { + $channel_name = $_POST['cname']; + + } + } + + } diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..973b1dc --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ +В этой ветке реализуются новые функции