Sensation Energy


Energy CMS

Documentation

1. Run ENRGY CMS

Run ENRGY CMS as written in the installation, when you have installed it in the web browser you will see the site

Login

The login form is a plugin that allows login function. When you enter the username and password "admin / admin" you are automatically logged in and since you have the admin role you immediately go to the admin panel.

Register

The registration form is a plugin that allows the user to register. When he fills out the form, he automatically registers. Note every user who registers has a user role, and if you want to change the role, the admin must do it in the admin panel on the users page. There is no email verification in this plugin, but the user can log in immediately.

Admin panle

Admin panle is an integral part of the Energy CMS that enables various functionalities, settings, edits and editing on the CMS.

2. Admin setings

Admin seting used to adjust the admin panel. This means that the following can be changed or added:

  • Title
  • Description
  • Footer
  • Header
  • Logo
  • Analytic
  • Keywords
  • Seo

CRUD is used and the functions are done in a very simple way.

3. Site setings

As with admin setting, so with site setting used to adjust the admin panel. This means that the following can be changed or added:

  • Title
  • Description
  • Footer
  • Header
  • Logo

CRUD is used and the functions are done in a very simple way.

4. Users

Users enable me to:

  • Add
  • Edit
  • Delete
  • View

In the edit user function you can also:

  • change role (admin or user)
  • change status (0 - inactive or 1 - active)

inactive user (0) - user cannot log in or 1 - active user 1 - user can be login

5. Writteing

Writteing or blog is a page where admin lists what users write or comment on posts.

Writteing consists of three parts: Blog, Comments and Categories.

Blog it can be

  • View post
  • Edit post
  • Edit Status post (allow or not allow)
  • Delete post

Comments it can be

  • Delete comments

Category it can be

  • Add category
  • View category
  • Edit category
  • Delete category

6. Plugins

Plugins are used as add-ons (mini applications) that enable greater CMS functionality.

Plugins consist of three parts: 1. Create, 2. Upload and install, 3. Functions View, Edit, Delete, Upload.

A) Create plugin

Making a plugin is very simple. It is necessary to create a folder and necessarily indes.php as well as install.php, after that and other components that you need.

Required values that install.php should have when creating:

  • user - $_SESSION["korisnik"] - that is, the logged in admin that installs
  • title - $name Name of plugin
  • status - yes or no
  • position - position on which side the plugin is located left or center or right
  • function - does it have a function example login.php
  • install - 1 or 0
  • admin - whether it is necessary to add functionality to the admin panel

Example of install.php


<?php
// session start and conection with database
session_start();
require '../../../conection.php';
// name of folder (plugins)
$name=$_GET['name'];
//floder where the installation folder will be located
$folder = array_filter(glob('*'), 'is_dir');
foreach($folder as $name)
//name of plugin
$title=$_POST['title'];
// insert table in database for your plugin
$sql = "INSERT INTO plugins (user,title,status,position,function,install,admin)  VALUES ('{$_SESSION["korisnik"]}','{$name}','no','center','registracija.php','1','yess')";
if (mysqli_query($conection, $sql)){
$sql = "CREATE TABLE contact (
id int(11) AUTO_INCREMENT,
EMAIL varchar(255) NOT NULL,
user varchar(255) NOT NULL,
title varchar(255) NOT NULL,
PRIMARY KEY  (id)
)";
//if add is ok install.php is deleted and automatically cheated on the plugin side
echo "Add is ok.";
unlink('install.php');
} else {
//if add is not ok error
echo "Error";
}
?>

Example of index.php

Clasic form for registration


<form action="function.php" method="POST" role='form' id="register-form">
<div class="form-group">
<input type="text" name="name" class="form-input" tabindex="1" placeholder="First name" required="true">
</div>
<div class="form-group">
<input type="password" name="password"  class="form-input" tabindex="1" placeholder="Password" required="true">
</div>
<div class="btn-group">
<button class="btn-3" type="submit" name="submit">Register</button>
</div>
</form>

Example of function.php


<?php
//conection with database
require '../../../conection.php';
// the body of your function, whether it will be insert or select it depends on yours what you want to do.
?>

Of course you can add other functionalities you need for your plugin.

B) Upload and install

When you have created your plugin, you need to create a zip file and go to the "Upload Zip File" button and refresh that page, then your plugin will appear in the Install table and then you can install your plugin by clicking Install.

C) Functions View, Edit, Delete, Upload

Functions View, Edit, Delete, Upload allows in the table Installed and Install to:

Installed table

  • View - view all files in folder
  • Edit- edit name files in folder
  • Delete - delet plugin
  • Upload - upload file in folder, if you forgot something, then you need to add
  • Button Upload Zip File - form for upload zip (your plugin) file

    Install table

    • Install - install serves to install your plugin

    Plugins under right slider are plugins which have a function (CRUD). An example is Contact, where the user enters his contact information, and the admin panel does the EDIT or DELETE function.

    Adding plugins on admin right slider is done by when you create a plugin put the option to have admin and you will automatically be shown your plugin in the admin panel after installation.

7. Template

Template it allows us to look at FrontEnd

Template consist of three parts: 1. Create, 2. Upload and install, 3. Functions Preview, View, Edit, Delete, Upload.

A) Create template

Create template is very simple. Take ready-made templates from the Basic Front Template or from the Grid system Sensation Framework frontend at the addresses: Grid or Basic template and in any editor you can edit and customize to your needs.

You can, if you wish, create a template as a blog, arranged with one or two columns or three. The most important thing is to complete the next steps, because that is the standard for creating a template.

Exmaple and standard for create template (index.php)

Note when creating templates you need to create two sub folders CSS and JS where you will place css and javascript, and then call them to the front.


<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
// Title name
<title><?php echo $se['title']; ?></title>
//The CSS name associated with is defined here template.
<link rel="stylesheet" href="theme/<?php echo $th['title']; ?>/css/<?php echo $th['css']; ?>">
</head>
<body>
<div class="header">
//header name
<h1>  <?php echo $se['header']; ?></h1>
</div>
<?php
// Menu
echo'<nav>';
echo'<ul>';
$sql="SELECT * FROM menu ORDER BY position";
$r=mysqli_query($povezivanje,$sql);
while($row=mysqli_fetch_assoc($r)){
$id=$row['id'];
$title=$row['title'];
$url=$row['url'];
?>
<li><a href="<?php echo $url ?>"><?php echo $title ?></a>
//submenu
<?php
echo "<ul>";
$sql1="SELECT * FROM menu JOIN sub ON menu.id=sub.s_id where s_id='$id'";
$m=mysqli_query($povezivanje,$sql1);
while($row1=mysqli_fetch_assoc($m)){
$parent_id=$row1['parent_id'];
$url=$row1['url'];
$title=$row1['title'];
$s_id=$row1['s_id'];
echo "<li><a href='$url'>".$title."</a></li>";
}
echo "</ul>";
echo "</li>";
//pages
$sql="SELECT * FROM pages JOIN menu ON pages.st_id=menu.id where id='$id'";
$result=mysqli_query($povezivanje,$sql);
while($row3=mysqli_fetch_object($result))
{
echo '<li><a href="test_s.php?st_id='.$row3->st_id.'">'.$row3->naslov.'</a></li>';
}
}
echo'</nav> ';
?>
<br>
<div class="sekcija2 grupa2">
<div class="colona2 raspon_1_of_2">
<div align="center">
<h2>Left</h2><br>
</div>
//This is a function for plugins that should stand LEFT
<?php
if (empty(levo())) {
}else {
levo();
}
?>
</div>
<div class="colona2 raspon_1_of_2">
//This is a function for plugins that should stand CENTER
<div align="center">
<h2>Center</h2><br>
</div>
<?php
if (empty(centar())) {
}else {
centar();
}
?>
</div>
<div class="colona2 raspon_1_of_2">
This is a function for plugins that should stand RIGHT
<div align="center">
<h2>Right</h2><br>
</div>
<?php
if (empty(desno())) {
}else {
desno();
}
?>
</div>
</div>
<br>
//footer name
<div class="footer">
<?php echo $se['footer']; ?>
<?php echo date("Y");?>. All Rights Reserved.
</div>
</body>
</html>

This is for creating a front template.

B) Upload and install

Once you have created the template and inserted it into the ZIP folder, then in the admin panel you go to the Upload Zip File button where the form will open and you should upload your template there. If you did well then you will be piajvited in the table Install. If you want to install yours in the template and activate it, you first need to go to the install button, in order for your template to be installed and appear in the Installed table, and then you need to press the Active theme button where the form will open and there you select your template and then your template will appear on the front.

C) Functions Preview, View, Edit, Delete, Upload

Functions in templae consists of:

Button Active theme - form for active theme

Installed table

  • Preview - preview tour template
  • View - view all files in folder
  • Edit- edit name files in folder
  • Delete - delet plugin
  • Upload - upload file in folder, if you forgot something, then you need to add

Button Upload Zip File - form for upload zip (your template) file

Install table

  • Install - install serves to install your template

9. Pages

Pages serves to manage apartments on FrontEnd.

There are also add, dedit view and delete functions here as well. When you add a page you can make it.

Creating a page can be usually entering titles and text or it can be entering titles and HTML CODE.

Example insert HTML CODE for ADD or EDIT page


<!DOCTYPE html>
<html lang="en">
<head>
<title>Sensation Energy</title>
<link rel="shortcut icon" href="http://www.sensationenergy.com/favicon.ico" type="image/x-icon" />
<meta charset="UTF-8">
<style>
body {
background-color: white;
color: green;
font-family: Arial;
}
.se{
background-color: yellow;
color: red;
border: 2px solid  green;
}
</style>
</head>
<body>
<div class="se">
<h1>My Website</h1>
<p>A <b>responsive</b> website created by Sensation Energy.</p>
</div>
</body>
</html>

Function VIEW, EDIT and Delite are clasic function for EDIT page, VIEW page and DELETE page. Also the EDIT of the page can be just entering the title and text or entering the title and copying the HTML CODE


Content


Documentation


Answer the following question:

You must be logged in


Advertising