Repository navigation
Expand file tree
/
Copy pathpoet.php
More file actions
81 lines (75 loc) · 4.1 KB
/
Copy pathpoet.php
File metadata and controls
81 lines (75 loc) · 4.1 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
<?php
require_once '/home/raphi/config/mysql_config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/section.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/sql_queries.php';
// Create connection
$mysql = new mysqli($servername, $username, $password, $dbname);
$mysql->set_charset('utf8mb4');
// Check connection
if ($mysql->connect_error) {
die("Connection failed: " . $mysql->connect_error);
}
// bound parameter, not string concatenation
$poet = (string)($_GET['poet'] ?? '');
$poet_row = poet_sql($mysql, $poet);
$poet_y = $poet_row['name_y'] ?? null;
$how_many_poems = poet_check($mysql, $poet, $GENRE);
if (!$poet_y or $how_many_poems == 0) {
header('HTTP/1.0 404 Not Found');
readfile('vos.html');
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=.6, maximum-scale=.6">
<script src="/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?= $SECTION_BASE ?>/style.css">
<link rel='shortcut icon' href='/favicon.png' type='image/x-icon' />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<title><?= e($S['title']) ?></title>
</head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-X8X9FRW4HG"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-X8X9FRW4HG');
</script>
<body>
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/header.php'; ?>
<div class="lang_btns">
<button class="lang_btn eng" id="eng_btn">AB</button>
<button class="lang_btn yid cur_lang_btn" id="yid_btn" dir="rtl">אב</button>
</div>
<div class="frame">
<h2 class="browse_hdr eng" id="work_hdr_eng">Browse the Work of <?php echo $poet; ?></h2>
<h2 class="browse_hdr yid default" id="work_hdr_yid" dir="rtl">בלעטערט איבער די שריפֿטן פֿון <?php echo $poet_y; ?></h2>
<ul class="link_list yid default" id="work_list_yid" dir="rtl">
<?php
foreach (poet_poem_yid_list($mysql, $poet, $GENRE) as $poem) {
{
echo '<li class="link_list_item"><div class="link_box"><form action="poem.php" method="get" target="_blank"><button type="submit" class="poem_link" name="poem" value="' . $poem['poem'] . '"><img class="thumb" src="' . e(media_url($poem['img'] ?? null, 'images')) . '"><h3 class="link_title">' . $poem['title_y'] . ' <em class="browse_em">פֿון</em> ' . $poet_y . '</h3></button></form></div></li>';
}
}
?>
</ul>
<ul class="link_list eng" id="work_list_eng">
<?php
foreach (poet_poem_eng_list($mysql, $poet, $GENRE) as $result) {
{
echo '<li class="link_list_item"><div class="link_box"><form action="poem.php" method="get" target="_blank"><button type="submit" class="poem_link" name="poem" value="' . $result['poem'] . '"><img class="thumb" src="' . e(media_url($result['img'] ?? null, 'images')) . '"><h3 class="link_title">' . $result['title'] . ' <em class="browse_em">by</em> ' . $result['poet_e'] . '</h3></button></form></div></li>';
}
}
?>
</ul>
</div>
<script src="browse.js"></script>
<div id="license" style="float: right; font-size: xx-small; width: 150px; text-align: justify; margin:auto; padding: 10px; display: block;">
<a rel="license" ref="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="display: block; border-width:0; margin: 0 auto;" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" /></a><br />Except where otherwise noted, content on this site is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
</div>
</body>
</html>