Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
css
 
 
 
 
js
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

php-user

A blog post system using PHP and MYSQL

Features

  • Log in/out with password
  • Mobile responsive
  • Cached drafts
  • Paging
  • Comments
  • Editing for owners
  • API for articles

Rules

  • Users have to log in to post/comment
  • Topics/contents have to be long enough
  • Only owners can edit

APIs

Working on url rewrite with mod_rewrite module but failing.

  • /api.php?request=post&number=all
    Retrieve all article objects in json array
  • /api.php?request=post&number={articleId}
    Retrieve article object with id 'articleId'

Database Structures

  1. Auth:
+--------------+-------------+------+-----+---------+----------------+
| Field        | Type        | Null | Key | Default | Extra          |
+--------------+-------------+------+-----+---------+----------------+
| id           | int(11)     | NO   | PRI | NULL    | auto_increment |
| username     | varchar(20) | YES  |     | NULL    |                |
| passwordhash | varchar(50) | YES  |     | NULL    |                |
+--------------+-------------+------+-----+---------+----------------+
  1. Post:
+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| id        | int(11)      | NO   | PRI | NULL    | auto_increment |
| topic     | varchar(255) | YES  |     | NULL    |                |
| content   | longtext     | YES  |     | NULL    |                |
| author    | tinytext     | YES  |     | NULL    |                |
| post_time | tinytext     | YES  |     | NULL    |                |
+-----------+--------------+------+-----+---------+----------------+
  1. Comment:
+-----------+----------+------+-----+---------+----------------+
| Field     | Type     | Null | Key | Default | Extra          |
+-----------+----------+------+-----+---------+----------------+
| id        | int(11)  | NO   | PRI | NULL    | auto_increment |
| articleId | int(11)  | NO   |     | NULL    |                |
| author    | tinytext | YES  |     | NULL    |                |
| content   | longtext | YES  |     | NULL    |                |
| post_time | tinytext | YES  |     | NULL    |                |
+-----------+----------+------+-----+---------+----------------+

Next Steps

  • Delete posts for owners
  • Make log in/out prettier
  • Make pagination prettier
  • Add some JS animations
  • Move log in/out to main page
  • Different authorization levels for users
  • APIs for articles, comments and users

About

A blog post system using PHP and MYSQL

Resources

Releases

No releases published

Packages

No packages published