Пример #1
0
<?php

//Like or unlike comment
require_once '../includes/functions.inc.php';
require_once '../includes/admin.inc.php';
if (isset($_POST['comid']) && isset($_SESSION['uid'])) {
    $comid = $_POST['comid'];
    $uid = $_SESSION['uid'];
    comment_like($comid, $uid);
}
Пример #2
0
     // post
 // post
 case "comment":
     require_once "lib/api/comments.php";
     require_once "lib/api/likes.php";
     switch ($url_parts[3]) {
         case "add":
             $result = comment_add();
             header("Location: " . $_SERVER["HTTP_REFERER"] . "#comments");
             break;
         case "delete":
             $result = comment_delete($url_parts[4]);
             header("Location: " . $_SERVER["HTTP_REFERER"] . "#comments");
             break;
         case "like":
             $result = comment_like($url_parts[4], $url_parts[5]);
             header('Content-Type: application/json');
             print json_encode($result);
             break;
         case "unlike":
             $result = comment_unlike($url_parts[4], $url_parts[5]);
             header('Content-Type: application/json');
             print json_encode($result);
             break;
     }
     break;
     // comment
 // comment
 case "friends":
     require_once "lib/api/friends.php";
     switch ($url_parts[3]) {