Продолжение разработки 23.10.31
Добавлен .gitignore, скрыты несколько нинужных файлов, в целом продолжен запил основных частей функционала, начат микрорефакторинг (теперь концентрация индусского кода будет чуть меньше).
This commit is contained in:
47
api/comments/index.php
Normal file
47
api/comments/index.php
Normal 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");
|
||||
*/
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user