Creating your CMS. From theory to your own CMS online store. Note on security

Welcomes you and glad you looked. Today I want to start a new cycle of articles - the development of its own CMS (Content Management System) or, in more simply, the development of its own engine engine. Interesting? Well then forward under the cat)

A pair of beaten phrases

I think that every developer at some point begins to think about the development of some kind of purely its project. Someone writes their library, framework, program, module ... Each developer wants to give something from himself, to this world.

So, I once wrote an audio player who did not require third-party codecs, had templates and read all sorts of formats that allowed, at that time, the BASS library had 18 equalizer bands and a standard set of effects (echo, reverb, etc.). So, everyone is thinking, but not everyone implements or bring it to the end. My player did not come out of the beta stage and was, unfortunately, was abandoned. I moved my interest on web development: changed Delphi and C ++ on PHP and JavaScript. I remember that year just released PHP 5.3. A little left the topic, returning 😛

Any developer has a whole source library that walked from the project to the project - and the web development is not an exception. At some point you understand that from all this heap of non-related scripts and classes you can already make something. We will not "sculpt" with you, but the management system (CMS) or the site engine from scratch will try.

For what and why do I need it

Someone will say: "Why to invent a bicycle and ko-ko-ko ..." - then the question arises: how did such people come here and what forgot? Yes bicycle, yes simple, yes in the store bicycles shine more, yes yes yes .. but this is my bike, which is assembled with the soul and understand it, I am much better than those offered in the store. In addition, there is no better examination of the material than studying it in practice. We will replace the word "bike" on PHP and will continue in our path.

Developing your engine is a great way to learn PHP language and learn the OOP (object-oriented programming) on \u200b\u200bthe example. I do not know how the rest, and I feel the Euphoria when my CMS comes to life and even more when it will be needed to someone. So, having folded all the components in a single whole, we can conclude why it all to me: it is useful for you, and I will see what I came in handy: D I will immediately make a reservation: I'm not a Guru PHP and all that I will show not a regular solution 100%. In addition, not so long ago, my hoster began to support PHP 7, and this is a beast of a relatively new ... So we will study his chips together.

What is cms

If any questions occur, I always appeal to Google and Wikipedia. And that's what they speak on this subject:

Content management system (content) (eng. CONTENT MANAGEMENT SYSTEM., CMS.) - information system or computer program used to ensure and organize a joint process of creating, editing and manage content (that is, content).

* There is a division to applicable CMS and Web CMS (WCMS). So how applied we do not consider, then speaking CMS I will have exactly WCMS.

From this definition you can conclude, the CMS consists of two main parts:

  • Administrative - Tool Settings, Material Editing, etc.
  • Custom - all that the usual user should see, going to your site

To date, the network you can find a whole set of different systems of this kind. But me and you - those who want to study the PHP language and write their site engine on the example - do not interest ready-made solutions. We will create our own, and we will bring it to the end this time - start.

What should be able to CMS

Any undertaking should have the presentation of what will ultimately be: in our case, this is the functionality and the possibility of our content management system.

Let's start with the fact that we divide the entire functionality of our engine into two parts: internal and external.

Internal functionality is a set of features that do not see the eye, but the necessary work. These features include:

  • loading framework and all its components
  • connection and database connection
  • working with file system and caching
  • processing and output errors
  • protection against hacking and pr.

They can still be called "core functions." That is, it is the functionality that provides the main work of the entire system and external functional.

External functionality is a kind of interface between the kernel and its administrator. These are the functions that work already with the logic system itself, what the administrator or user uses when working with the system. Such functions include, for example:

  • adding a new material or page
  • changing the settings of the system itself
  • connecting new modules
  • search by site, etc.

These features can still be called "user", that is, those used by a simple user or admin to achieve any goal.

Suppose that we store the text of our article in one of the base tables, but we do not like it and we want to change the text: by pressing the "Change" button, we used the external (user) functionality. This feature, in turn, has completed a connection to the database (database), made a sample from the table with our articles and brought the text to further edit it - it is already a functionality of the kernel or "internal". So we changed the text and click the "Save" button - launched a user function, which, again, uses the functionality of the poison and so on. I hope this is understandable.

Now that mutual understanding is set, and I hope for it, I propose to go to the next step and determine the functionality, which we want to implement. I already have such a list in my head, and I propose to start with him. So, what I want to implement in my CMS and show you on the example how to do it:

  • Adding, editing and deleting articles and site pages
  • Implementation of plug-in modules and plugins
  • visual editor of materials
  • working with templates and their editing from the system itself
  • CNC is the so-called "human-sinking urlas" or links that you can watch my blog.
  • protection against hacking and SQL injection
  • the possibility of registering new users and the distribution of their access rights to the sections of the site
