section_adv.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <style>
  2. .adv_box
  3. {
  4. /*
  5. display: grid;
  6. align-content: space-between;
  7. */
  8. /*
  9. display: flex;
  10. justify-content: space-between;
  11. */
  12. /*flex-direction: column;*/
  13. }
  14. </style>
  15. @foreach($keys as $key)
  16. @if(isset($advs[$key]) && sizeof($advs[$key]) > 0)
  17. <div class="widget adv_box" style="margin-top:35px;">
  18. <div id="car{{time()}}" class="advertisement carousel slide" data-ride="carousel" style="padding:0px">
  19. <div class="desktop-advert carousel-inner">
  20. @foreach($advs[$key] as $idx => $adv)
  21. <?php
  22. $d = '';
  23. $sizes = explode(" ", $key);
  24. if (sizeof($sizes) > 0)
  25. $d = $sizes[0];
  26. else
  27. $d = $key;
  28. list($w, $h) = explode("x", $d);
  29. ?>
  30. <div class="item {{$idx == 0 ? 'active' : ''}}">
  31. @if($adv->google_code != '')
  32. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0209495346002620" crossorigin="anonymous"></script>
  33. <ins class="adsbygoogle"
  34. style="display:inline-block;width:728px;height:90px"
  35. data-ad-client="ca-pub-0209495346002620"
  36. data-ad-slot="{{$adv->google_code}}"></ins>
  37. <script>
  38. (adsbygoogle = window.adsbygoogle || []).push({});
  39. </script>
  40. CIAO
  41. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  42. <ins class="adsbygoogle"
  43. style="display:block;width:{{$w}}px;height:{{$h}}px"
  44. data-ad-client="ca-pub-0209495346002620"
  45. data-ad-slot="{{$adv->google_code}}"></ins>
  46. <script>
  47. (adsbygoogle = window.adsbygoogle || []).push({});
  48. </script>
  49. @else
  50. <a href="{{$adv->url != '' ? $adv->url : '#'}}"><img src="/files/adv/{{$adv->image}}" alt="" style="border:1px solid gray;margin:auto; "></a>
  51. @endif
  52. </div>
  53. @endforeach
  54. </div>
  55. <div class="tablet-advert carousel-inner">
  56. @foreach($advs[$key] as $idx => $adv)
  57. <div class="item {{$idx == 0 ? 'active' : ''}}">
  58. @if($adv->google_code != '')
  59. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  60. <ins class="adsbygoogle"
  61. style="display:inline-block;width:{{$w}}px;height:{{$h}}px"
  62. data-ad-client="ca-pub-0209495346002620"
  63. data-ad-slot="{{$adv->google_code}}"></ins>
  64. <script>
  65. (adsbygoogle = window.adsbygoogle || []).push({});
  66. </script>
  67. @else
  68. <a href="{{$adv->url != '' ? $adv->url : '#'}}"><img src="/files/adv/{{$adv->image}}" alt="" style="border:1px solid gray;margin:auto;"></a>
  69. @endif
  70. </div>
  71. @endforeach
  72. </div>
  73. <div class="mobile-advert carousel-inner">
  74. @foreach($advs[$key] as $idx => $adv)
  75. <div class="item {{$idx == 0 ? 'active' : ''}}">
  76. @if($adv->google_code != '')
  77. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  78. <ins class="adsbygoogle"
  79. style="display:inline-block;width:{{$w}}px;height:{{$h}}px"
  80. data-ad-client="ca-pub-0209495346002620"
  81. data-ad-slot="{{$adv->google_code}}"></ins>
  82. <script>
  83. (adsbygoogle = window.adsbygoogle || []).push({});
  84. </script>
  85. @else
  86. <a href="{{$adv->url != '' ? $adv->url : '#'}}"><img src="/files/adv/{{$adv->image}}" alt="" style="border:1px solid gray;margin:auto;"></a>
  87. @endif
  88. </div>
  89. @endforeach
  90. </div>
  91. </div>
  92. </div>
  93. @else
  94. <?php
  95. $d = '';
  96. $sizes = explode(" ", $key);
  97. if (sizeof($sizes) > 0)
  98. $d = $sizes[0];
  99. else
  100. $d = $key;
  101. list($w, $h) = explode("x", $d);
  102. ?>
  103. <div class="widget" style="width:{{$w}}px;height:{{$h}}px;border:1px solid gray;margin-top:35px;">
  104. </div>
  105. @endif
  106. @endforeach