Click here to expand content list.
”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.
Released under the MIT license.
MIT: http://rem.mit-license.org, see LICENSE.
This script can be run on servers that support PHP and MySQL.
- Login system based on sessions.
- Password encryption.
- Full CRUD functionality for the admin.
- Responsive design.
- Form validation.
- Pagination.
- Refactored code to apply object oriented structure along with removed deprecated methods.
- Added support for responsive layout.
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:
-
Copy the SQL code in the file "SQL.sql" and execute it to your MySQL supported database.
-
Open the file “database.php” in the folder “config” and re-save the file with to your database credentials.
-
Upload the folder “News2.0” to your PHP supported server and navigate to the page “create_user.php” to create your admin login credentials.
-
Login with your created admin credentials to be able to start managing news.
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');
}
?>
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