December 11, 2018.

There are two simple ways to create a site - yourself or hire a programmer. If you have a hiring and payment you have problems, then get ready for independent work. But do not rush to build a thousand technological schemes in your head and do not try to master the programming language from scratch. There is a simpler way - create your first site using the CMS engine. How to do - explain in our knowledge base.

Why do I need CMS engines?

CMS, or as they are also called, content management / content management systems are excellent for creating a MVP (minimum product version). With CMS, you do not need to know programming and design to create a website, you can use a predetermined program and collect your MVP as a designer. Those times when you needed to know 5 programming languages \u200b\u200bto assemble a simple site, passed! CMS allow:

    Make MPV without programming knowledge;

    Make the site much faster than creating code and design from scratch;

    Save money - the site can be done yourself, and you can hire a novice specialist.

What is the content management system?

CMS., from English Content Management System (Content Management System) - This is a program that gives users the ability to create sites using simple tools without touching the code.

For example, one of the authors of the knowledge base of the venture accelerator, Ivan Folders, used CMS WordPress to create a MVP site with a subscription function for goods. You can read in detail how to make a site on WordPress in our .

Who exist content management systems?

"We were bloggers and worked in software B2. We were not satisfied that the program was difficult to configure, it is difficult to run, I had to move the code with hands. We wanted simplicity. So there appeared WordPress. "

Matt Mullenveg, one of the creators of WordPress.

In quote, Matt speaks about a blog on WordPress, but its quote can be applied to any site on CMS. These programs are suitable for creating MPV for testing hypotheses without large monetary and time costs and their simplicity is distinguished. Usually writing a site from scratch takes months and cost hundreds of thousands of rubles, and the creation of a site on CMS in the presence of experience - days or weeks, and maybe

The following content management systems are most popular:

    WordPress.- This CMS has 32% of all sites on the Internet. Suitable for:

    • Blogs;

      Online stores with a small assortment;

      Information sites;

      Personal sites;

    Joomla- A little more complicated in the development and "heavy." Suitable for:

    • Dating sites;

      Forums;

    Bitrix. This is paid, but full-featured CMS. Suitable for:

    • Online stores with a large assortment;

      Corporate portals;

      Information sites;

      Forums;

    Tamaranga.. Paid CMS sharpened under:

    • Bulletin boards;

      City portals;

      Real estate sites;

      Exchange services.

When to start using CMS?

CMS should be used when you already have a business idea, you checked the demand for the product easier ways and you need to create a functional MVP or an online store. Before thinking about CMS, answer the questionisn't it enough for your needs of the site designer, such as Tilda? By the way, we have a lesson how to create MVP on.

How to use CMS?

Talk about what you need to do to start creating your MVP. Each CMS is slightly different, but they all combine general characteristics. First you need to install CMS to your hosting. To do this, you must have a paid hosting and a domain name.

After installation, you will have a blank site that you can fill from the admin panel. From there you will manage the design, content and functions of the site. With the help of plugins you can add new features to the site, like pieces of the designer. Plugins are pre-created programs that, as modules, are connected to the site. They download from shops provided by the CMS themselves and are installed in one click. Plugins are paid and free. For example, that users can pay for the purchase site, everything you need to do is connect a payable plugin.

In order to successfully create a site on CMS, you must confidently use the computer, but you do not need to be a technical specialist. In addition, all CMS has detailed installation and configuration instructions. Use this article to select the content management system that suits you, follow the instructions on the official website and you can create your own website!

Consider different options in more detail:

WordPress.

This is the most flexible and simple in the development of CMS. It is suitable for creating a blog or website with online sales, a small online store. However, it does not end in this. With proper smeared on WordPress, you can create even a Web application.

    Official WordPress website:https://ru.wordpress.org/

    Where to download: https://ru.wordpress.org/download/

    Instructions: https://codex.wordpress.org/en ::main_page.

    Price: Free, but premium topics and plugins can cost thousands of rubles.

Joomla

Joomla is more difficult in mastering a platform, which will also download the site more WordPress, however, it has advanced features for creating a social network thanks to the extension of JomSocial. On this CMS, you can make a whole startup with elements of the social network.

    Official site joomla:https://www.joomla.org/

    Joomla in Russian:http://joomla.ru/

    Where to download: https://downloads.joomla.org/

    Instructions: https://docs.joomla.org/main_page/ru.

    Price: free, but the price of jomsocial from $ 99, premium expansions are also paid.

