-
Notifications
You must be signed in to change notification settings - Fork 0
/
artikellist.php
384 lines (331 loc) · 15.6 KB
/
artikellist.php
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="de">
<head>
<title>Helden des Bildschirms Blog</title>
<meta charset="utf-8">
<meta name="description" content="Helden des Bildschirms bietet dir Gameserver und Voiceserver, Minecraft, Mods, TeamSpeak, Discord, Meet.">
<meta name="keywords" content="minecraft, rlcraft, gameserver, server, teamspeak, discord, meet, voiceserver, steem">
<meta name="author" content="Janis">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="index.css">
<link rel="apple-touch-icon" sizes="57x57" href="/icon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/icon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/icon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/icon/apple-/icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/icon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/icon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/icon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/icon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/icon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/icon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/icon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icon/favicon-16x16.png">
<link rel="manifest" href="/icon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#0033CC" />
<style type="text/css">
</style>
<script src="https://cdn.jsdelivr.net/npm/steem/dist/steem.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script type="text/javascript" src="purify.min.js"></script>
<!-- <script type="text/javascript" src="https://raw.githubusercontent.com/cure53/DOMPurify/main/dist/purify.min.js"></script> -->
<script>
//createArtikelPage();
document.addEventListener("DOMContentLoaded", () => {
//createArtikelPage_steamworld_api();
});
function createArtikelPage() {
var author = "janisplayer";
steem.api.getBlogEntries(author, 0, 74, function(err, data) {
for (var i = 0; i < 74; i++) {
if (data[i]["author"] == author) {
createArtikel(author, data[i]["permlink"], i);
}
}
});
}
function createArtikel(author, permlink, nummer) {
const br = document.createElement("br");
const imgcontainer = document.createElement("imgcontainer");
const picture = document.createElement("picture");
const imgcontainera = document.createElement("a");
const title = document.createElement("a");
const img = document.createElement("img");
const button = document.createElement("button");
const date = document.createElement("datum");
const content_box = document.getElementsByClassName("content")[0];
const artikel = document.createElement("artikel");
steem.api.getContent(author, permlink, function(err, result) {
if (JSON.parse(result["json_metadata"]).image != null && JSON.parse(result["json_metadata"]).image[0] != undefined) {
img.src = JSON.parse(result["json_metadata"]).image[0];
imgcontainera.href = "?artikel=" + permlink;
img.style = "width: 100%; height: 180px; object-fit: cover;";
} else {
img.src = "404.jpg";
imgcontainera.href = "?artikel=" + permlink;
img.style = "width: 100%; height: 180px; object-fit: cover;";
}
title.innerText = result["title"];
title.href = "?artikel=" + permlink;
date.innerText = result["created"];
button.innerText = "Beitrag lesen (Schnellansicht)"
button.onclick = function() {
createArtikelContent(author, permlink);
location.href="#content_read";
};
});
content_box.appendChild(artikel);
artikel.appendChild(imgcontainera);
imgcontainer.style = "width:100%; height:180px; overflow: hidden; display: inline-block; position: relative;";
imgcontainera.appendChild(imgcontainer);
imgcontainer.appendChild(picture);
if (img.src != null) {
picture.appendChild(img);
imgcontainer.appendChild(br);
}
artikel.appendChild(title);
artikel.appendChild(button);
artikel.appendChild(date);
}
function createArtikelContent(author, permlink) {
const br = document.createElement("br");
const imgcontainer = document.createElement("imgcontainer");
const picture = document.createElement("picture");
const imgcontainera = document.createElement("a");
const title = document.createElement("a");
const content_text = document.createElement("content_text");
const img = document.createElement("img");
const button = document.createElement("button");
const votes = document.createElement("votes");
const date = document.createElement("datum");
const content_box = document.getElementsByClassName("content_read")[0];
const artikel = document.createElement("artikel");
steem.api.getContent(author, permlink, function(err, result) {
if (JSON.parse(result["json_metadata"]).image != null && JSON.parse(result["json_metadata"]).image[0] != undefined) {
img.src = JSON.parse(result["json_metadata"]).image[0];
img.style = "width: auto; height: 100%; object-fit: cover;";
} else {
img.src = "404.jpg";
img.style = "width: auto; height: 100%; object-fit: cover;";
}
title.innerHTML = "<h1>" + result["title"];
title.href = "https://steemit.com" + result["url"];
//content_text.innerHTML = DOMPurify.sanitize((marked.parse(result["body"])));
marked.setOptions({
breaks: true,
});
content_text.innerHTML = DOMPurify.sanitize(marked.parse(result["body"]));
date.innerText = result["created"];
//button.innerText = "Vote: wird noch erstellt. Ich hatte wegen den Partnern zu wenig Zeit."
//button.setAttribute = "ArtikelVote(" + author + "," + permlink + ")"
});
content_box.insertBefore(artikel,content_read.children[0]);
artikel.appendChild(title);
artikel.appendChild(content_text);
steem.api.getActiveVotes(author, permlink, function(err, result) {
votes.innerText = "Votes: " + result.length;
});
artikel.appendChild(votes);
artikel.appendChild(button);
artikel.appendChild(date);
}
function oldcreateArtikel(author, permlink) {
const br = document.createElement("br");
const title = document.createElement("a");
const img = document.createElement("img");
const date = document.createElement("datum");
const content_box = document.getElementsByClassName("content")[0];
const artikel = document.createElement("artikel");
steem.api.getContent(author, permlink, function(err, result) {
if (JSON.parse(result["json_metadata"]).image != null) {
img.src = JSON.parse(result["json_metadata"]).image[0];
img.style = "width:100px;height:auto;";
}
title.innerText = result["title"];
title.href = "https://steemit.com" + result["url"];
date.innerText = result["created"];
});
artikel.innerText;
content_box.appendChild(artikel);
artikel.appendChild(img);
artikel.appendChild(br);
artikel.appendChild(title);
artikel.appendChild(date);
}
function createArtikelPage_steamworld_api() {
var jf = new XMLHttpRequest();
jf.open("GET", "templates/PostsByAuthor.json", false);
jf.send(null)
const jf_PBA = JSON.parse(jf.response).inhalt;
const cols = JSON.parse(jf_PBA).result.cols;
const rows = JSON.parse(jf_PBA).result.rows;
console.log(cols.author);
var author = "janisplayer";
for (var i = 0; i < rows.length; i++) {
if (rows[i][cols.author] == author) {
createArtikel_steamworld_api(i,rows,cols);
}
}
}
function createArtikel_steamworld_api(i, rows, cols) {
const br = document.createElement("br");
const imgcontainer = document.createElement("imgcontainer");
const picture = document.createElement("picture");
const imgcontainera = document.createElement("a");
const title = document.createElement("a");
const img = document.createElement("img");
const button = document.createElement("button");
const date = document.createElement("datum");
const content_box = document.getElementsByClassName("content")[0];
const artikel = document.createElement("artikel");
if (JSON.parse(rows[i][cols.json_metadata]).image != null && JSON.parse(rows[i][cols.json_metadata]).image[0] != undefined) {
img.src = JSON.parse(rows[i][cols.json_metadata]).image[0];
imgcontainera.href = "?artikel=" + rows[i][cols.permlink];
img.style = "max-width:100%; height:auto; display: inline-block; vertical-align: middle;";
img.style = "width: 100%; height: 180px; object-fit: cover;";
} else {
img.src = "404.jpg";
imgcontainera.href = "?artikel=" + rows[i][cols.permlink];
img.style = "width: 100%; height: 180px; object-fit: cover;";
}
title.innerText = rows[i][cols.title];
title.href = "?artikel=" + rows[i][cols.permlink];
date.innerText = new Date(rows[i][cols.created] * 1000);
button.innerText = "Beitrag lesen (Schnellansicht)"
button.onclick = function() {
createArtikelContent_steamworld_api(rows[i][cols.permlink]);
location.href="#content_read";
};
content_box.appendChild(artikel);
artikel.appendChild(imgcontainera);
imgcontainer.style = "width:100%; height:180px; overflow: hidden; display: inline-block; position: relative;";
imgcontainera.appendChild(imgcontainer);
imgcontainer.appendChild(picture);
if (img.src != null) {
picture.appendChild(img);
imgcontainer.appendChild(br);
}
artikel.appendChild(title);
artikel.appendChild(button);
artikel.appendChild(date);
}
function createArtikelContent_steamworld_api(permlink) {
var jf = new XMLHttpRequest();
jf.open("GET", "templates/index_"+ permlink + ".json", false);
jf.send(null)
const br = document.createElement("br");
const imgcontainer = document.createElement("imgcontainer");
const picture = document.createElement("picture");
const imgcontainera = document.createElement("a");
const title = document.createElement("a");
const content_text = document.createElement("content_text");
const img = document.createElement("img");
const button = document.createElement("button");
const votes = document.createElement("votes");
const date = document.createElement("datum");
const content_box = document.getElementsByClassName("content_read")[0];
const artikel = document.createElement("artikel");
title.innerHTML = "<h1>" + JSON.parse(jf.response).title;
title.href = "https://steemit.com" + "/" + JSON.parse(jf.response).category + "/@" + JSON.parse(jf.response).author + "/" +permlink;
marked.setOptions({
breaks: true,
});
content_text.innerHTML = DOMPurify.sanitize(marked.parse(JSON.parse(jf.response).body));
date.innerText = Date(JSON.parse(jf.response).datum);
//button.innerText = "Vote: wird noch erstellt. Ich hatte wegen den Partnern zu wenig Zeit."
//button.setAttribute = "ArtikelVote(" + author + "," + permlink + ")"
content_box.insertBefore(artikel,content_read.children[0]);
artikel.appendChild(title);
artikel.appendChild(content_text);
votes.innerText = "Votes: up: " + JSON.parse(jf.response).upvote_count + " down: " + JSON.parse(jf.response).downvote_count;
artikel.appendChild(votes);
artikel.appendChild(button);
artikel.appendChild(date);
}
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-176121451-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-176121451-1', {
'anonymize_ip': true
});
</script>
<!-- Google Tag Manager -->
<script>
(function(w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-K73ZCBF');
</script>
<!-- End Google Tag Manager -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5350651163680266" crossorigin="anonymous"></script>
<script>
addEventListener('DOMContentLoaded', (event) => {
document.getElementById('suche_summit').addEventListener('click', suche);
document.getElementById('suche_input').onkeydown = function(e) {
if (e.keyCode == 13) {
suche();
}
};
});
function suche() {
var suche_text = document.getElementById('suche_input').value
document.getElementById('suche_input').value = "";
document.location = ("https://cse.google.com/cse?cx=7718be5d5ddc85d34&q=" + suche_text);
}
</script>
</head>
<body>
<div class="head">
<img src="/img/logo.png" alt="Logo von @Zauberah erstellt." style="width:64px;height:51px;">
<a href="/">Helden des Bildschirms</a>
</div>
<div class="over_nav">
<a href="/">Home</a>
<div class="suchen" style="float:right">
<input type="text" value="" id="suche_input" class="suche"><button id="suche_summit" class="suche">suchen</button>
</div>
</div>
<content_box>
<div class="content_read" id ="content_read" >
</div>
<div class="content">
<?=$body_parsedown?>
</div>
<div id="werbung_google">
<!-- Adblock -->
<ins class="adsbygoogle" style="display:block; text-align:center; margin-top: 1%;" data-ad-client="ca-pub-5350651163680266" data-ad-slot="9833970873" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</content_box>
</body>
<footer>
<text>
<ul>
<!-- <li>© 2019 Helden des Bildschirms</li> -->
<li><a href="mailto:[email protected]">Kontakt</a></li>
<li><a href="/datenschutz.html">Datenschutz</a></li>
<li><a href="/impressum.html">Impressum</a></li>
</ul>
</text>
</footer>
</html>