-
Notifications
You must be signed in to change notification settings - Fork 0
/
news.php~
62 lines (56 loc) · 1.59 KB
/
news.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
<?php
session_start();
$id = (int)$_GET['id'];
if( $id < 1 ) {
$id = 1;
}
include("connect_db.php");
include("translate.php");
include('set_lang.php');
$STH = $DBH->query("SELECT (*) FROM post WHERE id = ".$id);
if (!empty($STH)) {
$id = 1;
}
$sq = "SELECT * from post WHERE id=".$id;
$STH = $DBH->query($sq);
$STH->setFetchMode(PDO::FETCH_ASSOC);
if( empty($STH)) {
echo "POST EMPTY<P> <a href='index.php'>HOME</a>";
} else{
include('header.html');
include('leftside.html');
echo'
<div class="center">';
while($row = $STH->fetch())
{
echo '<div class="title"><p>';
if($lang == 'eng'){
echo "<b>".$row['title']."</b><p></div>";
}else{
echo "<b>".$row['title_ukr']."</b><p></div>";
}
echo '<div class="text">';
if($lang == 'eng'){
echo $row['text'];
}else{
echo $row['text_ukr'];
}
echo "</div>";
echo '<div class="author">';
$link_profil="profil.php?id=".$row['author_id'];
echo"<p>".t($lang,'author').":<a href=".$link_profil.">".$row['author']."</a>".t($lang,'date').": ".$row['data']."<p></div>";
$s = "change.php?id=".$id;
if ($_SESSION['ent'] == 2 && $_SESSION['login'] == $row['author'])
{
echo"<div style='bottom: 10px; margin-bottom:50px; '><p><a class='button' href=".$s.">".t($lang,'change')." </a>";
$s = "delete.php?id=".$id;
echo"<a class='button' href=".$s.">".t($lang,'delete')."</a></div>";
}
}
include('comment.php');
echo '</div>';
}
include('rightside.php');
include('mark.php');
echo"</body></html>";
?>