1C Bitrix

CMS, which has created many of the major Russian online stores, such as Lerua Merlin and Eldorado website. One of the advantages of 1C before competitors is simple integration with accounting services. Bitrix offers many features from templates to create sites to deep analytics and optimization tools. However, the cost begins from 5400 rubles.Tamaranga.

In some way, Tamaranga is a whole 4 CMS aimed at specific types of sites: city portals, bulletin boards, services exchange or real estate sites. Inside its niches Tamaranga rules ball, but a fee for it is the lack of versatility and a high price. If you buy the last version, you will have to give to developers from $ 500, and for a complete set of extensions to pay from $ 2000.

    Official site Tamaranga:https://tamaranga.com/

    You need to go to the site and write the creators of CMS which product you want to acquire, developers will help you complete the purchase process.

    Instructions: https://dev.1c-bitrix.ru/learning/course/index.php?course_id\u003d34&index\u003dy

    Price: from $ 500.

How much is the use of CMS?

It all depends on the selected option. There are free options and paid. For most programs, there are free themes and plugins, but all premium supplements will cost thousands of rubles.

In order to work with CMS, you will need hosting and domain. The domain costs from 100 rubles, and hosting about 200 rubles. per month.

Good day, readers Site! 🙂

After my previous articles, you had to decide to create your own resource, choose its type, and also how exactly you will create it.

If you still have certain difficulties in the answers to these issues, I recommend them to urgently eliminate by reading the previous publications.

Well, for those who are confident in their intentions, it's time to move on

And today we will talk about such things like creating a site on CMSbecause Today it is one of the easiest and most promising.

It will allow you to make a site to anyone who knows yourself, quickly and without much cash at the start.

The site development process on CMS is not a chaotic driving cursor mouse over the monitor screen and click the keyboard 🙂 it consists of several steps, only the sequential execution of which will lead you to the desired result - your own site!

So, let's talk about the technical moments of creating a site on CMS in more detail ...

Creating a site on CMS - Stages

Installation on your computer

To begin with, we need to download the engine itself and install it.

There are two ways:

  1. Copy the downloaded engine to the server and install it right there;
  2. Install CMS to a local web server located on your computer.

Each method has, as usual, its pros and cons.

With a direct installation of CMS to the server, you will save the time to install, which are indispensable when developing on a local computer. To work with the code of the engine in their administrative part, the editors of the code are often embedded, which allow you to make edits directly through the Internet.

In addition, when editing in the online mode, you are not tied to a computer on which the local copy is deployed and there is a whole set of necessary software.

But online editing is also a minus, because You are very dependent on the availability of the Internet. And his disappearance or malfunctions during the application of edits, especially during the installation of the components, leads to spent nerves and time 🙂

In addition, not all CMS has built-in code editors. And if they are, then leave to desire the best. For example, in the OpenCart there is no default editor. It is available when installing the CodeManager module, but its functionality is not quite suitable for comfortable and productive development.

A built-in default code editor in the WordPress engine is generally disgusting. After saving changes to the file, it is impossible to return the changes. No automatic code formatting, syntax highlighting. Next can not continue 🙂

In this situation, when creating a site on CMS, you may need a second approach to installing the engine - to a local computer. It works in case of choice of anyone and is universal.

When making edits to an already running resource, working with a local copy also has a lot of advantages compared to remote editing. Because With some failure during online editing to restore the site, you will need a certain time that the resource will be unavailable. And you lose users, traffic and place in searching for sites whose robots will not be able to index inaccessible resource.

To restore work, you will need a current backup copy of the site (backup), which is not always stored at the hosting provider, and if there is, it is not always fresh. When working with a local copy, such problems will be unfamiliar, because You will not make edits directly to the site, and it will always work.

In case of failure when working with a local copy, you can always get a backup, just downloading files from the server. Maximum than you donate, it is lost changes. But no one is immune from this, just be careful when editing

One of the main advantages of this method is that when installing CMS on a local computer, you have the ability to work without binding to the network availability.

Personally, this feature has helped me very much when I worked for freelance, working at the factory. There were no coverage on the Internet at all, even for official purposes.

It was possible to break into the network using the phone as a modem, but at such a speed even the usual site was loaded about 5 minutes. Yes, and then only where the signal pierced 🙂

