"Organization", "@id" => $currentUrl . "#organization", "name" => $seo['title'] ?? $pageContent['title'], "url" => $currentDomain, "logo" => !empty($settingsContent['header-logo']) ? $currentDomain . '/' . json_decode($settingsContent['header-logo'], true)['src'] : '', "sameAs" => !empty($settingsContent['official-sites']) ? json_decode($settingsContent['official-sites'], true) : [] ]; // 2. Casino Brand $casinoBrand = [ "@type" => ["Casino", "Brand"], "@id" => $currentUrl . "#brand-casino-entity", "name" => $seo['title'], "url" => $seo['canonical'] ?? $currentUrl, "image" => !empty($settingsContent['header-logo']) ? $currentDomain . '/' . json_decode($settingsContent['header-logo'], true)['src'] : '', "aggregateRating" => [ "@type" => "AggregateRating", "ratingValue" => "5", "ratingCount" => $settingsContent['rating-count'] ?? "150", "worstRating" => "1", "bestRating" => "5" ], "priceRange" => "$", "openingHoursSpecification" => [ [ "@type" => "OpeningHoursSpecification", "dayOfWeek" => ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], "opens" => "00:00", "closes" => "23:59" ] ], "parentOrganization" => [ "@id" => $currentUrl . "#organization" ] ]; // Add address if any field is filled if (!empty($settingsContent['address-street']) || !empty($settingsContent['address-city']) || !empty($settingsContent['address-region']) || !empty($settingsContent['address-postal']) || !empty($settingsContent['address-country'])) { $casinoBrand["address"] = [ "@type" => "PostalAddress", "streetAddress" => $settingsContent['address-street'] ?? '', "addressLocality" => $settingsContent['address-city'] ?? '', "addressRegion" => $settingsContent['address-region'] ?? '', "postalCode" => $settingsContent['address-postal'] ?? '', "addressCountry" => $settingsContent['address-country'] ?? '' ]; } $schemaGraph[] = $casinoBrand; // 3. WebSite $schemaGraph[] = [ "@type" => "WebSite", "url" => $currentDomain, "name" => $settingsContent['title-h1'], "publisher" => [ "@id" => $currentUrl . "#organization" ] ]; // 4. WebPage $schemaGraph[] = [ "@type" => "WebPage", "@id" => $currentUrl . "#webpage", "name" => $seo['title'], "description" => $seo['description'], "inLanguage" => $seo['extra_fields']['locale'] ?? 'en', "url" => $currentUrl, "dateModified" => $settingsContent['modified-date'] ?? date('Y-m-d'), "author" => [ "@type" => "Person", "name" => $settingsContent['author-name'] ?? '', "image" => !empty($settingsContent['author-img']) ? $currentDomain . '/' . $settingsContent['author-img'] : '', "jobTitle" => "Casino Expert" ], "publisher" => [ "@id" => $currentUrl . "#organization" ] ]; // 5. Review $schemaGraph[] = [ "@type" => "Review", "itemReviewed" => [ "@id" => $currentUrl . "#brand-casino-entity" ], "reviewRating" => [ "@type" => "Rating", "ratingValue" => "5", "bestRating" => "5" ], "author" => [ "@id" => $currentUrl . "#organization" ], "name" => $seo['title'], "reviewBody" => $seo['description'], "datePublished" => $settingsContent['published-date'] ?? date('Y-m-d') ]; // 6. Offer (if bonus fields are filled) if (!empty($settingsContent['bonus-name']) || !empty($settingsContent['bonus-description'])) { $schemaGraph[] = [ "@type" => "Offer", "@id" => $currentUrl . "#offer", "name" => $settingsContent['bonus-name'] ?? '', "description" => $settingsContent['bonus-description'] ?? '', "url" => $settingsContent['bonus-url'] ?? $currentUrl, "price" => $settingsContent['bonus-price'] ?? '', "priceCurrency" => $settingsContent['bonus-currency'] ?? 'EUR', "availability" => "https://schema.org/InStock", "eligibleCustomerType" => "https://schema.org/NewCustomer", "offeredBy" => [ "@id" => $currentUrl . "#organization" ] ]; } // 7. BreadcrumbList $schemaGraph[] = [ "@type" => "BreadcrumbList", "itemListElement" => [ [ "@type" => "ListItem", "position" => 1, "name" => $settingsContent['title-h1'], "item" => $currentUrl ] ] ]; // 8. FAQPage if (!empty($faqItems)) { $schemaGraph[] = [ "@type" => "FAQPage", "mainEntityOfPage" => [ "@id" => $currentUrl . "#webpage" ], "mainEntity" => array_map(function ($item) { return [ "@type" => "Question", "name" => htmlspecialchars($item['question']), "acceptedAnswer" => [ "@type" => "Answer", "text" => htmlspecialchars($item['answer']) ] ]; }, $faqItems) ]; } // 9. SoftwareApplication (if app fields are filled) if (!empty($settingsContent['app-download-url']) || !empty($settingsContent['app-install-url'])) { $schemaGraph[] = [ "@type" => "SoftwareApplication", "@id" => $currentUrl . "#app", "name" => $settingsContent['title-h1'] . " App", "operatingSystem" => "Android, iOS", "applicationCategory" => "GameApplication", "provider" => [ "@id" => $currentUrl . "#organization" ], "offers" => [ "@type" => "Offer", "price" => "0", "priceCurrency" => "EUR", "availability" => "https://schema.org/InStock" ], "downloadUrl" => $settingsContent['app-download-url'] ?? '', "installUrl" => $settingsContent['app-install-url'] ?? '', "aggregateRating" => [ "@type" => "AggregateRating", "ratingValue" => "5", "ratingCount" => $settingsContent['app-rating-count'] ?? "99", "worstRating" => "1", "bestRating" => "5" ], "author" => [ "@id" => $currentUrl . "#organization" ] ]; } // Generate final JSON-LD $schemaMarkup = [ "@context" => "https://schema.org", "@graph" => array_filter($schemaGraph) // Remove null entries ]; echo json_encode($schemaMarkup, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); ?>