20 lines
433 B
Plaintext
20 lines
433 B
Plaintext
|
<?php
|
||
|
switch(@$_POST['act']) {
|
||
|
case 'add_comment':
|
||
|
if (!$_SESSION['user_id'])die();
|
||
|
$_POST['abtime']=time();
|
||
|
$_POST['user_id']=$_SESSION['user_id'];
|
||
|
$_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;
|
||
|
print_r($b['likes']);
|
||
|
$db->update('pages', $a['id'], $b);
|
||
|
break;
|
||
|
default:
|
||
|
}
|
||
|
?>
|