This section is specially designed for GetSimple CMS and is dedicated to various developments on this engine.
Installation of the CMS is quite simple: unpack the archive into the desired hosting folder, open this folder in a browser, follow the further instructions of the engine installer.
The engine configuration is located in the gsconfig.php, file , the root directory of the site. The settings are done by manually changing the PHP constants of the file (to enable the parameter, you must remove the hash # symbol).
# define('GSLOGINSALT', 'your_unique_phrase');
# define('GSUSECUSTOMSALT', 'your_new_salt_value_here');
define('GSIMAGEWIDTH', '300');
# define('GSADMIN', 'admin');
# define('GSDEBUG', TRUE);
# define('GSDONOTPING', 1);
# define('GSNOCSRF', TRUE);
# define('GSCHMOD', 0755);
# define('GSDOCHMOD',false);
# define('GSCANONICAL', 1);
# define('GSNOUPLOADIFY', 1);
# define('GSEDITORHEIGHT', '400');
# define('GSEDITORTOOL', 'advanced');
define('GSEDITOROPTIONS', '');
# define('GSEDITORLANG', 'en');
define('GSFROMEMAIL', 'no-replay@'.$_SERVER['HTTP_HOST']);
# define('GSAUTOSAVE', 900);
# define('GSEXTAPI', 1);
setlocale(LC_ALL, 'ru_RU.UTF8', 'ru.UTF8', 'ru_RU.UTF-8', 'ru.UTF-8', 'ru_RU', 'ru');
# define('GSNOCDN', true);
# define('GSNOHIGHLIGHT', true);
# define('GSTIMEZONE', 'Europe/Moscow');
define('SUPPRESSERRORS', true);
define('GSNOAPACHECHECK', true);
define('GSNOVERCHECK', true);
# define('GSSTYLE', GSSTYLE_SBFIXED);
# define('GSSTYLE', GSSTYLEWIDE);
# define('GSSTYLE', implode(',', array(GSSTYLEWIDE,GSSTYLE_SBFIXED)));
# define('GSNOSITEMAP', true);
# define('I18N_SINGLE_LANGUAGE', true);
# define('I18N_IGNORE_USER_LANGUAGE', true);
# define('GSAUTOMETAD', true);
# define('GSMERGELANG', false);
# define('GSNOFRAME', GSBOTH);
# define('GSFORMATXML', true);
# define('GSUPLOADSLC', false);
To use plugins, unpack the resulting archive into the plugins, folder of the site , in the admin panel go to the "Plugins" section and enable the plugin you need..
<?php c_calendarMini(); ?>
Code of the list of events of the current month (you do not need to specify on the page selected for displaying messages - the list is already there):<?php c_calendarEvents(); ?>
Link to download{% component_name %}
Where component_name is the name of the component.<?php
global $args;
echo $args[0];
?>
And using the code:{% component_name "param 0" %}
As a result, param 0 will be displayed on the page.<meta name="robots" content="noindex, nofollow">
Link to download$xml = exec_filter('sitemap',$xml); // patch
The code must be inserted between lines 61 and 62 (in i18n version 3.2.8), before that:XMLsave($xml, $file);
Link to download<?php
/*$mainp = return_i18n_pages()['index']['title'];*/
$mainp = '<i class="pe-7s-home"></i>';
get_breadcrumbs(return_page_slug(),$mainp);
?>
The result of the execution will be something like this:
<ul class="breadcrumb">
<li><a href="https://example.com/" title="Main"><i class="pe-7s-home"></i></a></li>
<li><a href="https://example.com/index/parent/" title="Parent">Parent</a></li>
<li class="active">Modern</li>
</ul>
Link to download<?php if (function_exists('sc_mail')) { sc_mail(); } ?>
<?php if (function_exists('sc_form')) { sc_form(); } ?>
.CodeMirror, .CodeMirror-scroll {height: auto; max-height: 500px;}
Link to download<!-- Otzivy Start -->
<div class="product-section section pt-70">
<div class="container">
<!--div class="section-title text-center mb-50">
<h2>Reviews about our work</h2>
</div-->
<?php get_gstbook('otzyvy') // Where otzyvy is the page link, can be replaced with $slug ?>
</div>
</div>
<!-- Otzivy End -->
Link to download / Demo<?php
GZipIt::buff_end('check', true); // Shows the level and name of output buffering
GZipIt::buff_end('GZipIt::sanitize_output'); // Flushes the buffer by name from the final level
/* HTML content uncompressed */
GZipIt::buff_start('sanitize_output', 'GZipIt'); // Re-creates the buffer by the name of the function and class
/* HTML content with compression */
?>
Link to download<?php if(class_exists('opiums_contact')) opiums_contact::form(); ?>
Link to download / DemoComponents are editable containers of code that can be added to a theme template or editor (using the DynPages plugin). Components can contain both plain text and HTML tags, JS scripts and PHP code. Additional information can be viewed on the GetSimple CMS Russian website.
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,600);
.simpleslider {
background: #58DDAF;
color: #2a2a2a;
}
.simpleslider {
margin: 0;
padding: 0;
font-family: 'Open Sans';
}
.simpleslider h1 {
color: #fff;
text-align: center;
font-weight: 300;
}
.simpleslider #slider {
position: relative;
overflow: hidden;
margin: 20px auto 0 auto;
border-radius: 4px;
}
.simpleslider #slider ul {
position: relative;
margin: 0;
padding: 0;
height: 200px;
list-style: none;
}
.simpleslider #slider ul li {
position: relative;
display: block;
float: left;
margin: 0;
padding: 0;
width: 500px;
height: 300px;
background: #ccc;
text-align: center;
line-height: 300px;
}
.simpleslider a.control_prev, a.control_next {
position: absolute;
top: 40%;
z-index: 999;
display: block;
padding: 4% 3%;
width: auto;
height: auto;
background: #2a2a2a;
color: #fff;
text-decoration: none;
font-weight: 600;
font-size: 18px;
opacity: 0.8;
cursor: pointer;
}
.simpleslider a.control_prev:hover, a.control_next:hover {
opacity: 1;
-webkit-transition: all 0.2s ease;
}
.simpleslider a.control_prev {
border-radius: 0 2px 2px 0;
}
.simpleslider a.control_next {
right: 0;
border-radius: 2px 0 0 2px;
}
.simpleslider .slider_option {
position: relative;
margin: 10px auto;
width: 160px;
font-size: 18px;
}
</style>
<div class='simpleslider'>
<h1>Incredibly Basic Slider</h1>
<div id='slider'>
<a href='#' class='control_next'>></a>
<a href='#' class='control_prev'><</a>
<ul>
<li>SLIDE 1</li>
<li style='background: #aaa;'>SLIDE 2</li>
<li>SLIDE 3</li>
<li style='background: #aaa;'>SLIDE 4</li>
</ul>
</div>
<div class='slider_option'>
<input type='checkbox' id='checkbox'>
<label for='checkbox'>Autoplay Slider</label>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script>
jQuery(document).ready(function($){
$('#checkbox').change(function(){
setInterval(function(){
moveRight();
}, 3000);
});
var slideCount = $('#slider ul li').length;
var slideWidth = $('#slider ul li').width();
var slideHeight = $('#slider ul li').height();
var sliderUlWidth = slideCount * slideWidth;
$('#slider').css({ width: slideWidth, height: slideHeight });
$('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth });
$('#slider ul li:last-child').prependTo('#slider ul');
function moveLeft(){
$('#slider ul').animate({
left: + slideWidth
}, 200, function(){
$('#slider ul li:last-child').prependTo('#slider ul');
$('#slider ul').css('left', '');
});
};
function moveRight(){
$('#slider ul').animate({
left: - slideWidth
}, 200, function(){
$('#slider ul li:first-child').appendTo('#slider ul');
$('#slider ul').css('left', '');
});
};
$('a.control_prev').click(function(e){
moveLeft();
e.preventDefault();
});
$('a.control_next').click(function(e){
moveRight();
e.preventDefault();
});
});
</script>
In the site template, in the place intended for the slider, add the component code (the code is case-sensitive):<?php get_component('simpleslider'); ?>
Or use the DynPages plugin, then add a line to your editor (the code is case sensitive):{% simpleslider %}
After saving the template or article, you can see the result.<?php $mainp = 'index'; ?>
<li<?php if($item->current=='1' && $item->slug!=$mainp) echo ' class="active"'; ?>>
<a href="<?=htmlspecialchars($item->link)?>">
<?php if($item->slug==$mainp) echo '<i class="pe-7s-menu"></i> '; ?>
<?=htmlspecialchars($item->text)?>
</a>
<?php if($item->isOpen){ ?>
<ul<?php if($item->slug==$mainp) echo ' class="mega-menu"';?>><?php $item->outputChildren(); ?></ul>
<?php } ?>
</li>
menu-footer:<li><a href="<?=htmlspecialchars($item->link)?>"><?=htmlspecialchars($item->text)?></a></li>
To customize the menu, the header and footer of the site have been added:<nav class="main-menu text-center"><ul><?php get_i18n_navigation(return_page_slug(),0,1,I18N_SHOW_MENU, 'menu'); ?></ul></nav>
<div class="footer-nav"><ul><?php get_i18n_navigation(return_page_slug(),0,1,I18N_SHOW_MENU, 'menu-footer'); ?></ul></div>
The result will be a customized custom menu on the site and in the footer.ДлFor other necessary information, use one of the resources in the Russian Internet: GetSimple CMS Russian / Forum. Or: GetSimple CMS / Forum.
@import url(css/font-awesome/font-awesome.css);
@import url(css/bootstrap.css);
@import url(css/style.css);
@import url(css/responsive.css);
# WYSIWYG editor settings, uncomment the line below (advanced, basic or [custom config])
# define('GSEDITORTOOL', 'advanced');
# WYSIWYG editor options
$websitefilepath = $_SERVER['DOCUMENT_ROOT'].'/data/other/website.xml';
if(file_exists($websitefilepath)) {
$currentheme = simplexml_load_file($websitefilepath, 'SimpleXMLElement', LIBXML_NOCDATA);
$currentemplate = $currentheme->TEMPLATE;
if(file_exists($_SERVER['DOCUMENT_ROOT'].'/theme/'.$currentemplate.'/ckeditor.css'))
define('GSEDITOROPTIONS',"basicEntities:true,extraPlugins:'nbsp,youtube,html5audio,video,wenzgmap,codesnippet,codemirror,oembed', contentsCss: '/theme/".$currentemplate."/ckeditor.css'");
else define('GSEDITOROPTIONS',"basicEntities:true,extraPlugins:'nbsp,youtube,html5audio,video,wenzgmap,codesnippet,codemirror,oembed'"); # chart
}else define('GSEDITOROPTIONS',"basicEntities:true,extraPlugins:'nbsp,youtube,html5audio,video,wenzgmap,codesnippet,codemirror,oembed'"); # chart
# WYSIWYG toolbars (advanced, basic or [custom config])
define('GSEDITORTOOL', "['Bold','Italic','Underline','Strike','Subscript','Superscript','NumberedList','BulletedList','JustifyCenter','JustifyRight','JustifyBlock','HorizontalRule','Table','Link','Unlink','Anchor','Image','Blockquote','CreateDiv','PasteFromWord','Undo','Redo'],'/',['Styles','Format','FontSize','TextColor','BGColor','oembed','Video','Html5audio','Iframe','wenzgmap','CodeSnippet','RemoveFormat','Source']"); # Chart
# Language of the WYSIWYG editor (default en), uncomment the line below if you want the language to be different from the language selected when installing the CMS
# define('GSEDITORLANG', 'en');
Engine security issues are of concern to many. Although the CMS does not use the database, there is some chance of being attacked by hackers and losing access to the site. Below we will consider ways to protect your site from hacking.
This file is used by the Apache web server and one of its functions is to restrict access. The Deny from all line denies access to all files and directories in the current folder of the web server.
A file with similar functionality, in a different language, is used by the IIS web server. To restrict access to files, you can use the following example (web.config must be at the root of the site)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="RestrictDataOther" path="/data/other/*" verb="*" type="System.Web.HttpForbiddenHandler" />
</handlers>
...
</system.webServer>
</configuration>
The above code denies access to the directory in the URL /data/other/... from the site root, if you specify path="/data/other/*.xml", then all files with the xml extension in this and subsequent directories will be blocked.
To enable additional encryption of cookies, you can use the GSLOGINSALT constant in the configuration file:
define('GSLOGINSALT', 'your_unique_modifier');
When enabled GSLOGINSALT modifies the hash of the cookie (it is saved on the computer when logged into the admin panel) and makes it difficult to decrypt.
Each time the CMS is installed using the API, the system receives an absolutely unique hash modifier ("salt"). Using the GetSimple API is optional, you can apply your own modifier as well.
This modifier ("salt"), created by the user or by default, is used to protect against XSS attacks and provides verification when uploading files to the server. To enable your own modifier, you must use the GSUSECUSTOMSALT constant:
define('GSUSECUSTOMSALT', 'your_unique_salt_modifier');
To get unique values of constants, you can use the link: http://get-simple.info/api/security/.
For added security, you can change the name of the control panel folder to something else using the GSADMIN constant in the configuration file:
define('GSADMIN', 'admin_ka');
To prevent access to template files, it is recommended to write the following line at the beginning of the file:
<?php if(!defined('IN_GS')) die(header('HTTP/1.0 404 Not Found')); ?>
When a robot or an intruder opens a template file in a browser, the end party will receive an error with a 404 absence code (if authorization is not performed in the control panel).
GST AdminLock is required to hide the admin panel by adding additional data to the URL (variable=password).
kt block login blocks the IP address for an hour after three unsuccessful attempts to enter the login and password in the control panel.