-
Notifications
You must be signed in to change notification settings - Fork 0
/
most_popular.php
executable file
·121 lines (102 loc) · 3.3 KB
/
most_popular.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta charset="UTF-8">
<title>Petru Potrimba's Blog</title>
<link rel="stylesheet" href="css2.css">
<style media="screen">
.cool {
padding-left: 12%;
padding-right: 8%;
padding-top: 25%;
padding-bottom: 17%;
font-size: 120%;
font-family: oblique;
}
.most_popular {
margin-top: 10%;
background-color: #F9F8EE;
}
.recent_post {
background-color: #F9F8EE;
margin-top: 10%;
padding-top: 3%
}
.pack {
padding-bottom: 12%;
}
.recent {
padding-bottom: 3%;
}
.social {
padding-top: 5%;
padding-bottom: 3%;
}
.socialForPaddingTop {
padding-top: 3%;
}
.social-button {
padding-right: 3%;
}
.author {
font-family: oblique;
color: black;
}
<style media="screen">
@font-face {
font-family: GraublauWeb;
src: url("font/OlsenTF-Regular.otf") format("opentype");
}
.cool, .author, .recent, .tohover, .date, .soc {
font-family: GraublauWeb;
}
</style>
</style>
</head>
<body>
<?php require_once 'dbconnection.php';?>
<div class="row">
<div class="col-sm-12 most_popular">
<p class="cool"><i><u>You have to remember that it is impossible to commit a crime while reading a book.</u></i></p>
<p class="author"><i>John Waters</i></p>
</div>
</div>
<div class="row">
<?php
$query_sql="SELECT * FROM Article ORDER BY IdArticle DESC limit 5";
$article = $conn->query($query_sql);
if ($article->num_rows > 0) {
echo '<div class="col-sm-12 recent_post">';
echo '<p class="recent"><b>Recent posts</b></p>';
while($row = $article->fetch_assoc()) {
echo '<section class="pack">';
echo '<h6 class="tohover" onclick="goToArticle('.$row['IdArticle'].')" >'.$row['Title'].'</h6>';
$explodedDate = explode("-", $row['Date']);
$month = $explodedDate[1];
$dateObj = DateTime::createFromFormat('!m', $month);
$monthName = $dateObj->format('F'); // March
$dateWithMonthLiteral = $monthName.' '.$explodedDate[2].', '.$explodedDate[0];
echo '<a class="date">'.$dateWithMonthLiteral.'</a>';
echo '</section>';
}
}
echo '</div>';
?>
</div>
<div class="row">
<div class="col-sm-12 most_popular socialForPaddingTop">
<b class="soc">Social</b>
<section class="social">
<a target="_blank" class="social-button" href="https://www.facebook.com/petru.potrimba.77"><input type="image" name="facebook" value="facebook logo" src="article/img/fb-logo.png" width="12%" height="auto"></a>
<a target="_blank" class="social-button" href="https://www.linkedin.com/in/petru-potrimba-a065a0137/"><input type="image" name="linkedin" value="linkedin logo" src="article/img/in-logo.png" width="12%" height="auto"></a>
<a target="_blank" class="social-button" href="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/Pptr95"><input type="image" name="facebook" value="github" src="article/img/github-logo.png" width="12%" height="auto"></a>
</section>
</div>
</div>
</body>
<script type="text/javascript">
function goToArticle(id) {
window.location.href ="image-post.php?" + "id=" + id;
}
</script>