Редизайн главной страницы
This commit is contained in:
24
front/pages/index/counter.php
Normal file
24
front/pages/index/counter.php
Normal 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="visualbox">
|
||||
<?php
|
||||
// India stronk 🇮🇳💪
|
||||
$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>
|
||||
6
front/pages/index/random_meme.php
Normal file
6
front/pages/index/random_meme.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
// TODO: picking random meme
|
||||
?>
|
||||
<div class="visualbox">
|
||||
<img src="test.png">
|
||||
</div>
|
||||
44
front/pages/index/searchbox.php
Normal file
44
front/pages/index/searchbox.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// Main page search box
|
||||
|
||||
if (!$IS_FRONTEND) {
|
||||
http_response_code(500);
|
||||
die();
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="visualbox searchbox">
|
||||
<a class="title" href=".">E949</a>
|
||||
<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>";
|
||||
unset($res);
|
||||
} 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">
|
||||
<input type="hidden" name="do" value="search_posts">
|
||||
<!-- TODO: JS
|
||||
<input type="button" value="Show random meme" id="random-meme">
|
||||
-->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user