Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $db = mysqli_connect("localhost", "root", "", "forum");
- if(isset($_SESSION['id'])) {
- if($_SESSION['rule'] > 1) {
- echo "
- <form style='border:none; background:#141E26 ;position: relative; top:-20%; left:43%; width: 99%; height: 150px;' action='create_topic.php' method='post' >
- <input style='border:none; top: 10%; width: 15%; left:5%; position:absolute;' type='text' name='topic_title'maxlength='12' placeholder='Имя топика'>
- <input class='wow' style='width: 15%; left:5%; position:absolute; top:55%; font-size: 14px; border:none; background:#11191F; color:white;' type='submit' value='Создать топик'>
- <label class='wow' style='color:white; position: absolute; top: 20%; left: 25%;'>Доступно для:</label>
- <select style='border: 1px solid #999; font-size: 18px; color: #ffffff; background-color: #141E26; border-radius: 5px; position: absolute; top: 27%; left: 37%;' name='permissions'>
- <option value='defoult'>Все</option>
- <option value='avtor'>Авторитет </option>
- <option value='verifed'>Проверенный</option>
- <option value='admin'>Администратор</option>
- </select>
- <label class='wow' style='color:white; position: absolute; top: 50%; left: 25%;'>Префикс темы:</label>
- <select style='border: 1px solid #999; font-size: 18px; color: #ffffff; background-color: #141E26; border-radius: 5px; position: absolute; top: 57%; left: 43%;' name='topic_prefix'>
- <option value='Обычная'>Обычная</option>
- <option value='https://iimg.su/s/06/th_hYbU8DPQ69F16k46UeX3zbxHdw3tfig2qvldZKze.png'>Важно</option>
- <option value='https://iimg.su/s/06/th_aqvflVXNGUTJfeJ1uTT2Nxuxe6R3AkMhrw7UKYMP.png'>Инфо</option>
- <option value='https://iimg.su/s/06/th_Uwi5iujDUfrfMNeuS0d4DNgn8g8nPlIfSWSXrGYv.png'>Новое</option>
- </select>
- </form>
- ";
- }else{
- echo "
- <form style='border:none; background:#141E26 ;position: relative; top:-20%; left:43%; width: 99%; height: 150px;' action='create_topic.php' method='post' >
- <input style='border:none; top: 10%; width: 15%; left:5%; position:absolute;' type='text' name='topic_title'maxlength='12' placeholder='Имя топика'>
- <input class='wow' style='width: 15%; left:5%; position:absolute; top:55%; font-size: 14px; border:none; background:#11191F; color:white;' type='submit' value='Создать топик'>
- <label class='wow' style='color:white; position: absolute; top: 20%; left: 25%;'>Доступно для:</label>
- <select style='border: 1px solid #999; font-size: 18px; color: #ffffff; background-color: #141E26; border-radius: 5px; position: absolute; top: 27%; left: 37%;' name='permissions'>
- <option value='defoult'>Все</option>
- </select>
- <label class='wow' style='color:white; position: absolute; top: 50%; left: 25%;'>Префикс темы:</label>
- <select style='border: 1px solid #999; font-size: 18px; color: #ffffff; background-color: #141E26; border-radius: 5px; position: absolute; top: 57%; left: 43%;' name='topic_prefix'>
- <option value='Обычная'>Обычная</option>
- <option value='https://iimg.su/s/06/th_Uwi5iujDUfrfMNeuS0d4DNgn8g8nPlIfSWSXrGYv.png'>Новое</option>
- </select>
- </form>
- ";
- }
- } else {
- echo "Пожалуйста <a href='index.php'>Войдите</a> для оставления сообщений.";
- }
- echo"
- <form style='position:relative; top:-35%; left: 70%; ' action='search.php' method='GET'>
- <input type='text' name='query' placeholder='Введите ваш запрос'>
- <button type='submit'>Искать</button>
- </form>
- ";
- include 'db_conn.php'; // Подключаем файл для соединения с БД
- // SQL запрос для получения списка тем
- $sql = "SELECT * FROM topics";
- $result = $conn->query($sql);
- echo "<div style='width: 1000px; height: 1px; position: relative; margin-bottom: 60px'>"; // Добавлено margin-bottom: 60px для отступа между рамками
- if ($result->num_rows > 0) {
- // Вывод списка тем
- while($row = $result->fetch_assoc()) {
- $user_id = $row['user_id'];
- $query = mysqli_query($db, "SELECT * FROM `users` WHERE `id`='{$user_id}'");
- $array = mysqli_fetch_array($query);
- echo "<div style='width: 1000px; height: 25px; position: relative; left:43%; margin-bottom: 60px'>"; // Добавлено margin-bottom: 60px для отступа между рамками
- echo "<a href='topic.php?id=".$row["topic_id"]."'>";
- echo "<div style='width: 1000px; height: 70px; left: 0px; top: 0px; position: absolute; background: #141E26; border-radius: 50px'></div>";
- echo "<div style='width: 300px; height: 32px; left: 304px; top: 21px; position: absolute; color: white; font-size: 24px; font-family: Montserrat Bold; font-weight: 700; word-wrap: break-word'>".$row["topic_title"]."</div>";
- echo "<div style='width: 400px; height: 37px; left: 600px; top: 21px; position: absolute; color: white; font-size: 24px; font-family: Montserrat Bold; font-weight: 700; word-wrap: break-word'>Автор: ".$array['user_name']."</div>";
- echo "<div style='width: 168px; height: 31px; left: 57px; top: 21px; position: absolute; color: white; font-size: 24px; font-family: Montserrat Bold; font-weight: 700; word-wrap: break-word'><div style=' position: absolute; top:-15%; left:-10%; width: 80px; height: 35px; font-size: 0px; background:url(".$row["topic_prefix"].");'> </div></div>";
- echo "</div>";
- echo "</a>";
- }
- } else {
- }
- ?>
- <!DOCTYPE html>
- <html id="suka">
- <head>
- <title>Forum</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- <link rel="stylesheet" href="fonts/fonts.css">
- </head>
- <body style="background: #11191F; display: flex; justify-content: center; align-items: center; height: 100vh; flex-direction: column;">
- <div style="position:fixed; top:5vh; left:5vh; width: 100px; height: 100px; justify-content: flex-start; align-items: flex-start; gap: 10px; display: inline-flex">
- <img style=" position:absolute; top:5%; left:5%; width: 80px; height: 80px; border-radius: 9999px" src="src/media/logo.png" />
- </div>
- <div style="position:fixed; top:9vh; left:13vh; width: 175px; height: 30px; padding: 10px; justify-content: center; align-items: center; display: inline-flex">
- <a href="index.php" class="mont" style="text-decoration: none;">UNO-WTF.TK</a>
- </div>
- <div>
- <a href="home.php" class="mont" style="position:fixed; text-decoration: none; top:9vh; right:20vh; width: 205px; height: 30px; padding: 10px;" >Личный кабинет</a>
- <a href="forum.php" class="mont" style="position:fixed; text-decoration: none; top:9vh; right:5vh; width: 100px; height: 30px; padding: 10px;">Форум</a>
- </div>
- </body>
- <script src="./src/visual/dop.js"></script>
- <script src="./src/visual/back.js"></script>
- <script src="./src/visual/app.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement