Sensation Energy


United CMS

Documentation

Introduction

What is United CMS ?

United CMS is File Flat Content Management System which facilitated the creation of web pages.

United CMS is open source

United CMS is MIT Licence

Installation

You must first download and install an XAMP, WAMP, or LAMP server with a Mysql database on your computer. After installing the server, download energycms.zip from the server, unpack it in the folder: XAMP - HTTP, WAMP - WWW as in Figure 1.

Once you have installed the "xampp" server or "wamp", download the UNITED CMS and move it to the "htdocs" or "www" directory.

File Flat Database

The File Flat database is based on "JSON". Data is stored there in a defined form.

JSON database layout - "Blog"


  [
      {
          "id": "1823",
          "title": "radiiiiiiiiiii",
          "subject": "proba",
          "date": "2020-10-05",
          "cat_id": "1482",
          "user": "vlada"
      },
      {
          "id": 669,
          "cat_id": "697",
          "user": "vladimir",
          "title": "Sensation Energy",
          "subject": "Test test",
          "date": "2020-11-13"
      },
      {
          "id": 343,
          "cat_id": "807",
          "user": "vladimir",
          "title": "Ovo je proba",
          "subject": "sdfytghdgh",
          "date": "2020-11-13"
      }
  ]

Run CMS

In your browser enter the following url address:

http://localhost/united_cms

Tt will open page index.php page will, where you should login, or you can go to the REGISTRED page where you will register, then return to the index.php page where you will login.

Login

  
<form action="login.php" method="post">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" name="user"  class="form-input" />
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" name="password" class="form-input" />
</div>
<div class="btn-group">
<button type="submit" name="prijava" class="btn-3" >POST</button>
</div>
</form>

Settings

Settings allows you to change names:

  • Title
  • Slogan
  • Footer

Title, Slogan and Footer we place it in the desired place. It is recommended in the header "Title", "Futer" in footer, the slogan below the header. These are just examples.

You can make the change by going to the setting page in the admin dashboard and changing the values and pressing the "EDIT" button. So the data was exchanged.

Example Title, Slogan and Footer


<?php
$ur = file_get_contents('settings.json');
$se = json_decode($ur,true);
foreach($se  as $se)  {
<?php echo $se['title']; ?>
<?php echo $se['slogan']; ?>
<?php echo $se['footer']; ?>
}
?>

settings.json


  [
      {
          "title": "United Cms",
          "slogan": "Admin",
          "footer": "United Cms"
      }
  ]

settings.php

Changing the bottom of the setting is done in the same way as with changes in the blog, user,... Only it does not go through the "ID".


<?php
//We take the data from the settings
$u = file_get_contents('../settings.json');
$se = json_decode($u,true);
//This is done via the "foreach" calsical method because we do not take "ID"
foreach($se  as $se)  {
?>
<div align="center">
<h2>Edit Category</h2>
</div>
//Form where the data to be modified is located
<form action="" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="title"><h2>Title</h2></label>
<input type="text" class="form-input" name="title" value="<?php echo $se['title'] ?>">
</div>
<div class="form-group">
<label for="title"><h2>Slogan</h2></label>
<input type="text" id="user" class="form-input" name="slogan"   value="<?php echo $se['slogan']; ?>">
</div>
<div class="form-group">
<label for="title"><h2>Footer</h2></label>
<input type="text" id="footer" class="form-input" name="footer"   value="<?php echo $se['footer']; ?>">
</div>
<br>
<div align="center">
<input type="submit" class="btn-2" name="save" value="Edit">
</div>
</div>
</form>
<?php
}
if(isset($_POST['save'])){
$input = array(
'title' => $_POST['title'],
'slogan' => $_POST['slogan'],
'footer' => $_POST['footer'],
);
//The only difference here is that here we do not work directly id but directly and that is why we have "$data_array[$title] = $input;" here instead of "$data_array[$id] = $input;"
$data_array[$title] = $input;
$data_array = array_values($data_array);
$data = json_encode($data_array, JSON_PRETTY_PRINT);
file_put_contents('../settings.json', $data);
header('location: settings.php');
}
?>

Download on github


Content


Documentation


Answer the following question:

You must be logged in


Chapters


1. Chapter: FrontEnd Page (Blog & Category)

2. Chapter: BackEnd Page (Admin dashboard)

3.
Chapter: User profile

4.
Chapter: JSON Database


Advertising