From b09f953f9e0eb4bf0bf84a9ad96fb72b3e75fc97 Mon Sep 17 00:00:00 2001 From: Aria <aria@suma-ev.de> Date: Tue, 12 Sep 2017 11:19:00 +0200 Subject: [PATCH] Werbung hinzugefuegt --- resources/views/layouts/atom10-ad.blade.php | 8 +++++++ .../views/metager3resultsatom10.blade.php | 21 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 resources/views/layouts/atom10-ad.blade.php diff --git a/resources/views/layouts/atom10-ad.blade.php b/resources/views/layouts/atom10-ad.blade.php new file mode 100644 index 000000000..3ccbaf824 --- /dev/null +++ b/resources/views/layouts/atom10-ad.blade.php @@ -0,0 +1,8 @@ +@if(isset($ad) && !$apiAuthorized) + <ad:advertisement> + <ad:callOut atom:type="TEXT">{!! trans('ad.von') !!} {!! $ad->gefVon !!}</ad:callOut> + <ad:title atom:type="TEXT">{{ $ad->titel }}</ad:title> + <ad:displayUrl atom:type="TEXT">{{ $ad->anzeigeLink }}</ad:displayUrl> + <atom:link href="{{ $ad->link }}" /> + </ad:advertisement> +@endif \ No newline at end of file diff --git a/resources/views/metager3resultsatom10.blade.php b/resources/views/metager3resultsatom10.blade.php index 55468b929..42ad1cd8c 100644 --- a/resources/views/metager3resultsatom10.blade.php +++ b/resources/views/metager3resultsatom10.blade.php @@ -1,15 +1,31 @@ <?xmlversion = "1.0"encoding = "UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" - xmlns:mg="http://metager.de/opensearch/"> + xmlns:mg="http://metager.de/opensearch/" + xmlns:advertisement="http://a9.com/-/opensearch/extensions/advertisement/1.0/"> <title>{!! htmlspecialchars($eingabe, ENT_XML1, 'UTF-8'); !!} - MetaGer</title> <link href="{{ url()->full() }}"/> <updated>{{ date('c') }}</updated> <opensearch:totalResults>{{ $resultcount }}</opensearch:totalResults> <opensearch:Query role="request" searchTerms="{{ htmlspecialchars($eingabe, ENT_QUOTES) }}"/> - <link rel="next" href="{{htmlspecialchars($metager->nextSearchLink() ,ENT_QUOTES)}}" type="application/atom+xml"/> + <link rel="next" href="{{ htmlspecialchars($metager->nextSearchLink() ,ENT_QUOTES) }}" type="application/atom+xml"/> <id>urn:uuid:1d634a8c-2764-424f-b082-6c96494b7240</id> + @include('layouts.atom10-ad', ['ad' => $metager->popAd()]) @foreach($metager->getResults() as $result) + @if($result->number % 7 === 0) + <ad:advertisement> + <ad:callOut atom:type="TEXT">[Ad]</ad:callOut> + <ad:title atom:type="TEXT">20% Off Coffee</ad:title> + <ad:subTitle atom:type="TEXT">Walk in and show us this ad on your phone</ad:subTitle> + <ad:displayUrl atom:type="TEXT">example.com/coffee</ad:displayUrl> + <ad:image ad:id="cprp20" ad:width="170" ad:height="30"> + <ad:link href="http://example.com/ads/20_off_coffee.jpg" /> + <ad:altText atom:type="TEXT">Click for Cafes Near You</ad:altText> + </ad:image> + <atom:link href="http://example.com/coffee/" /> + <ad:id>1234567890</ad:id> + </ad:advertisement> + @endif <entry> <title>{!! htmlspecialchars($result->titel, ENT_XML1, 'UTF-8'); !!}</title> <link href="{!! htmlspecialchars($result->link, ENT_XML1, 'UTF-8'); !!}" /> @@ -19,6 +35,7 @@ </content> </entry> @endforeach + </feed> <!-- Muster zu finden unter http://www.opensearch.org/Specifications/OpenSearch/1.1#Example_of_OpenSearch_response_elements_in_RSS_2.0 --> -- GitLab