Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
}
Expand Down
37 changes: 24 additions & 13 deletions Post.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

class Post extends DBconnect
{
function getContent($url_data)
Expand Down Expand Up @@ -149,18 +150,17 @@ function changePhoto()
$file = uniqid('',true).'.'.explode('.', $uploadfile)[1];
$sha = hash_file("sha256", $_FILES['userfile']['tmp_name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.$file)) {
$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);
$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,"");
}
Expand Down Expand Up @@ -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');
{
Expand Down Expand Up @@ -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'];
Expand All @@ -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);
}*/
}

}

Expand Down Expand Up @@ -405,4 +405,15 @@ function createDialog()
}

}

function createChannel()
{
if($result = Gets::checkToken())
{
$channel_name = $_POST['cname'];

}
}


}
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
В этой ветке реализуются новые функции