Debug Berita Photo Structure"; // Get berita data $berita_result = api_get_berita($token); if ($berita_result['success']) { $berita_data = $berita_result['data']; $berita_items = $berita_data['data'] ?? $berita_data; echo "

Raw API Response:

"; echo "
";
    print_r($berita_result);
    echo "
"; if (is_array($berita_items)) { echo "

Photo Fields Analysis:

"; foreach ($berita_items as $index => $item) { echo "

Item $index:

"; echo "
";
            print_r($item);
            echo "
"; // Check all possible photo fields $photo_fields = ['photo', 'foto', 'image', 'gambar', 'img', 'thumbnail', 'preview']; echo "
Photo Fields Check:
"; foreach ($photo_fields as $field) { $value = $item[$field] ?? 'NOT_FOUND'; echo "

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

"; } // Check if there are any fields that might contain image data echo "
All Fields:
"; foreach ($item as $key => $value) { if (is_string($value) && (strpos($value, '.jpg') !== false || strpos($value, '.jpeg') !== false || strpos($value, '.png') !== false || strpos($value, '.gif') !== false)) { echo "

$key: " . htmlspecialchars($value) . " (POSSIBLE IMAGE)

"; } else { echo "

$key: " . htmlspecialchars(is_string($value) ? $value : gettype($value)) . "

"; } } echo "
"; } } } else { echo "

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

"; } echo "

← Kembali ke Dashboard

";