Ejemplo n.º 1
0
function unlike($wall, $user)
{
    try {
        $result = WaWall::RemoveUserFromWall($user, $wall);
    } catch (Exception $e) {
        returnError($e->getMessage());
        return;
    }
    if (!$result) {
        returnError();
    }
    $info = WaWall::GetWallInfo($wall);
    if (!$info) {
        returnError();
    }
    $info['wall_usercount']--;
    $result = WaWall::SetWallInfo($wall, $info);
    if (!$result) {
        returnError();
    }
    $ret = array('wall_usercount' => $info['wall_usercount']);
    echo json_encode($ret);
}