-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
229 lines (134 loc) · 6.46 KB
/
Copy pathindex.php
File metadata and controls
229 lines (134 loc) · 6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?php
session_start();
?>
<?php require "header.php"; ?>
<?php
if(!isset($_GET['k'])){
$key = $settings['default_term'];
}else{
$key = $_GET['k'];
}
$content_amazon = search_amazon_products($key,1);
if(empty($content_amazon)){
$content_amazon = search_rand_amazon_products($key);
}
$i = 0;
foreach(array_slice($content_amazon,0,$settings['num_results']) as $product){
/*
//FICHA PRODUCTO
if($i == 0){
echo'<div itemtype="https://schema.org/Product" itemscope>
<meta itemprop="mpn" content="'.$product['asin'].'" />
<meta itemprop="name" content="'.eliminar_acentos(trimstring($product['title'],50)).'" />
<link itemprop="image" href="'.cacheimg($product['image']).'" />
<link itemprop="image" href="'.cacheimg($product['image']).'" />
<link itemprop="image" href="'.cacheimg($product['image']).'" />
<meta itemprop="description" content="'.eliminar_acentos(trimstring($product['title'],100)).'" />
<div itemprop="aggregateRating" itemtype="https://schema.org/AggregateRating" itemscope>
<meta itemprop="reviewCount" content="'.rand(rand(3,6),rand(12,35)).'" />
<meta itemprop="ratingValue" content="4.'.rand(4,8).'" />
</div>
<div itemprop="review" itemtype="https://schema.org/Review" itemscope>
<div itemprop="author" itemtype="https://schema.org/Person" itemscope>
<meta itemprop="name" content="'.$settings['sitename'].'" />
</div>
<div itemprop="reviewRating" itemtype="https://schema.org/Rating" itemscope>
<meta itemprop="ratingValue" content="'.rand(4,5).'" />
<meta itemprop="bestRating" content="5" />
</div>
</div>
<div itemprop="offers" itemtype="https://schema.org/AggregateOffer" itemscope>
<link itemprop="url" href="'.$product['link'].'" />
<meta itemprop="availability" content="https://schema.org/InStock" />
<meta itemprop="priceCurrency" content="EUR" />
<meta itemprop="itemCondition" content="https://schema.org/NewCondition" />
<meta itemprop="lowPrice" content="1.00" />
<meta itemprop="offerCount" content="'.rand(rand(3,6),rand(12,35)).'" />
<meta itemprop="highPrice" content="';
if(!empty($product['price'])){
echo number_format(str_replace("€","",str_replace(" ","",$product['price'])),2);
}else{
echo "1.50";
}
echo '" />
</div>
<meta itemprop="sku" content="'.$product['asin'].'" />
<div itemprop="brand" itemtype="https://schema.org/Brand" itemscope>
<meta itemprop="name" content="AMAZON" />
</div>
</div>';
$i++;
}*/
}
?>
<main>
<div class="cover">
<?php
//PRE CACHE IMAGES
foreach($content_amazon as $product){
cacheimg($product['image']);
}
foreach(array_slice($content_amazon,0,$settings['num_results']) as $product){
echo '<div class="entry">';
echo '<div class="imgbox"><a href="'.$product['link'].'" rel="sponsored" target="_blank" class="plink"><img loading="lazy" src="'.cacheimg($product['image']).'" alt="'.($product['title']).'"></a></div>';
//echo '<p class="title"><a href="'.$product['link'].'" rel="sponsored" target="_blank">'.eliminar_acentos(trimstring($product['title'],85)).'</a></p>';
echo '<p class="title"><a href="'.$product['link'].'" rel="sponsored" target="_blank" class="plink">'.(($product['title'])).'</a></p>';
if(!empty($product['price'])){
//echo '<div class="onbottom"><a href="'.$product['link'].'" rel="sponsored" target="_blank">'.$product['price'].'</a></div></div>';
echo '<div class="onbottom"></div></div>';
}else{
echo '<div class="onbottom"></div></div>';
}
}
?>
</div>
<div class="spacer"> </div>
<div class="middlebox"><?php include "blocks/middlebox.php"; ?></div>
<div class="spacer"> </div>
<?php
if(!empty($data)){
print '<article>';
foreach($data as $entry){
if(!empty($entry['spintitle'])){
print '<h1>'.mb_strtoupper(($entry['spintitle']),'utf-8').'</h1>';
}
echo htmlspecialchars_decode(($entry['spintext']));
}
print '</article>';
}
if(empty($_GET['k'])){
echo "<h1>".($settings['slogan'])."</h1>";
print '<article>';
echo htmlspecialchars_decode(($settings['main_text']));
print '</article>';
}
?>
<div class="spacer"> </div>
<?php
if(!empty(array_slice($content_amazon,$settings['num_results'],$settings['num_related_results']) )){
echo "<h2>ARTICULOS RELACIONADOS</h2>";
}
?>
<div class="cover">
<?php
if(!isset($_GET['k'])){
$key = $settings['default_term'];
}else{
$key = $_GET['k'];
}
foreach(array_slice($content_amazon,$settings['num_results'],$settings['num_related_results']) as $product){
echo '<div class="entry">';
echo '<div class="imgbox"><a href="'.$product['link'].'" rel="sponsored" target="_blank" class="plink"><img loading="lazy" src="'.cacheimg($product['image']).'" alt="'.($product['title']).'"></a></div>';
//echo '<p class="title"><a href="'.$product['link'].'" rel="sponsored" target="_blank">'.eliminar_acentos(trimString($product['title'],75)).'</a></p>';
echo '<p class="title"><a href="'.$product['link'].'" rel="sponsored" target="_blank" class="plink">'.(($product['title'])).'</a></p>';
if(!empty($product['price'])){
//echo '<div class="onbottom"><a href="'.$product['link'].'" rel="sponsored" target="_blank">'.$product['price'].'</a></div></div>';
echo '<div class="onbottom"></div></div>';
}else{
echo '<div class="onbottom"></div></div>';
}
}
?>
</div>
</main>
<?php include "footer.php"; ?>