This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle.php
48 lines (48 loc) · 1.8 KB
/
article.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
<?php
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 0)
{
header('Location: /notfound');
exit;
}
require $_SERVER['DOCUMENT_ROOT'] . '/includes/config.php';
$result = $mysqli->query('SELECT image, imageName, imageCaption FROM article WHERE id=' . $_GET['page']);
$row = $result->fetch_assoc();
$result->free();
if (!$row)
{
header('Location: /notfound');
exit;
}
?>
<!DOCTYPE html>
<html lang="he">
<?php
$page_title = 'מאמרים - ' . $row['imageName'];
$page_description = strip_tags($row['imageCaption']);
$page_description = str_replace(array('<br>', "\r", "\n"), array(' ', '', ''), $page_description);
$page_description = htmlspecialchars($page_description, ENT_QUOTES);
$page_url = 'http://imutz.org/article-' . $_GET['page'];
$page_image = 'http://imutz.org/images/articles/' . $row['image'];
list($page_image_width, $page_image_height) = getimagesize($page_image);
require $_SERVER['DOCUMENT_ROOT'] . '/includes/head.php';
?>
<body>
<div id="wrapper">
<?php require $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?>
<main>
<?php require $_SERVER['DOCUMENT_ROOT'] . '/includes/mobile.php'; ?>
<div id="content" class="article fullwidth">
<div id="contentInner">
<?php
echo '<a class="imageModal" href="/images/articles/' . $row['image'] . '" title="' . $row['imageName'] . '" data-width="' . $page_image_width . '" data-height="' . $page_image_height . '"><img class="floated" src="/images/articles/' . $row['image'] . '" title="' . $row['imageName'] . '" alt="' . $row['imageName'] . '"></a>
<h2>' . $row['imageName'] . '</h2>
' . $row['imageCaption'] . '
<p class="lastp"><a href="/articles">חזרה למאמרים</a></p>';
?>
</div>
</div>
</main>
<?php require $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
</div>
</body>
</html>