Продолжение разработки 23.10.31

Добавлен .gitignore, скрыты несколько нинужных файлов, в целом продолжен запил основных частей функционала, начат микрорефакторинг (теперь концентрация индусского кода будет чуть меньше).
This commit is contained in:
2023-10-31 21:57:17 +03:00
parent e487ed79c4
commit 12143c148d
15 changed files with 608 additions and 166 deletions

47
api/comments/index.php Normal file
View File

@@ -0,0 +1,47 @@
<?php // Get all comments from comment section by ID and base methods for managing comment sections
require_once("../_auth.php");
require_once("../_utils.php");
// Get comments from range of selected comment section
function ComSec_Get ($sec_id, $ts_from, $ts_to) {
global $db;
$result = array();
$s = $db->prepare("SELECT * FROM posts WHERE id = ?");
$s->bind_param("s", $id);
$s->execute();
$d = $s->get_result()->fetch_assoc();
if (!(bool)$d) {
return null;
}
if (ThisFileIsRequested(__FILE__)) {
require_once("../_json.php");
$SectionID = null;
if (isset($_REQUEST["id"])) {
if (!ctype_digit($_REQUEST["id"]))
ReturnJSONError($Err_RDP_InvalidID, "id must be numeric");
$SectionID = intval($_REQUEST["id"]);
} else {
ReturnJSONError($Err_RDP_InvalidID, "id must be specified");
}
/*
$ResponseData = ComSec_GetComms($SectionID);
if ($ResponseData)
ReturnJSONData($ResponseData);
else
ReturnJSONError($Err_DP_IDNotFound, "wrong id");
*/
}
?>