section_adv.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  41. <ins class="adsbygoogle"
  42. style="display:block;width:{{$w}}px;height:{{$h}}px"
  43. data-ad-client="ca-pub-0209495346002620"
  44. data-ad-slot="{{$adv->google_code}}"></ins>
  45. <script>
  46. (adsbygoogle = window.adsbygoogle || []).push({});
  47. </script>
  48. @else
  49. <a href="{{$adv->url != '' ? $adv->url : '#'}}"><img src="/files/adv/{{$adv->image}}" alt="" style="border:1px solid gray;margin:auto; "></a>
  50. @endif
  51. </div>
  52. @endforeach
  53. </div>
  54. <div class="tablet-advert carousel-inner">
  55. @foreach($advs[$key] as $idx => $adv)
  56. <div class="item {{$idx == 0 ? 'active' : ''}}">
  57. @if($adv->google_code != '')
  58. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  59. <ins class="adsbygoogle"
  60. style="display:inline-block;width:{{$w}}px;height:{{$h}}px"
  61. data-ad-client="ca-pub-0209495346002620"
  62. data-ad-slot="{{$adv->google_code}}"></ins>
  63. <script>
  64. (adsbygoogle = window.adsbygoogle || []).push({});
  65. </script>
  66. @else
  67. <a href="{{$adv->url != '' ? $adv->url : '#'}}"><img src="/files/adv/{{$adv->image}}" alt="" style="border:1px solid gray;margin:auto;"></a>
  68. @endif
  69. </div>
  70. @endforeach
  71. </div>
  72. <div class="mobile-advert carousel-inner">
  73. @foreach($advs[$key] as $idx => $adv)
  74. <div class="item {{$idx == 0 ? 'active' : ''}}">
  75. @if($adv->google_code != '')
  76. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  77. <ins class="adsbygoogle"
  78. style="display:inline-block;width:{{$w}}px;height:{{$h}}px"
  79. data-ad-client="ca-pub-0209495346002620"
  80. data-ad-slot="{{$adv->google_code}}"></ins>
  81. <script>
  82. (adsbygoogle = window.adsbygoogle || []).push({});
  83. </script>
  84. @else
  85. <a href="{{$adv->url != '' ? $adv->url : '#'}}"><img src="/files/adv/{{$adv->image}}" alt="" style="border:1px solid gray;margin:auto;"></a>
  86. @endif
  87. </div>
  88. @endforeach
  89. </div>
  90. </div>
  91. </div>
  92. @else
  93. <?php
  94. $d = '';
  95. $sizes = explode(" ", $key);
  96. if (sizeof($sizes) > 0)
  97. $d = $sizes[0];
  98. else
  99. $d = $key;
  100. list($w, $h) = explode("x", $d);
  101. ?>
  102. <div class="widget" style="width:{{$w}}px;height:{{$h}}px;border:1px solid gray;margin-top:35px;">
  103. </div>
  104. @endif
  105. @endforeach