2022-12-11 13:55:49 +05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
//print_r($_FILES);
|
|
|
|
//print_r($_POST);
|
|
|
|
//echo 1;
|
|
|
|
switch(@$_POST['act']) {
|
|
|
|
case 'add_comment':
|
|
|
|
$_POST['t']=time();
|
2023-02-13 16:05:33 +05:00
|
|
|
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;
|
|
|
|
|
|
|
|
case 'like':
|
|
|
|
unset($a);
|
|
|
|
unset($b);
|
|
|
|
$a['id']=$_POST['id'];
|
|
|
|
$b['likes']=$db->get_val('pages', $a, 'likes')+1;
|
|
|
|
setcookie ("page_like", $a['id'], time()+31536000, '/', $_SERVER['SERVER_NAME']);
|
|
|
|
$db->update('pages', $a['id'], $b);
|
|
|
|
break;
|
|
|
|
case 'edit_title'://интерактивное измениение заголовка
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-13 16:05:33 +05:00
|
|
|
break;
|
2022-12-11 13:55:49 +05:00
|
|
|
|
|
|
|
case 'r_comment'://рейтинг коментариев
|
|
|
|
require_once MYDIR . '/api/modules/page/ajax.' . $_POST['act'] . '.php';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|