first commit
This commit is contained in:
25
api/modules/find/ajax.php
Executable file
25
api/modules/find/ajax.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
switch(@$_POST['act']) {
|
||||
|
||||
case 'add_comment':
|
||||
print_r($_POST);
|
||||
if (!$_SESSION['user_id'] || !$_POST['txt'])die();
|
||||
$_POST['t']=time();
|
||||
$_POST['user_id']=$_SESSION['user_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);
|
||||
echo 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user