Example #1
0
 /**
  * Get the unread plurks.
  *
  * @param bool $fetch_responses If true, populate the responses_fetch value 
  *                              with the array of responses.
  *
  * @return array The array (numerical) of unread plurks (an associative 
  *               subarray).
  */
 function plurk_get_unread($fetch_responses = false)
 {
     if ($this->bool_login == false) {
         return array();
     }
     $this->plurk_get($this->plurk_paths['plurk_get_unread']);
     $data = $this->plurk_response();
     $data = $data['body'];
     $array_plurks = al_plurk_api::dejsonize($data);
     foreach ($array_plurks as &$plurk) {
         $plurk['nick_name'] = $this->uid_to_nickname((int) $plurk['owner_id']);
         $plurk['responses_fetched'] = null;
         if ($fetch_responses == true) {
             $plurk['responses_fetched'] = $this->plurk_response_get($plurk['plurk_id']);
         }
         $plurk['permalink'] = al_plurk_api::plurk_get_permlink($plurk['plurk_id']);
     }
     return $array_plurks;
 }