Пример #1
0
     if ($acc_data == 'reload') {
         echo "Reload page";
     } else {
         echo $api->getLNGroupFeedFromServer($acc_data->userId, $acc_data->accountId, $acc_data->user_at, $acc_data->user_ts, $acc_data->sampleId);
     }
     break;
 case 'sendLNComment':
     //$acc_data = $api->getAccountData ( $_POST ['i'], $_POST ['j'] );
     if (!$api->ifUserLogined()) {
         echo "Reload page";
     } else {
         if (isset($_POST["post_id"]) && isset($_POST['accountID']) && isset($_POST["profileID"])) {
             if (Server_Side) {
                 if (isset($_POST['group'])) {
                     $message = "<?xml version='1.0' encoding='UTF-8'?><comment><text>" . $_POST['comment'] . "</text></comment>";
                     $re = $api->publishSocialStreamObject("sendLNCommentGroup", $_POST['post_id'], $message, "comment");
                 } else {
                     $message = "<?xml version='1.0' encoding='UTF-8'?><update-comment><comment>" . $_POST['comment'] . "</comment></update-comment>";
                     $re = $api->publishSocialStreamObject("sendLNComment", $_POST['post_id'], $message, "comment");
                 }
                 $resp = json_decode($re);
                 if (isset($resp->error)) {
                     echo $resp->error->streamEntry->message;
                 } elseif ($resp->returnCode == "SUCCESS") {
                     echo "SUCCESS";
                 } else {
                     echo "UNKNOWN_ERROR";
                 }
             } else {
                 $oauth = new OAuth(LINKEDIN_APP_KEY, LINKEDIN_SECRET_KEY);
                 $oauth->setToken($acc_data->user_at, $acc_data->user_ts);