project completed (feel free to contribute)

This commit is contained in:
Underemployed 2024-03-29 13:21:14 +05:30
parent a834ee565c
commit 20c4cf3efe
3 changed files with 8 additions and 10 deletions

View file

@ -24,11 +24,9 @@ if(isset($_GET['id'])){
<input type="hidden" value="<?=$id?>" name='id'>
<input type="text" name ="firstname" value="<?= $user['firstname'] ?>" placeholder="First Name">
<input type="text" name ="lastname" value="<?= $user['lastname'] ?>" placeholder="Last Name">
<select name ="userrole" value = "<?= $user['is_admin'] ?>">
<select name="userrole">
<option value="0">Author</option>
<option value="1">Admin</option>
<option <?= $user['is_admin'] ? 'selected' : '' ?> value="1">Admin</option>
</select>
<button type="submit" name="submit" class="btn">Update User</button>
</form>

View file

@ -39,7 +39,7 @@ $posts=mysqli_query($connection,$query);
<a href="category-posts.php?id=<?= $category_id ?>" class="category__button"><?=$category['title']?></a>
<h2 class="post__title"><a href="post.php?id=<?=$featured['id']?>"><?=$featured['title']?></a></h2>
<p class="post__body">
<?= substr(html_entity_decode($post['body']), 0, 120) ?>...
<?= substr(html_entity_decode($featured['body']), 0, 300) ?>...
</p>
<div class="post__author-avatar">
<img src="./images/<?= $author['avatar'] ?>">

View file

@ -1,6 +1,5 @@
<?php
require 'config/database.php';
if(isset($_SESSION['user-id'])) {
$id = filter_var($_SESSION['user-id'], FILTER_SANITIZE_NUMBER_INT);
$query = "SELECT avatar FROM users WHERE id='$id'";
@ -14,14 +13,15 @@ if(isset($_SESSION['user-id'])) {
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="max-age=3600">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="max-age=600">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blog Website</title>
<!-- CUSTOM STYLESHEET -->
<link rel="stylesheet" href="<?= ROOT_URL ?>css/style.css">
<!-- ICONSCOUT CDN -->
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css">
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
<!-- GOOGLE FONT(MONTSERATE) -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,800;1,700&display=swap" rel="stylesheet">
</head>