Check Berita JSON Response"; $berita_result = api_get_berita($token); echo "

Full API Response:

"; echo "
";
print_r($berita_result);
echo "
"; if ($berita_result['success']) { $data = $berita_result['data']; echo "

Data Structure:

"; echo "
";
    print_r($data);
    echo "
"; $items = $data['data'] ?? $data; if (is_array($items) && count($items) > 0) { echo "

First Item Keys:

"; $first_item = $items[0]; echo ""; echo "

First Item Values:

"; echo "
";
        print_r($first_item);
        echo "
"; // Check specifically for photo-related fields echo "

Photo Field Check:

"; $photo_fields = ['photo', 'foto', 'image', 'gambar', 'img', 'thumbnail', 'preview', 'cover']; foreach ($photo_fields as $field) { if (isset($first_item[$field])) { $value = $first_item[$field]; echo "

$field: " . htmlspecialchars($value) . " (" . gettype($value) . ")

"; if (is_string($value) && !empty($value) && ($u = uploads_berita_url($value)) !== '') { echo "

Test URL: " . htmlspecialchars($u) . "

"; } } else { echo "

$field: NOT FOUND

"; } } } } else { echo "

API Error: " . ($berita_result['data']['pesan'] ?? 'Unknown error') . "

"; }