Проект ещё жив!

This commit is contained in:
2023-12-20 06:08:13 +03:00
parent a573faf5a1
commit 8d74a51937
23 changed files with 358 additions and 143 deletions

24
front/counter.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
// Main page posts counter
if (!$IS_FRONTEND) {
http_response_code(500);
die();
}
$totalPostsAmount = Post_GetPostsAmount();
$totalPostsAmount = strval($totalPostsAmount);
?>
<div class="nibbabox notsearchbox">
<?php
$allNumbers = array();
for ($i = 0; $i < strlen($totalPostsAmount); ++$i)
$allNumbers[] = "<img src=\"front/images/counter/" . $totalPostsAmount[$i] . ".png\">";
while (count($allNumbers) < 7)
$allNumbers[] = "<img src=\"front/images/counter/0.png\">";
foreach ($allNumbers as $numberImg)
echo $numberImg;
?>
</div>

3
front/favicon.html Normal file
View File

@@ -0,0 +1,3 @@
<link rel="shortcut icon" href="front/images/favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="32x32" href="front/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="front/images/favicon-16x16.png">

16
front/head.php Normal file
View File

@@ -0,0 +1,16 @@
<meta charset="UTF-8">
<?php
// <head> ... </head>
if (!isset($PAGE_TITLE)) {
http_response_code(500);
die("\$PAGE_TITLE not set");
}
echo "<title>E949: $PAGE_TITLE</title>\n";
require_once("favicon.html");
?>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="front/styles/default.css">

42
front/searchbox.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
// Main page search box
if (!$IS_FRONTEND) {
http_response_code(500);
die();
}
?>
<div class="nibbabox searchbox">
<h1 class="title"><a href=".">E949</a></h1>
<div class="nav">
<?php
// If user is logged in
if ($LOGGED_IN) {
$res = User_GetInfoByID($THIS_USER);
if ($res->IsError())
$res->ThrowJSONError();
$uname = $res->GetData()["login"];
echo "<a class=\"useraccount\" title=\"Account page\" href=\"./?do=view_user&id=$THIS_USER\">$uname</a>";
} else { // If user is NOT logged in
?>
<a title="Login in existing account" href="./?do=login">Login</a>
<a title="Create new account" href="./?do=signup">Signup</a>
<?php
}
?>
<a title="A paginated list of every post" href="./?do=view_all_posts">Posts</a>
<a title="A paginated list of every tag" href="./?do=view_all_tags">Tags</a>
<a title="Statistics of current instance" href="./?do=view_stats">Statistics</a>
<a title="A site map" href="./?do=view_sitemap">Site map</a>
</div>
<div>
<form action="." accept-charset="UTF-8" method="get">
<input type="text" name="tags" id="tags" value="" size="36" autofocus="autofocus" autocomplete="on"><br>
<input type="submit" value="Search">
<!-- TODO: JS
<input type="button" value="Show random meme" id="random-meme">
-->
</form>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

View File

@@ -1,5 +1,7 @@
body, div, h1, h2, h3, h4, h5, h6, p, ul, li, dd, dt {
font-family: Verdana, Sans-Serif;
body {
background-color: #094e59;
background-image: url("../images/bg_pattern_peace.png");
background-repeat: repeat;
}
body, div, p, a {
@@ -7,37 +9,11 @@ body, div, p, a {
margin: 0;
}
h1, h2, h3, h4, h5, h6, p, a {
color: #00c07c;
text-decoration: none;
}
a {
color: #009049;
}
body {
background-color: #094e59;
background-image: url("./bg_pattern_peace.png");
background-repeat: repeat;
}
div.wrapper {
text-align: center;
margin: auto;
}
/*div.wrapper img {
width: 60%;
height: 60%;
}*/
h1.title {
font-size: 4em;
padding: 0;
margin: 0;
}
div.nav {
margin-bottom: 0.25rem;
}
@@ -63,6 +39,30 @@ div.notsearchbox {
font-size: 80%;
}
h1, h2, h3, h4, h5, h6, p, ul, li, dd, dt {
font-family: Verdana, Sans-Serif;
}
h1, h2, h3, h4, h5, h6, p, a {
color: #00c07c;
text-decoration: none;
}
a {
color: #009049;
}
div.nav a.useraccount {
color: orange;
text-decoration: underline;
}
h1.title {
font-size: 4em;
padding: 0;
margin: 0;
}
@media only screen and (max-height: 600px) {
div.wrapper {
top: 25vh;