Skip to content

Latest commit

 

History

History
70 lines (43 loc) · 2.87 KB

README.md

File metadata and controls

70 lines (43 loc) · 2.87 KB

Simple Blog System

I wrote the base for this in a couple of days, and slowly extended it more over time. I needed a progress blog for school to show what I have done in the class. A few other students made an account here too.

Here is that website if you would like a live demo

Features

  • Register & login
  • Email verification
  • New Post
  • View Post
  • View all of a user's posts
  • Edit Posts
  • Delete Posts
  • Recent post feed

Libraries Used

To speed up the development process and to make it a lot easier to work with I utilized some PHP Libraries:

bramus/router - PHP Routing

sergeytsalkov/meekrodb - Super easy and simple database tool

phpmailer/phpmailer - Rich mail sender library

twigphp/twig - Rich templating library

For post editing I used CKEditor 4

How-to setup

If you would like to use it for your own, you're welcome to.

Requirements:

  • PHP 5.3+ Server with Apache (If you use NGIX you need to use this web.config)
  • MySQL Database (With 3 tables setup with these structures)
  • A mail server on your PHP server (Or, you can change lines 183 - 205 in index.php to work with an external SMTP server)

To set up what database to use as well as username and password, you need to create a new file in inc/ called dbsetup.php

For obvious reasons, I have removed mine. An Example of this file would be:

<?php

require("_sec.php");

DB::$user = "username_here";
DB::$password = "password_here";
DB::$dbName = "database_name_here";

?>

At the moment, any account created will by default have rank 0. This means they can not make new posts, so you need to manually edit their rank in the mysql database.

Rank 0 = User

Rank 1 = Poster

Rank 2 = Administrator (Can Delete & Edit other's posts)

Security

For the most part I've tried to take out any <script> <style> or tags in any posts. However I have not tested this 100% for security so it may be unideal for public use and may be prone to attacks. Other than that, I have added a delay in which how fast a user can post or do any action. Right now it is 300 seconds for new posts and 20 for editing posts and you may change it on lines 325 (new posts) and 439 (editing posts) in index.php.