Ejemplo n.º 1
0
         // an error occured
         echo "Error re-sharing content:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
     }
     break;
 case 'unlike':
     /**
      * Handle 'unlikes'.
      */
     // check the session
     if (!oauth_session_exists()) {
         throw new LinkedInException('This script requires session support, which doesn\'t appear to be working correctly.');
     }
     $OBJ_linkedin = new LinkedIn($API_CONFIG);
     $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
     if (!empty($_GET['nKey'])) {
         $response = $OBJ_linkedin->unlike($_GET['nKey']);
         if ($response['success'] === TRUE) {
             // update 'unliked'
             header('Location: ' . $_SERVER['PHP_SELF']);
         } else {
             // problem with 'unlike'
             echo "Error 'unliking' update:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
         }
     } else {
         echo "You must supply a network update key to 'unlike' an update.";
     }
     break;
 default:
     // nothing being passed back, display demo page
     // check PHP version
     if (version_compare(PHP_VERSION, '5.0.0', '<')) {