Commit 922e0635 authored by Borislav Dostumski's avatar Borislav Dostumski 👽

I add

parents
Require all granted
RewriteEngine Off
<FilesMatch "\.(txt)$">
Require all granted
</FilesMatch>
<FilesMatch "\.(txt)$">
Allow from all
</FilesMatch>
# sipleBLOG by [SYSCOMz]
BLOG WEBSITE
--------------
## **simpleBLOG** is a:
* Blog website
* GPL (General Public License)
<div align="center">
<img src="images/wallpaper.png" width="100%" />
</div>
<a href="https://www.youtube.com/watch?v=YKbuZ7UPjUs&t=14s">simpleBLOG VIDEO</a>
## Requirements
* **To work with the program you need to start it in a web server**
* **You need to import [ syscomz_blog.sql ] file to your SQL Database**
* **From main menu click Admin link [ Username = root ] && [ Password = root ]**
* **If you want to change login [ Username && Password ], do it in SQL Database [ Table -> users, Columns -> user_name && user_password ], user_password use md5 encryption**
* **You need to change [ connection.php ] file path [ admin/includes/connection.php ] $hostname, $username, $password;**
## To create **simplBLOG** I am using :
* HTML
* CSS
* Bootstrap
* JavaScript
* jQuery
* PHPMailer
* PHP
* SQL
* Apache Web Server
## **Website Design:**
**For the website we have Front-end [Client] design and Back-end [Admin] design**
### Main Design:
* Menu [ Logo, Home, Admin ]
* Body [ Articles ]
* Footer [ Calendar, Social links, Mail ]
### Front-end [Client]:
* Menu
* Logo
* Home
* Admin -> Login
* Body [ Articles ]
* Header
* Short Text
* Publishing Date
* Read Button [ Next Page -> ]
* Header
* Image [ If is set ]
* Long Text
* Publishing Date
* Back Button
* Footer
* Calendar
* Social Links
* Mail
### Back-end [Admin]:
* Menu
* Logo
* Home
* Admin
* Add Article [ Next Page -> ]
* Header
* Long Text
* Set Image
* Add Article Button
* Logout
* Body [ Articles ]
* Header
* Short Text
* Edit Button [ Next Page -> ]
* Edit Header
* Edit Long Text
* Edit Article Button
* Delete Button [ Next Page -> ]
* Cancel Button
* Yes Button
* Read Article Button
* Read Button [ Next Page -> ]
* Header
* Image [ If is set ]
* Long Text
* Publishing Date
* Back Button
* Publishing Date
* Footer
* Calendar
* Social Links
* Mail
<?php
session_start();
include_once("includes/connection.php");
include_once("upload.php");
if(isset($_SESSION['logged'])) {
if (isset($_POST['title'], $_POST['content'])) {
$title = $_POST['title'];
$content = nl2br($_POST['content']);
if(empty($title) or empty($content)) {
$error = "All fields are required!";
} else {
if(empty($imageFileType)) {
$query = $pdo->prepare('INSERT INTO articles(article_title, article_content) VALUES (?, ?)');
$query -> bindValue(1, $title);
$query -> bindValue(2, $content);
$query -> execute();
} else {
$query = $pdo->prepare('INSERT INTO articles(article_title, article_content, article_image) VALUES (?, ?, ?)');
$query -> bindValue(1, $title);
$query -> bindValue(2, $content);
$query -> bindValue(3, $target_file);
$query -> execute();
header("location: index.php");
}
?>
<?php
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="../../style/main_style.css">
<title>CMS - Content Management System</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" id="navbar-mycolor">
<a class="navbar-brand" href="../index.php"><i class="fas fa-user-astronaut mr-2"></i>SYSCOMz</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link ml-3" href="../index.php"><i class="fas fa-home"></i> Home <span
class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link ml-3" href="index.php"><i class="fas fa-users-cog"></i> Admin</a>
</li>
<li class="nav-item">
<a class="nav-link active ml-3" href="add.php"><i class="fas fa-plus"></i> Add Article</a>
</li>
<li class="nav-item">
<a class="nav-link ml-3" href="logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-lg-6 col-sm-12">
<h1 class="lead mt-5 mb-3"><i class="fas fa-plus-circle"></i> Add Article</h1>
<?php if(isset($error)) { ?>
<small style="color:#aa0000"><?php echo $error; ?></small>
<br><br>
<?php } ?>
<form class="form-group" action="add.php" method="post" autocomplete="off" enctype="multipart/form-data">
<input class="form-control text-white" type="text" name="title" placeholder="Title" id="input-mycolor">
<br><br>
<textarea class="form-control text-white" rows="10" placeholder="Content" name="content"
id="input-mycolor"></textarea>
<br><br>
<label class="lead"><small>Select image to upload:</small></label>
<input class="form-control p-1 text-white" type="file" name="fileToUpload" value="Add Image"
id="input-mycolor">
<br><br>
<input class="btn btn-success" type="submit" name="submit" value="Add Article">
</form>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row text-muted bg-dark footer p-3 mt-5" id="footer-mycolor">
<div class="col-lg-3 col-sm-12 pl-4 mb-4">
<h5 class="text-info mb-3"><i class="fas fa-calendar-alt"></i> Calendar</h5>
<?php include 'includes/calendar.php' ?>
</div>
<div class="col-lg-3 col-sm-12 pl-4 mb-4">
<h5 class="text-danger mb-3"><i class="far fa-thumbs-up"></i> Social Links</h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-linkedin"></i><a class="text-white ml-1"
href="https://www.linkedin.com/in/borislav-dostumski/" target="_blank">LinkedIn</a></h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-github"></i><a class="text-white ml-1"
href="https://github.com/bdostumski" target="_blank">GitHub</a></h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-youtube"></i><a class="text-white ml-1"
href="https://www.youtube.com/channel/UC3boJA-8Mt1nYtTfuBRigrg" target="_blank">YouTube</a></h5>
</div>
<div class="col-lg-6 col-sm-12 pl-4">
<h5 class="text-warning mb-3"><i class="fas fa-at"></i> Contact Form</h5>
<form method="post" action="includes/phpemail.php">
<div class='row'>
<div class="col-lg-4 col-sm-12">
<input name="name" type="text" class="form-control mb-2 bg-dark text-white" placeholder="Name"
id="input-mycolor">
</div>
<div class="col-lg-4 col-sm-12">
<input name="subject" type="text" class="form-control mb-2 bg-dark text-white" placeholder="Subject"
id="input-mycolor">
</div>
<div class="col-lg-4 col-sm-12">
<input name="email" type="email" class="form-control mb-2 bg-dark text-white" placeholder="Email"
id="input-mycolor">
</div>
<div class="col-lg-12 col-sm-12">
<textarea name="message" class="form-control mb-3 bg-dark text-white" placeholder="Message" rows="5"
id="input-mycolor"></textarea>
<button name="submit" type="submit" class="btn btn-outline-warning">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
</body>
</html>
<?php
} else {
header("Location: index.php");
}
?>
\ No newline at end of file
<?php
session_start();
include_once('includes/connection.php');
include_once('includes/myarticle.php');
$article = new Article;
if(isset($_SESSION['logged'])) {
if(isset($_POST['yesBtn'], $_POST['delete_id'])) {
$id = $_POST['delete_id'];
$query = $pdo -> prepare('DELETE FROM articles WHERE article_id=?');
$query -> bindValue(1, $id);
$query -> execute();
header("Location: index.php");
}
if(isset($_POST['canselBtn'])) {
header("Location: index.php");
}
$articles = $article->fetch_all();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="../../style/main_style.css">
<title>CMS - Content Management System</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" id="navbar-mycolor">
<a class="navbar-brand" href="../index.php"><i class="fas fa-user-astronaut mr-2"></i>SYSCOMz</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link ml-3" href="../index.php"><i class="fas fa-home"></i> Home <span
class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link active ml-3" href="index.php"><i class="fas fa-users-cog"></i> Admin</a>
</li>
<li class="nav-item">
<a class="nav-link ml-3" href="add.php"><i class="fas fa-plus"></i> Add Article</a>
</li>
<li class="nav-item">
<a class="nav-link ml-3" href="logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<h1 class="lead mt-5 mb-3"><i class="far fa-trash-alt mr-1"></i> Delete Article</h1>
<div class="row">
<div class="col-lg-6 col-sm-12 d-flex justify-content-center bg-dark text-light rounded-lg"
id="article-main-mycolor" style="margin-bottom:120px;">
<form class="form-group" action="delete.php" method="post" autocomplete="off">
<h4 class="mt-5 mb-4">Do you want to delete this article!</h4>
<input class="form-control mb-5" type="text" name="delete_id" style="display:none;"
value="<?php echo $_GET['did'];?>">
<input type="submit" name="canselBtn" value="Cansel" class="btn btn-outline-primary ml-4 mb-5 ">
<input type="submit" name="yesBtn" value="Yes" class="btn btn-outline-danger ml-5 mb-5 pl-4 pr-4">
</form>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row text-muted bg-dark footer p-3 mt-5" id="footer-mycolor">
<div class="col-lg-3 col-sm-12 pl-4 mb-4">
<h5 class="text-info mb-3"><i class="fas fa-calendar-alt"></i> Calendar</h5>
<?php include 'includes/calendar.php' ?>
</div>
<div class="col-lg-3 col-sm-12 pl-4 mb-4">
<h5 class="text-danger mb-3"><i class="far fa-thumbs-up"></i> Social Links</h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-linkedin"></i><a class="text-white ml-1"
href="https://www.linkedin.com/in/borislav-dostumski/" target="_blank">LinkedIn</a></h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-github"></i><a class="text-white ml-1"
href="https://github.com/bdostumski" target="_blank">GitHub</a></h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-youtube"></i><a class="text-white ml-1"
href="https://www.youtube.com/channel/UC3boJA-8Mt1nYtTfuBRigrg" target="_blank">YouTube</a></h5>
</div>
<div class="col-lg-6 col-sm-12 pl-4">
<h5 class="text-warning mb-3"><i class="fas fa-at"></i> Contact Form</h5>
<form method="post" action="includes/phpemail.php">
<div class='row'>
<div class="col-lg-4 col-sm-12">
<input name="name" type="text" class="form-control mb-2 bg-dark text-white" placeholder="Name"
id="input-mycolor">
</div>
<div class="col-lg-4 col-sm-12">
<input name="subject" type="text" class="form-control mb-2 bg-dark text-white" placeholder="Subject"
id="input-mycolor">
</div>
<div class="col-lg-4 col-sm-12">
<input name="email" type="email" class="form-control mb-2 bg-dark text-white" placeholder="Email"
id="input-mycolor">
</div>
<div class="col-lg-12 col-sm-12">
<textarea name="message" class="form-control mb-3 bg-dark text-white" placeholder="Message" rows="5"
id="input-mycolor"></textarea>
<button name="submit" type="submit" class="btn btn-outline-warning">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<?php
} else {
header('Location: index.php');
}
?>
\ No newline at end of file
<?php
session_start();
include_once('includes/connection.php');
include_once('includes/myarticle.php');
include_once('upload.php');
if(isset($_SESSION['logged'])) {
if (isset($_POST['title'], $_POST['content'], $_POST['page_id'])) {
$title = $_POST['title'];
$content = nl2br($_POST['content']);
$id = $_POST['page_id'];
if(empty($title) or empty($content)) {
$error = "All fields are required!";
} else {
$query = $pdo -> prepare("UPDATE articles SET article_title=?, article_content=? WHERE article_id=?");
$query -> bindValue(1, $title);
$query -> bindValue(2, $content);
$query -> bindValue(3, $id);
$query -> execute();
header('location: index.php')
?>
<?php
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="../../style/main_style.css">
<title>CMS - Content Management System</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" id="navbar-mycolor">
<a class="navbar-brand" href="../index.php"><i class="fas fa-user-astronaut mr-2"></i>SYSCOMz</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link ml-3" href="../index.php"><i class="fas fa-home"></i> Home <span
class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link active ml-3" href="index.php"><i class="fas fa-users-cog"></i> Admin</a>
</li>
<li class="nav-item">
<a class="nav-link ml-3" href="add.php"><i class="fas fa-plus"></i> Add Article</a>
</li>
<li class="nav-item">
<a class="nav-link ml-3" href="logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-lg-6 col-sm-12">
<h1 class="lead mt-5 mb-3"><i class="far fa-edit"></i> Edit Article <?php echo $_GET['eid']; ?></h1>
<?php if(isset($error)) { ?>
<small style="color:#aa0000"><?php echo $error; ?></small>
<br><br>
<?php } ?>
<form class="form-group" action="edit.php" method="post" autocomplete="off">
<input class="form-control text-white" id="input-mycolor" type="text" name="page_id" style="display:none;"
value="<?php echo $_GET['eid'];?>">
<input class="form-control text-white" id="input-mycolor" type="text" name="title" placeholder="Title"
value="<?php echo $_GET['title'];?>">
<br><br>
<textarea class="form-control text-white" id="input-mycolor" rows="10" placeholder="Content"
name="content"><?php echo $_GET['content']; ?></textarea>
<br><br>
<input class="btn btn-success" type="submit" name="submit" value="Edit Article">
</form>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row text-muted bg-dark footer p-3 mt-5" id="footer-mycolor">
<div class="col-lg-3 col-sm-12 pl-4 mb-4">
<h5 class="text-info mb-3"><i class="fas fa-calendar-alt"></i> Calendar</h5>
<?php include 'includes/calendar.php' ?>
</div>
<div class="col-lg-3 col-sm-12 pl-4 mb-4">
<h5 class="text-danger mb-3"><i class="far fa-thumbs-up"></i> Social Links</h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-linkedin"></i><a class="text-white ml-1"
href="https://www.linkedin.com/in/borislav-dostumski/" target="_blank">LinkedIn</a></h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-github"></i><a class="text-white ml-1"
href="https://github.com/bdostumski" target="_blank">GitHub</a></h5>
<h5 class="text-white ml-4 mt-4"><i class="fab fa-youtube"></i><a class="text-white ml-1"
href="https://www.youtube.com/channel/UC3boJA-8Mt1nYtTfuBRigrg" target="_blank">YouTube</a></h5>
</div>
<div class="col-lg-6 col-sm-12 pl-4">
<h5 class="text-warning mb-3"><i class="fas fa-at"></i> Contact Form</h5>
<form method="post" action="includes/phpemail.php">
<div class='row'>
<div class="col-lg-4 col-sm-12">
<input name="name" type="text" class="form-control mb-2 bg-dark text-white" placeholder="Name"
id="input-mycolor">
</div>
<div class="col-lg-4 col-sm-12">
<input name="subject" type="text" class="form-control mb-2 bg-dark text-white" placeholder="Subject"
id="input-mycolor">
</div>
<div class="col-lg-4 col-sm-12">
<input name="email" type="email" class="form-control mb-2 bg-dark text-white" placeholder="Email"
id="input-mycolor">
</div>
<div class="col-lg-12 col-sm-12">
<textarea name="message" class="form-control mb-3 bg-dark text-white" placeholder="Message" rows="5"
id="input-mycolor"></textarea>
<button name="submit" type="submit" class="btn btn-outline-warning">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
</body>
</html>
<?php
} else {
header("Location: index.php");
}
?>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Display inline</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function () {
$("#datepicker").datepicker();
});
</script>
<style type="text/css">
@media only screen and (max-width: 600px) {
#datepicker>div {
width: 270px;
}
}
</style>
</head>
<body>
<div id="datepicker"></div>
</body>