core/api/modules/page/ajax.php

14 lines
606 B
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
/* ----------------------------------------------------------------------
11.02.2023
Добавляем коммент
---------------------------------------------------------------------- */
switch( @$_POST['act'] ) {
2022-12-11 13:55:49 +05:00
case 'add_comment':
$_POST['t'] = time();
if ( !$_SESSION['user_id']) die ( 'не авторизован' );
\DB::add( "INSERT INTO `pages_comments` (`user_id`, `page_id`, `txt`, `t`, `status`) VALUES(?, ?, ?, ?, 0)", array( $_SESSION['user_id'], $_POST['page_id'], nl2br( $_POST['txt']), time() ) );
2022-12-11 13:55:49 +05:00
break;
default:
2022-12-11 13:55:49 +05:00
}
?>