main.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. $settingsContent = settings('content')->getAll();
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="<?= $seo['extra_fields']['locale'] ?? 'en' ?>">
  6. <head>
  7. <meta charset="UTF-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <base href="/">
  10. <title><?= $seo['title'] ?></title>
  11. <link rel="stylesheet" href="css/styles.css">
  12. <meta name='robots' content='index, follow' />
  13. <?php if (!empty($settingsContent['favicon'])): ?>
  14. <link rel="icon" href="<?= htmlspecialchars($settingsContent['favicon']) ?>" type="image/x-icon">
  15. <?php endif; ?>
  16. <meta property="og:title" content="<?= $seo['title'] ?? '' ?>">
  17. <meta property="og:description" content="<?= $seo['description'] ?? '' ?>">
  18. <meta property="og:locale" content="<?= $seo['extra_fields']['locale'] ?? '' ?>">
  19. <meta property="og:image" content="<?= htmlspecialchars($seo['image'] ?? '') ?>">
  20. <meta name="description" content="<?= $seo['description'] ?? '' ?>">
  21. <link rel="canonical" href="<?= $seo['canonical'] ?? '' ?>">
  22. <script type="application/ld+json">
  23. <?= json_encode([
  24. "@context" => "https://schema.org",
  25. "@graph" => [
  26. [
  27. "@type" => "WebPage",
  28. "name" => $settingsContent['title'],
  29. "description" => $settingsContent['description'],
  30. "inLanguage" => $settingsContent['lang'],
  31. "url" => $currentUrl,
  32. "dateModified" => $settingsContent['modified-date'] ?? '' , // ISO формат
  33. "author" => [
  34. "@type" => "Person",
  35. "name" => $settingsContent['author-name'] ?? '',
  36. "image" => $currentDomain . '/' . htmlspecialchars($settingsContent['author-img'] ?? '')
  37. ]
  38. ],
  39. [
  40. "@type" => "Organization",
  41. "name" => $domainName,
  42. "url" => $currentDomain,
  43. "logo" => $currentDomain . '/' . htmlspecialchars($settingsContent['uploaded_image'] ?? '')
  44. ],
  45. [
  46. "@type" => "BreadcrumbList",
  47. "itemListElement" => [
  48. [
  49. "@type" => "ListItem",
  50. "position" => 1,
  51. "name" => $settingsContent['title-h1'],
  52. "item" => $currentUrl
  53. ]
  54. ]
  55. ],
  56. !empty($casinoItems) ? [
  57. "@type" => "ItemList",
  58. "name" => htmlspecialchars($settingsContent['listing']),
  59. "itemListElement" => array_map(function ($item, $index) use ($currentDomain, $currentReviewCount) {
  60. $data = json_decode($item['value'], true);
  61. return [
  62. "@type" => "ListItem",
  63. "position" => $index + 1,
  64. "item" => [
  65. "@type" => "Offer",
  66. "name" => htmlspecialchars($data['heading']),
  67. "description" => htmlspecialchars($data['text']),
  68. "url" => $currentDomain . '/#' . getSlug($data['heading']),
  69. "offeredBy" => [
  70. "@type" => "Organization",
  71. "name" => htmlspecialchars($data['heading']),
  72. "logo" => $currentDomain . '/' . htmlspecialchars($data['image']),
  73. "aggregateRating" => [
  74. "@type" => "AggregateRating",
  75. "ratingValue" => "5",
  76. "reviewCount" => $currentReviewCount + ($index + 1),
  77. "bestRating" => "5",
  78. "worstRating" => "1"
  79. ]
  80. ]
  81. ]
  82. ];
  83. }, $casinoItems, array_keys($casinoItems))
  84. ] : null,
  85. [
  86. "@type" => "FAQPage",
  87. "mainEntity" => array_map(function ($item) {
  88. return [
  89. "@type" => "Question",
  90. "name" => htmlspecialchars($item['question']),
  91. "acceptedAnswer" => [
  92. "@type" => "Answer",
  93. "text" => htmlspecialchars($item['answer'])
  94. ]
  95. ];
  96. }, $faqItems)
  97. ]
  98. ]
  99. ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); ?>
  100. </script>
  101. <?php include __DIR__ . '/partials/styles.php'; ?>
  102. </head>
  103. <body class="main-color font-color main-font">
  104. <?php include __DIR__ . '/partials/header.php'; ?>
  105. <main class="main">
  106. <?= $pageContent ?>
  107. </main>
  108. <?php include __DIR__ . '/partials/footer.php'; ?>
  109. <script src="js/script.js"></script>
  110. <script src="https://cdnjs.cloudflare.com/ajax/libs/blazy/1.8.2/blazy.min.js"></script>
  111. </body>
  112. </html>