-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshow1871.php
219 lines (183 loc) · 6.45 KB
/
show1871.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
<?php
// TODO: Tjek at $book er lovlig, så det bliver vanskeligere at misbruge fx bog="../../../../etc/passwd"
// Hacket slipper ikke igennem i øjeblikket, men det er mere held end forstand.
require_once('head.inc.php');
require_once('setdefault.inc.php');
require_once('replaceit_xml.inc.php');
require_once('oversigt_1871.inc.php');
function pagination($book, $kapitel) {
global $chaptype, $chap;
$outline_style = 'btn-outline-danger';
echo " <div style=\"margin-left: auto; margin-right: auto;\">\n";
$chcount = count($chap[$book]);
for ($chix=0; $chix < $chcount; ++$chix) {
$chno = $chap[$book][$chix];
echo " <a href=\"show1871.php?bog=$book&kap=$chno\" "
. "class=\"mt-1 mb-1 ml-0 mr-0 btn chap-btn "
. ($chno==$kapitel ? $outline_style : 'btn-danger')
. "\">$chno</a>\n";
}
echo " </div>\n";
}
if (!isset($_GET['bog']) || !isset($_GET['kap']) || !is_numeric($_GET['kap'])) {
echo "<pre>Forkerte parametre</pre>";
die;
}
$kap = intval($_GET['kap']);
$bog = $_GET['bog'];
$fra = isset($_GET['fra']) && is_numeric($_GET['fra']) ? intval($_GET['fra']) : 0;
$til = isset($_GET['til']) && is_numeric($_GET['til']) ? intval($_GET['til']) : 0;
makeheadstart($abbrev[$bog] . ' ' . $kap, true);
?>
<style>
.bibletext {
font-family: <?= $allfonts[$_SESSION['font']] ?>;
font-size: <?= $_SESSION['fontsize'] ?>%;
}
span.verseno {
vertical-align: super;
font-size: 0.625em;
}
h2 {
font-size: 1.125em;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
text-transform: none;
}
/* Taken in part from XKCD */
/* the reference tooltips style starts here */
.ref {
position: relative;
vertical-align: baseline;
}
.refnum, .refnumhead {
position: relative;
left: 2px;
bottom: 1ex;
color: #005994;
font-size: .7em;
font-weight: bold;
text-decoration: underline;
text-transform: lowercase;
cursor: pointer;
}
.tooltip-inner {
text-align: left;
}
div.paragraph {
text-indent: 2em;
display: block;
}
</style>
<script>
$(function() {
<?php if ($_SESSION['showverse']=='on'): ?>
$('.verseno').show();
<?php else: ?>
$('.verseno').hide();
<?php endif; ?>
<?php if ($_SESSION['showchap']=='on'): ?>
$('.chapno').show();
<?php else: ?>
$('.chapno').hide();
<?php endif; ?>
<?php if ($_SESSION['showh2']=='on'): ?>
$('h2').show();
<?php else: ?>
$('h2').hide();
<?php endif; ?>
<?php if ($_SESSION['showfn1']=='on'): ?>
$('.ref1').show();
<?php else: ?>
$('.ref1').hide();
<?php endif; ?>
<?php if ($_SESSION['oneline']=='on'): ?>
$('.paragraph').css('display','inline');
$('.verseno').before('<br class="versebreak">');
<?php endif; ?>
<?php if ($_SESSION['linespace']=='on'): ?>
$('.paragraph').css('line-height','2');
<?php endif; ?>
<?php if ($_SESSION['showfn1']=='on'): ?>
$('[data-num]').each(function( index ) {
$(this).text("[" + $(this).data('num') + "]");
<?php if ($_SESSION['showfnblock']=='on'): ?>
$('#footnotes').append("<b>" + $(this).data('num') + ":</b> " + $(this).attr('title') + "<br>");
<?php endif; ?>
});
<?php endif; ?>
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<?php
makeheadend();
makemenus(null);
?>
<div class="container">
<div class="row">
<div class="col-lg-9 col-xl-8">
<?php $text = replaceit_XML::replaceit("tekst/DA_OT1871.OSIS.xml", $inxml[$bog], $kap, $fra, $til); ?>
<div class="card mt-4">
<h1 class="card-header bg-warning"><?= $title[$bog] ?>, <?= $chaptype[$bog]?> <?=$kap?></h1>
<div class="card-body bibletext">
<?= $text ?>
</div>
</div>
</div>
<!-- Chapter chooser displayed at right for size lg and xl -->
<div class="d-none d-lg-block col-lg-3 col-xl-4">
<div class="card mt-4">
<h1 class="card-header bg-info text-light">Vælg <?= $chaptype[$bog] ?></h1>
<div class="card-body pl-xl-4 pl-lg-1 pr-0">
<?php pagination($bog,$kap); ?>
</div>
</div>
</div>
</div>
<?php
$show_note = $_SESSION['showfnblock']=='on'
&& $_SESSION['showfn1']=='on'
&& replaceit_XML::$refnum>0;
?>
<?php if ($show_note): ?>
<div class="row">
<div class="offset-xl-1 col-xl-6
offset-lg-1 col-lg-7
offset-md-2 col-md-8
col-sm-10">
<div class="card mt-3">
<h1 class="card-header bg-info text-light">Fodnoter</h1>
<div class="card-body">
<small id="footnotes">
</small>
</div>
</div>
</div>
</div>
<?php endif; ?>
<!-- Chapter chooser displayed at bottom for size xs, sm, and md -->
<div class="row justify-content-center d-flex d-lg-none">
<div class="col-sm-8 col-md-6">
<div class="card mt-3">
<h1 class="card-header bg-info text-light">bVælg <?= $chaptype[$bog] ?></h1>
<div class="card-body pl-1 pl-sm-3 pr-0">
<?php pagination($bog,$kap); ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="offset-xl-2 col-xl-4
offset-lg-2 col-lg-5
offset-md-3 col-md-6
offset-sm-2 col-sm-8">
<div class="card mt-3">
<h1 class="card-header bg-info text-light">Status for dette kapitel</h1>
<div class="card-body">
Denne tekst er den autoriserede oversættelse fra 1871 af Det Gamle Testamente.
</div>
</div>
</div>
</div>
</div><!--End of container-->
<?php
endbody();