37 lines
909 B
PHP
Executable File
37 lines
909 B
PHP
Executable File
<?php
|
|
|
|
//print_r($_FILES);
|
|
//print_r($_POST);
|
|
//echo 1;
|
|
switch(@$_POST['act']) {
|
|
case 'add_comment':
|
|
$_POST['t']=time();
|
|
if ($_SESSION['user_id'])
|
|
$_POST['user_id']=$_SESSION['user_id'];
|
|
else
|
|
$_POST['user_id']=session_id();
|
|
unset($_POST['act']);
|
|
$db->add ( 'pages_comments', $_POST );
|
|
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'://интерактивное измениение заголовка
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 'r_comment'://рейтинг коментариев
|
|
require_once MYDIR . '/api/modules/page/ajax.' . $_POST['act'] . '.php';
|
|
break;
|
|
default:
|
|
|
|
}
|
|
?>
|