This repository was archived by the owner on Jan 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnews.php
More file actions
86 lines (75 loc) · 3.17 KB
/
news.php
File metadata and controls
86 lines (75 loc) · 3.17 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
<!--
_ _ _
| | | | | |
| | ___ __ ___ ___| |_ _ __ ___ __ _ _ __ ___ __| | ___
| |/ / '_ ` _ \/ __| __| '__/ _ \/ _` | '_ ` _ \ / _` |/ _ \
| <| | | | | \__ \ |_| | | __/ (_| | | | | | || (_| | __/
|_|\_\_| |_| |_|___/\__|_| \___|\__,_|_| |_| |_(_)__,_|\___|
2020 (c) kmstream.de
-->
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>kmstream // neuigkeiten</title>
<?php include('kmstream-includes/style-head-template.php'); ?>
</head>
<body>
<div class="container-1">
<h1>kmstream mediakollektiv</h1>
<p>// neuigkeiten</p>
</div>
<?php include('kmstream-includes/navigator-template.php'); ?>
<div id="content">
<div class="row">
<?php
if(isset($_GET["id"])){
require("./kmstream-includes/mysql.php");
$stmt = $mysql->prepare("SELECT * FROM kmstream_neuigkeiten WHERE ID = :id");
$stmt->bindParam(":id", $_GET["id"], PDO::PARAM_INT);
$stmt->execute();
$count = $stmt->rowCount();
if($count == 0){
echo "Die News wurde nicht gefunden.";
} else {
$row = $stmt->fetch();
?>
<div class="card">
<img src="kmstream-content/assets/media/picture/twitter_header_photo_2.png">
<div class="card-headline"><?php echo $row["titel"] ?></div>
<div class="card-text"><?php echo $row["news_text"] ?></div>
<div class="card-footer"><?php echo date("d.m.Y", $row["created_at"]) ?> // <?php echo $row["author"] ?></div>
</div>
<?php
}
} else {
require("./kmstream-includes/mysql.php");
$stmt = $mysql->prepare("SELECT * FROM kmstream_neuigkeiten ORDER BY created_at DESC");
$stmt->execute();
$count = $stmt->rowCount();
if($count == 0){
echo "Es wurden keine News gefunden.";
} else {
while($row = $stmt->fetch()){
?>
<div class="col-4">
<div class="card">
<a href="news.php?id=<?php echo $row["ID"] ?>">
<img src="kmstream-content/assets/media/picture/twitter_header_photo_2.png">
<div class="card-headline card-center"><?php echo $row["titel"] ?></div>
<div class="card-text card-justify"><?php echo substr($row["news_text"], 0, 150) ?></div>
<div class="card-footer card-center">Erstellt am: <?php echo date("d.m.Y H:i", $row["created_at"]) ?></div>
</a>
</div>
</div>
<?php
}
}
}
?>
</div>
</div>
<?php include('kmstream-includes/footer-template.php'); ?>
</body>
</html>