I can say about myself that I am not a tary supporter of any method. Everyone has the right to life. It is necessary to act situationally.

Installing template

Despite the type of your resource and the engine you use, when creating a site on CMS, there is always not enough basic features. This statement is true in the case.

If you create a news site, a portal or blog, then the design is not as critical. If you need to create an online store or, even better, a gaming site, then graphic design should stand at one of the first places when designing a resource.

Help to make a website in accordance with the chosen topics and taking into account all the tastes of the owner, just, are the graphic patterns and themes of the design (depending on the entity name engine may vary).

Search them, as a rule, is not difficult, because They, fortunately, in a large abundance are available on the expanses of the World Wide Web. You can even order it with programmers individually. Problems are usually starting when installed. This is especially true for the development of sites on CMS, which do not have automatic template installation tools.

Therefore, individual articles affecting all the nuances of this process will be devoted to settings of templates for specific engines.

Installing modules

The same inherent step of creating a site on CMS, like installing a template. Despite the good basic possibilities of the engine, its functional is clearly not enough.

If you take as an example mentioned earlier OpenCart, then by default there is no payment method through Webmoney and Yandex.Money. There are no different courier services in delivery options. And so on ... In the case of free products, this phenomenon meets completely and nearby.

It is a little better with the thing, but still no, no, and the deformity of the developers will pop up. In addition, part of the basic functional may not satisfy. For this reason, it is necessary to complement the store with various modules.

Regarding the installation process of the module, when creating a site on CMS, we can say that things are 1-in-1 with templates. Find - easy, and install - difficult 🙂

Therefore, in the lessons to create resources on the basis of different engines, we will allocate a separate article to this issue.

Transfer to hosting

This stage of development of sites on the CMS is a private minus deploying a local copy on your computer. But you do not need to be afraid, because nothing terrible he does not represent 🙂

All you need is the username and password of your account on the hosting provider server, as well as the program to transfer files.

One of the most common is Filezilla, which I use I personally and recommend you.

Filling site.

This stage is completing when creating a site on CMS. Actually, it is a smooth transition from the development of a web project to work with him. Because, regardless of the type of resource, to attract visitors and increasing earnings on it on the site, you need to regularly place thematic information.

News, articles, goods - what they will be more, the more successful you will have a website.

All just 🙂

Some mansions in this rule is an online store, because It may not be one thousand products in it. Therefore, for the filling of this type of resource, special technologies and programs that we will definitely talk in the future are used.

As a result, I will say that this list is universal and independent of CMS, which you have chosen, and such as the resource you are created. Therefore, you can safely use them when creating resources on specific engines, what will be discussed in the following publications.

On this article dedicated to creating a site on CMS, comes to the end. I hope that the instruction compiled by me will be useful to you and you have been resorted for it when creating your resource.

Leave your opinions and wishes in the comments about the read. Share a record with your friends on social networks with the help of an article buttons, I will be very nice to me.

Also subscribe to site news that will come to your e-mail to be aware of new articles and blog news.

Good luck to all! 🙂

P.S.: If you need a website or you need to make edits to an existing one, but for this there is no time and desire, I can offer my services.

More than 5 years of experience Professional site development. Work with the Php., OpenCart., WordPress., Laravel,

Often, ready-made CMS is used to create a website, which becomes the basis for deploying the site. Some users may have a question: how to make a content management system (CMS)?

Immediately it is worth saying that the creation of its own CMS is a difficult process. To develop any suitable system, it is necessary to own at a good level of site development technologies from scratch - that is, you need to know one of the web programming languages \u200b\u200b(for example PHP), know and be able to make up database queries (MYSQL), be able to write scripts on javascript , Know HTML and CSS. Of course, in some cases it is possible to abandon some of the above-mentioned technologies, but often without these funds can not do. Consider a simplified process of creating.

Design system

Creating a content management system must be started with its design. It is necessary to determine how the system will function, draw up schemes for the interaction of its main parts. For design, you can resort to various special means, for example, use the software or make the simplest schemes on a simple piece of paper. Usually the system has several basic components that will solve basic typical tasks, such as administration, materials management, registration and user input, and so on. If you need to use clean addresses in the system, then first of all it is necessary to think through how their processing will occur.

System implementation

After solving some of the main issues related to the basic principles of the system functioning, it is necessary to move on to the immediate implementation of the system, and rather its main components. A typical example can be a system that has one entry point in the application (usually this is an index.php file), this input point further processes all requests. It is usually worth creating a kernel file that will contain frequently used features (APIs), and then use the functions from this file in all the necessary places of the system. Most functional is implemented in additional kernel files. When the foundation is ready in the form of basic functions for building a system, you can proceed to implement any specific tasks in the system.

