Skip to content

Latest commit

 

History

History
97 lines (67 loc) · 3.3 KB

README.md

File metadata and controls

97 lines (67 loc) · 3.3 KB

Table of contents

Click here to expand content list.
  1. General information
  2. License
  3. System requirements
  4. Supported features
  5. User interface
  6. Setup guide
  7. Contact details

1 General information

”News 2.0" was created in Sublime by Annice Strömberg (Annice.se), 2019. It is a simple WCM (Web Content Management) script that can be used to post news articles on a web page with full CRUD support for an admin user. Furthermore, the code is based on HTML5, CSS3, PHP and MySQL.


2 License

Released under the MIT license.

MIT: http://rem.mit-license.org, see LICENSE.


3 System requirements

This script can be run on servers that support PHP and MySQL.


4 Supported features

  • Login system based on sessions.
  • Password encryption.
  • Full CRUD functionality for the admin.
  • Responsive design.
  • Form validation.
  • Pagination.

4.1 Changes to version 2.0:

  • Refactored code to apply object oriented structure along with removed deprecated methods.
  • Added support for responsive layout.

5 User interface

Screenshot of the start page to display the latest news visible for anonymous users:

Screenshot of the admin page to create news in desktop vs. responsive view:

Screenshot of the admin page to get an overview of the news articles to edit or delete in desktop vs. responsive view:

Screenshot of the admin page in desktop vs. responsive view to edit admin details:


6 Setup guide

  1. Copy the SQL code in the file "SQL.sql" and execute it to your MySQL supported database.

  2. Open the file “database.php” in the folder “config” and re-save the file with to your database credentials.

  3. Upload the folder “News2.0” to your PHP supported server and navigate to the page “create_user.php” to create your admin login credentials.

  4. Login with your created admin credentials to be able to start managing news.

6.1 Code snippets

The following code can be put on any page to display the latest news - as long as the page is saved with the file extension “.php”. The default setting is to display the 10 latest entries, but you can modify this number in the "news_entries.php" file:

<?php include "news_entries.php"; ?>

You can also create new admin-protected pages by placing the following code at the top of each page file you want protected:

<?php
session_start();
if (!isset($_SESSION['user'])) {
    header('Location: login.php');
}
?>

7 Contact details

For general feedback related to this script, such as any discovered bugs etc., you can contact me via the following email address: info@annice.se