shr3dd3r
12143c148d
Добавлен .gitignore, скрыты несколько нинужных файлов, в целом продолжен запил основных частей функционала, начат микрорефакторинг (теперь концентрация индусского кода будет чуть меньше).
47 lines
988 B
PHP
47 lines
988 B
PHP
<?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");
|
|
*/
|
|
}
|
|
|
|
?>
|