With the development of your own content management system, you will have to correct errors in its work, improve its components, and add a new functionality. Thus, step by step you will develop your own CMS.

Only for LifeExample readers It is possible to open an online store on Moguta.cms with a discount of 15%

Creating a CMS Design Stage

Hello, dear blog readers, today I would like to touch on the topic with which it would be worth starting the cycle of articles about. We will talk about the process of creating CMS at the design stage.

What should be able to be CMS in order to be called such, and at what moment the site engine, or mini framework develops into the content management system.

CMS processing process at the design stage Determines the tasks according to the plan of which any CMS should:

  • Have your own installer;
  • Update, not touching custom files. Those. update only the kernel;
  • Maintain the use of plugins;
  • Be able to caching pages;
  • Save backup databases;
  • Support template;

This list is the basis of tasks for any content management system created for users.

Of course, if you are a developer, a license plate, designer, user and administrator in one person, then the above requirements can be performed in manual mode.

In the case when the CMS created by CMS wants to use a person who does not have a concept even about HTML, all this should be!

CMS Installer

Under the installer we will understand the script or a set of scripts responsible for the first step towards using the finished product, namely, for the installation and configuration of the system files necessary for the functioning of CMS.

To install any system, as a rule, having received a ready-made set of files in the packaged form, which is CMS, the user unpacks its contents to remote hosting.

Among the unpacked files, when the system is first started, the directory contains containing scripts for installation, it is usually referred to as INSTAL.

After unpacking the archive, when accessing the site, the user must already receive a working environment, and not a set of inadequate errors of screaming about not the ability to connect to the database or the absence of a particular module on the server.

In other words, when you first start the user, the user must fall on the CMS installation environment, physically located in the Install directory.

Here is the block diagram of the first launch algorithm:

As you can see first by plan, configuring the configuration file, then delete the installer, and start.

Support plugins

Everything is somewhat more complicated here with the installer, and it is necessary to clearly design the system to support plugins. In the simplest case, the plugin may be a class of inherited properties and methods of parent class Plagin.

The Plagin class itself must be in the system core, and be able to update with the release of new versions. This is necessary to build the system functionality in the future.

In the case of more difficult, for example, when using a plugin, a set of files can be a set of files, and maybe directories.

System Update

Recently faced a task to update the customer's website created on one developing CMS. The site missed the last two system updates, and has already needed a good upgrade.

After reading the manual to update the versions of the nucleus, I was a little confused by the need to serially update. It was necessary to do updates in this order v1.5 -\u003e v1.6 -\u003e v1.7, all this was in semi-automatic mode using multiple interfaces and replacing the files of the current version manually.

In my opinion, when creating CMS, the update process must be a fundamental and fully automatically occur - directly from the administration panel by pressing the corresponding button " Update".

In order for this to be possible, again, it is necessary to clearly think out the architecture of the application and the directory structure.

I think it will be convenient to take into a separate directory, the file that can be updated in the future, and to which users are better not to touch.

Page caching and template support

Very useful property Saving dynamic data in a static form. It will significantly reduce the use of server resources and speed up the site work. For caching pages, you can contact for example to the templateizer Smarty.which is convenient to use and clearly separates business logic from the page template, and also has the ability to cache data.

But if we create your CMS Yes, and the software, it suggests that all logic is already separated from the presentation, and accordingly, no third-party template is needed.

All that will be enough to write this caching mechanism using standard PHP output control mechanisms.

Saving backup databases

With the support and development of the site created on any CMS, it is unusually important to keep daily saving backup copies of the database.

Often, the built-in automatic dump mechanisms in the CMS can not be found. Even with all the favorite WordPress, it can not be better suitable for this example, but the situation corrected plugins designed specifically to keep backup bases.

This once again proves the need to support plugins, which sometimes can significantly supplement the system functionality.

Creating CMS requires great effort and pronounced motivation, often overlapping the process of a qualitative stage of design by the desire to start making functions.

No matter how much you wanted to start faster, and even faster creating CMS.Do not forget that the design of any system is the main and most important. At the maximum allowable amount of time to finish him and you can reach the end, without folding your hands when a collision is collided with the task of breaking the entire application architecture.

In order not to miss the publication of the next article, subscribe to the software mailing or RSS blog ribbon.