Info intitle datalife engine control panel. Creating a simple module for CMS Datalife Engine (DLE)

Dear friends,

The main stage of development of version 12.1 is completed, the release is under testing and pre-release preparation, but in the meantime, we invite you to familiarize yourself with the information about what awaits you with the release new version.

The following changes were prepared and implemented:

1. Added support for headings in the ad management module. You can create headings in this module and place your advertising materials in these headings. Categories are displayed at the very top, in front of the list of added advertising materials, in the form of folders. In the headings themselves, you can also create an unlimited number of additional sub-headings. Thus, for a large number advertising materials, you can place them for ease of navigation through them, in various headings and subheadings.

2. Added the ability to count the number of views for promotional materials added to the script control panel. Views are recorded only for real users who entered the site using a browser. Bots crawling the site are not counted. Views counting is enabled directly for each banner, so you can count views only for the required advertising materials. You also have the option to specify whether you want to count all views of the banner, or count only views from unique users.

3. For advertising materials in the admin panel added the ability limit the display of the banner based on the number of views, and you can disable the banner when the specified maximum number of views is reached.

4. Added the ability to track the number of clicks for promotional materials added to the script control panel. DataLife Engine automatically intercepts HTML tags published using tags <а href="..."> , and automatically keeps track of clicks on them. Any special design of these links is not required, they can lead to any addresses you need. You also have the option to specify whether you want to count all clicks on a link, or count only clicks from unique users.

5. For advertising materials in the admin panel added the ability limit the display of a banner based on the number of clicks on your banner, and you can turn off the display of the banner when it reaches the specified maximum number of clicks on it.

6. For advertising materials in the admin panel added the ability to clear the number of views and clicks for each ad banner.

Html "> 7. Added the use of canonical links in the code of the pages, for all pages of the site including navigation through the sections, viewing the full news, etc. This opportunity allows to increase SEO optimization sites, and also allows you to avoid duplicate pages if incorrect links to your site are published somewhere on the Internet, or if for some reason it is necessary to disable the control of incorrect CNCs.

8. In the category settings in the control panel, added the ability set by default for a category, whether it is allowed to publish news from this category on home page site. These settings are in effect at the time of adding or editing a publication, and if publication on the main page is prohibited for a category, then the corresponding option is removed at the time of adding or editing a publication.

9. In the category settings in the control panel, added the ability set by default for a category, whether comments are allowed for posts from this category. These settings are in effect at the time of adding or editing a publication, and if comments are disabled for a category, then the corresponding option is removed at the time of adding or editing a publication.

10. In the category settings in the control panel, added the ability set by default for a category, whether the rating is allowed for publications from this category. These settings are in effect at the time of adding or editing a publication, and if the use of rating is disabled for a category, then the corresponding option is removed at the time of adding or editing a publication.

11. In the script settings in the control panel, in the security settings section, added the ability enabling automatic site protection from being embedded in frames on third-party sites. When this setting is enabled, your site will be automatically blocked from showing if it is embedded in an iframe on someone else's site. By doing this, you can protect your site from attacks such as clickjacking.

12. The capabilities of the "Meta tags" module have been expanded, this module has been renamed to "Titles, Descriptions, Meta Tags". Now in this module you can set not only meta tags for pages, but also a separate title for the page and a description of the page, which you can later display anywhere in your template. For this, new global template tags have been added: (page-title)- displays the title you specified for the page, (page-description)- displays the description you specified for the page. In the description of the page, it is also permissible to use BB and HTML tags... Thus, using this module, you can, for example, create and display titles and descriptions for the tag cloud for each tag personally, etc.

13. Added new global template tags text that display the text enclosed in them if a title for the page being viewed has been set in the "Titles, Descriptions, Meta Tags" module. And also added opposite tags text which display the text enclosed in them if no title has been set for the page being viewed. Also added similar tags and for description: text that display the text enclosed in them if a description for the page being viewed has been set in the "Titles, Descriptions, Meta Tags" module, text which display the text enclosed in them if no description has been specified for the page being viewed.

14. For the category menu template (categorymenu.tpl) text that display the text enclosed in them if the category or news viewed on the site does not belong to a category from the menu. This tag can only be used inside tags and is used, for example, to display some information (for example, links) only for inactive categories from the menu.

15. Expanded options for displaying publications based on the values ​​of additional fields in publications. When contacting the address http: // yoursite / xfsearch / field name / field value / publications will be displayed, as before, containing the specified value in this particular field, if the field is set to "use as cross-references". When contacting the address http: // yoursite / xfsearch / field value / publications containing this value for all additional fields will be displayed. When contacting the address http: // yoursite / xfsearch / field name / all publications in which this specified field is filled in will be displayed.

16. Added the ability to assign a separate page to the script settings with the name 404.html at the root of your site, to display pages for which there is no content. If this setting is enabled, instead of the standard system message "Sorry, this page is not available for you, perhaps its address has been changed or it has been deleted. ", you can display a separate page specially prepared in advance, with a completely separate design. This innovation will be useful for webmasters who want to make a separate design of 404 pages of their site.

17. Added the ability to assign an HTTP header to the script settings from where you need to get the IP addresses of users. This innovation will be useful for sites that use various external proxy servers, and do not have the ability to properly reconfigure the server for them to get the correct real IP addresses of visitors. For example, when using the cloudflare service and others to protect against DDOS attacks and using a regular hosting plan without access to server settings. Now you can tell the script from where to get the IP address of site visitors in the script settings in the admin panel.

18. When deleting a category in the script control panel, added the ability to choose what to do with publications that are in this category. You can: "Remove this category from publications", "Replace the category with another or other categories", as well as "Delete all publications in this category". In this case, if a category is deleted or replaced from a publication, then only the deleted category will be removed or replaced. For example, if your publication is in the "World", "News", "Popular" categories, and you, for example, delete the "World" category, then for publications in this category, only the "World" category will be removed, or replaced, all other categories in the list for these publications will remain in place.

19. For publications, a new type of additional field has been added: "Pure HTML and JS". Using of this field The DataLife Engine will not interfere with the text written in it, and will not filter the HTML code of this text, and also allows writing pure javascript code in it. This field will be useful when you need to insert some code into a news item that does not need to be checked for security, for example, any of your own player, etc. Attention, taking into account that the script will not filter the text from this field, when creating it, be sure to set restrictions on which groups are allowed to use it. Do not allow ordinary users whom you do not trust to use it, otherwise it may pose a threat to the security of your site.

20. For additional fields of publications with the option "Use as cross-references", added the ability to specify the delimiter for these links. You can specify both individual characters and HTML code as a separator. Previously, a comma was used as a list separator, now you can set your own personal separator for each field, which allows you to create a unique layout for each field in the template.

21. Added support for Yandex Turbo technology for regular RSS feeds, without using the inclusion in the settings of the type of RSS stream as "Yandex news", for this added support for displaying the full news tag (full-store) for any type of RSS stream. A also updated standard template/templates/rss.xml which demonstrates how a template with full Yandex Turbo support should look like. Similarly, the ability to customize an RSS template for Yandex Zen technology is fully supported.

22. Added the ability to respond to comments when viewing all the latest comments on the site, if support for tree comments is enabled in the script settings. Thus, you can, for example, quickly respond to the comments received on the site, without going into every news at the same time., Due to the fact that some of the heavy scripts were transferred to a delayed and independent of the rendering of the page loading. These scripts are loaded into the browser in parallel with the rendering of the page and are launched only after the completion of the formation of the page in the browser. Which visually provides a faster page display.

24. Added the ability for unregistered users on the site, send complaints about news and comments to the administration of the site, just as such an opportunity previously existed only for registered users.

25. Added use of schema.org micro-markup to display a rating with the "Score" type. The use of this micro-markup allows for full news, when displaying them in Google search results, to display the publication rating as well.

26. Added automatic orientation detection photos when they are uploaded to the server, based on meta information contained in graphic files. If original photo was turned upside down, then when it is uploaded to the server, the script will also automatically deploy it to the desired position. This eliminates the need for additional editing of pictures on a computer, if the camera was turned while taking a picture.

27. Added the ability to automatically notify site administration about the receipt of new news from users that are under moderation (if it is enabled in the script settings), if the news was added from the script control panel. Previously, the notification was sent only if the publication was added directly from the site.

28. If the user edits the publication in the control panel, which was previously already published on the site, but according to the settings of his group, it is forbidden to publish without moderation, or it is allowed to publish not in all categories, then the administration of the site will also be sent a corresponding e-mail notification that this news is awaiting moderation.

29. Changes have been made to the work of the module bread crumbs(Breadcrumbs) on the website. If you are viewing news from a certain category, then for the category in which the user is directly located, this category will be displayed in the form of plain text, and not a link. Only categories that are higher in the hierarchy will be displayed as a link, or there will be a link to this category if, for example, the user has gone further along the page navigation in this category. Thus, this innovation avoids cyclic links of pages to themselves.

30. For the module "Cross-references" in the control panel, added two new replacement areas for links. You can optionally specify replacement only in static pages, and you can also select replacement in static pages, news and comments.

31. For the module "Find and Replace" in the control panel, added the ability to bulk replace text in polls for publications and in polls on the site.

32. Added the ability to delete all publications awaiting moderation from a specific user. To do this, in the user management section, click on the number of its publications and select the appropriate menu item.

33. Added the ability to delete all comments awaiting moderation from a specific user. To do this, in the user management section, click on the number of his comments and select the appropriate menu item.

34. Added formatted displaying the number of different counters (views, publications, comments). The output of these counters is carried out in a formatted form as separating hundreds, thousands, millions, etc. with a space. What gives more visual representation and the perception of given numbers.

35. For templates for displaying comments and adding comments (addcomments.tpl and comments.tpl) added support for new tags text- displays the text in the tag if the news belongs to the specified categories, as well as tags: text- displays the text in the tag if the news does not belong to the specified categories. Thus, you can set a different design for displaying comments and adding comments for publications from different categories.

36. Added support for declensions for the tag displaying the number of votes that were set for the rating of publications. For example, you can use (vote-num) review || a | s. Previously, this was not available for this tag, since it contains HTML code, not just a number.

37. If the use of the site only via HTTPS protocol is enabled in the script settings, then cookies by the browser will also be sent to the server only via the HTTPS protocol and will be automatically blocked if the usual HTTP protocol is used.

38. Added control of invalid CNCs for static pages whose publication text is split into several pages. If an incorrect page number is specified, an automatic 301 redirect will be made to the starting address of this page.

39. For RSS import of publications, added support for importing images from the enclosure tag containing an image for publication. If short description in the RSS feed is just text, and the picture is given in it separate tag, then a picture for this publication will also be added to the short news when importing at the very beginning.

40. Added support for redirects to receive full news when using RSS import of publications. If the link from the RSS feed is a redirect for further transition to the full text of the news on the source website, then DataLife Engine will automatically follow this redirect and will take content from the final source. Thus, receiving full news will be of better quality than before.

41. Changes have been made to the work of tags and... If the use and addition of comments is prohibited for a specific publication, then these tags will also hide the content in them.

42. If comments are allowed for publication, but at the same time the user or a group of users, according to other settings, was prohibited from publishing comments, then a message about this will not be displayed at the end of all comments, but in the place where you define the output of the form for adding a comment with the tag (addcomments) in your template, thereby you can determine the location yourself of this message on your website.

43. For authorization using social network"Classmates", added the ability to automatically receive User e-mail, provided that the application itself has received the appropriate rights from Odnoklassniki. Attention, by default, Odnoklassniki does not give the right to receive E-mail, and to obtain appropriate access, you need to additionally contact the social. network for permission to receive e-mail. If permission is granted, then DLE will also automatically import the e-mail address.

44. Improved the system for calculating the proportions of the image when creating small copies. Thus, a more correct and high-quality reduced copy is created.

45. Improved publication search system when the simple search type is enabled in the script settings. The new algorithm makes it possible to find publications more accurately and correctly.

46. ​​Improved control system for the appearance of duplicate pages when viewing all the latest comments on the site.

47. Optimized processing of additional fields of publications when displaying short publications, as well as when the display module for popular publications is running.

48. Updated visual editors TinyMCE and Froala before current versions. A number of detected errors in these editors have been fixed.

49. For TinyMCE editor added support for inserting tags hidden text, using the corresponding button in the editor.

50. When using the editor Floara for comments, added the ability fast loading and inserting images into the comment. You can either click on the icon to insert a picture and select a file to upload, or simply transfer the picture file from the computer to the editor field with the mouse, after which the picture will be automatically loaded and inserted at the cursor position in the editor.

51. Small changes have been made in the layout of the script control panel aimed at eliminating some layout errors and improving interaction with the control panel.

52. Updated to the latest versions a library for sending mail from a site; and a library for determining mobile devices.

53. Fixed problem at which in preview publications were not processed tags and.

54. Fixed problem in which meta tags for social media were formed incorrectly. networks of video and audio, if the video was published in add. fields and consisted of playlists and descriptions of video and audio files.

55. Fixed problem in which, under certain situations and server settings, the preview of publications might not work when adding publications from the site.

56. Fixed problem in which the dynamic loading of comments did not work, if it was enabled in the script settings, and the tag (jsfiles) was placed at the very bottom of the site.

57. Fixed problem at which the display of the last comments did not work, if for a certain group viewing of some categories was prohibited.

58. The detected and previously announced small errors in the script have been fixed.

There are a huge number of sites on the Internet, and they all run on different engines. The differences are mainly functionality engines and ease of use for outside users of sites. The most popular engines are Joomla, WordPress, Drupal, DLE. Let us dwell on the latter in more detail, since, being one of the most convenient and simple engines, it is increasingly being chosen by webmasters and becomes the basis of most web resources.

The DLE engine is DataLifeEngine - the basis that was previously expected to be used for resources with news feeds and reviews. Today, a wide variety of sites dedicated to any subject matter works on this engine.

The DLE engine has earned its popularity thanks to its huge functionality, which is described in detail on the website dle-news.ru. The creators of this engine offer two versions of their product: paid and free. It is quite logical to assume that free version will be with more disabilities. But despite this, the free version of the DLE product is an excellent engine for both novice webmasters and more advanced ones. It works great sites not only with news, but also dedicated to cooking, medical topics, etc.

What hosting can I install DLE on?

Before you start installing the DLE engine, it would be nice to familiarize yourself with the requirements that it places on the server. First, there are several installed libraries: PHP Zlib, PHP XML, PHP GD2, PHP iconv. Moreover, software must include Apache version 2.0 or later, PHP 4.3.2+ or PHP 5.0+, and MySQL version 4.0 or later. RAM should be at least 8 megabytes in size, but this is the minimum. Nobody forbids the use of 16 megabytes of RAM, on which the product will work even better.

When using the DLE engine on the server, it is better to disconnect safe mode which is denoted as SafeMode.

Hosting compliance check

The description of the installation process, which you will read later, is based on the conclusions made after installing the engine on a test web resource. Screenshots of each step of the installation process are provided for a more illustrative example.

We start the installation by checking the complete list of settings. To do this, add to the root of the site Text Document, assign the name phpinfo.php to it, and write the code into it:

Then we run the script that we managed to create. In the browser, type the following: https: //my_site.ru/phpinfo.php. After that, we can see the following picture on the page:

The places that are circled in red are the main parameters that determine the further operation of the created web resource. For example, in order to be able to work with graphic objects, the PHP GD2 Library needs normal operation. If its installation is performed incorrectly, the captcha will not be displayed on the site.

Also, in order for the created web resource to work normally, you need to install the MySQL database. The system will ask for a username and password. In order not to forget these data, it is better to write them down somewhere. To configure the database, we use the control panel that is available on the hosting.

Detailed instructions for installing DLE

After the package with the engine is downloaded to your computer, you need to unpack and install it. But we will not install everything, but only the upload folder and the Documentation folder. In the event that the hosting has a function for recognizing zip archives, then the installation process will go faster. If this function is not supported, then you will have to download files from the archive separately.

It is very convenient to work with TotalCommander when installing the DLE engine. When you copy files or folders to the server, you need to uncheck the box next to "Convert file names to lowercase".

If the server allows you to recognize and unpack the archive, put all the files in the upload folder at once.

Now we quit TotalCommander and continue the installation using the ftp client. For the site to work correctly, you must very carefully enter the data of the server files and folders.

To correct the Attributes, you need to select desired folder... After you change the permissions of a folder, they are not replaced with the contents of the folders. It is most convenient to select files and folders that will be changed through TotalCommander or by the Alt + A keyboard shortcut.

In the window that opens, enter what we need and click OK.

- Set the templates folder and all its subfolders to write permissions (CHMOD 777)

- Set write permissions for all files in templates folder (CHMOD 666)

- Set write permissions (CHMOD 777) for the backup, uploads folders, as well as for all the folders inside them.

- Set write permissions (CHMOD 777) for the / engine / data /, / engine / cache /, / engine / cache / system / folders.

When all the adjustments are made, enter the following entry in the browser: https://proba.regciti.ru/install.php. It means that we are going to run a file called install.php. After the file is launched, tips will appear in each window that opens. Based on these signatures, we continue the installation process. Basically, it will start automatically, and the system itself will check all those files that should be installed, and notify you when the installation is complete.

Now you can see the preliminary result of what you have been working so hard on all this time. Enter https: // your site name / index.php into the browser line. A demo page will open in front of you. To enter the admin panel and get started, you need to enter the following entry in the address bar: https: // your site name / admin.php. On screen in case correct installation the following picture should appear:

We agree with the offer that is displayed in the lower left corner and start the installation. After clicking this button, a window will appear asking you to read the rules license agreement... The transition to the next page will occur only if you accept this agreement and put the appropriate checkbox. Click "continue":

After that, the process of checking all those components and files that have been installed will automatically begin. The script will automatically indicate those errors that were made and that need to be corrected in order to continue working. This picture contains a list of several items. They should be without a red outline - this will mean that the script did not find any errors and you can continue working further. If any item is in red outline, we correct the error. In principle, the script may require you to correct errors, and you can refuse, but then expect that the system will crash at some points. And it will only be your fault, not the providers and not the users. If the errors cannot be corrected, you can ask for advice or assistance from the provider who provides you with space on the server.

At the bottom of the window there is also a list of items that should be without a red outline. But these errors are not so critical and may not affect the work of the future site. The thing is that the script has certain standard settings, and they may not always match user preferences. It is better already at this stage to consult with the hosting provider and clarify whether some of the settings highlighted in red may not coincide with the proposed system.

We continue and get a new window that opens. Here you can find out what mistakes were made at the moment when you made changes to the Attributes for folders and files. The script will tell you where you made mistakes or missed something.

If there are still errors, it is better to fix them through the FTP client. after adjusting, we update the page and see if there are still places where adjustments need to be made. If you did everything correctly, and the system did not allocate any places for you with errors, congratulations! You have successfully passed one of the most difficult and crucial stages of the installation, and now you can safely continue it!

MySQL Server:

MySQL encoding:

The next picture shows the places that need to be entered very carefully and correctly.

The name of the base will be the same as we assigned it at the very beginning. In our case, this is proba_regciti.

In the "Username" item, enter the username of the user on whose behalf the database was created. At that stage, we wrote down the login and password just in case.

We indicate the address Email in the E-mail line. We press "Continue". If there are no input errors on the previous page, an inscription will appear in front of you: “Congratulations! Installation completed successfully. "

In the next window that opens, pay attention to several points.

When you installed the script, a database was automatically created with it, an administrator's office and system settings were created. In order not to knock out all the settings and not to start a re-installation, it is recommended to delete install.php.

I hope you now understand how to install DLE on a hosting. If you still have questions, ask them in the comments to this article.

Published by author

This plugin system allows you to modify any functionality of the script at your discretion. Installing plugins on the site, updating plugins, is carried out in one click, directly in the DataLife Engine control panel. If the plugin is developed for new system, then users no longer have to read the installation instructions, edit something directly in the script files, etc. It will be enough for them to just upload the plugin to the admin panel and that's it.

The plug-in system is built using virtual technology file system... You describe in the plugin in which file and what actions you need to perform, based on this information, DataLife Engine will create virtual copies of these files, with all necessary changes and modifications, and will work with the created virtual copies without affecting the original files. At the same time, you can describe changes in almost all files, except for a number of basic ones, for example, root files, but they do not carry any functionality, except for connecting other files. The functionality of the files responsible for the AJAX functions can also be changed, for this they have been completely rewritten to work through the controller. What are the benefits? First, the original files always remain the same, so plugins can be easily modified, removed, updated, etc. Secondly, this system uses the minimum possible load on the sites in general, because virtual copies of files are created only once, at the time of installing or updating plugins, after which DataLife Engine works with these modified files as with ordinary native files and there is no memory consumption for call points, storage and control of information about where and what functionality needs to be changed etc. The load on the server will increase only by the load that the plugin itself will bring with it, and the plugin management system will not cause any additional load. Thirdly, there are no problems with updating the script directly, the script can be updated to new versions, and your plugins are automatically applied to new versions. At the same time, different plugins can modify the same file without causing conflicts, provided, of course, if different plugins do not perform directly opposite actions to each other.

So, in the plugin management module itself, you can either create a plugin directly in the control panel, or load a ready-made plugin. Consider adding a new plugin directly to your control panel:

On the first tab, you set general data about the plugin. Its name, its brief description. For ease of differentiation with other plugins, you can specify an icon for him that he will use in the list of plugins. Also, you specify the version of the plugin itself, and the version of DataLife Engine with which it is compatible.

On the next tab, you directly specify the actions to be performed on the files. You can add one or several files on which you need to perform actions, and also assign one or several actions to be performed on each file. In files, you can do the following:

1. Find and replace any code.

2. Find and add the required code above.

3. Find and add any code below.

4. Completely replace the contents of the file with your own.

5. Create new virtual file which does not exist in the original DLE.

You can also add or remove files, change or remove actions on files at any time. For ease of perception and editing, all the code is highlighted, and the fields can be dynamically stretched.

Thus, the situation in which you previously manually edited the script files, and stored the changes somewhere in your notepad, and every time the script was updated, re-entered them into the script files, with the new version completely disappears into the past. You can independently create your personal plugin directly in the admin panel, describing the changes you need in the script once, and when you update the script to a new version, you don't have to worry about it anymore, your changes will be automatically applied to new versions.

On the next tab, you can add the necessary actions in the MySQL database that the plugin should perform in certain situations. You can ask a list MySQL queries which must be performed when installing a plugin, when updating it, when it is disabled, when it is enabled, when it is uninstalled. In this case, for each action, you can specify either one or a list of several queries to the database.

For an existing plugin, you can do the following: You can disable it, while it remains on the site, but is completely ignored by the script, and all its actions on files are suspended. You can update it to a newer version, if there is one. Download the plugin to your computer to install it on another site. In this case, the file itself is downloaded to XML format, and this XML contains a description of all the actions. In fact, the plugin is XML file, which can be installed on the site in the admin panel.

Consider uploading a ready-made plugin to the site. You can download and install a ready-made plugin on your site. By clicking the appropriate button, you can upload either an XML file with a plugin. Or a ZIP archive with a plugin. This allows you to create very complex plugins containing a large number of other additional files, both graphic and PHP files. In order not, for example, to describe all actions directly in the plugin itself, you can create additional files and pack them into an archive, putting them in new places. At the same time, it is important to know that the archive can contain only those PHP files, which are not included in the distribution kit, but only your additional files, if there are files included in the distribution kit, such downloading will be blocked. Modification standard files, you need to describe it already in the plugin itself. The XML plugin file itself should be located in the root of your archive.

If you download an archive with a plugin, and the DataLife Engine will not have the rights to write the files in your archive. It will automatically request FTP access in order to download your file. If no access is required, then everything will be copied automatically without them. Moreover, these accesses will not be stored anywhere, but will be automatically deleted after they are not needed.

The new plugin management system also has a built-in plugin error logging system. If any action on the files cannot be performed, or any errors occur, you can easily see and fix them. For example, this is extremely handy if your plugin is not compatible with next version DLE, you will quickly see that and the plugin can be easily adapted.

You can read about all the new features of DLE 12.1 in this article.

DataLife Engine v.12.1 Press Release will tell you about the add-on to the advertising module, now the module supports the function of headings, in this version you can keep track of the number of views of advertising materials and other add-ons related to advertising management.

A good one, perhaps using canonical links added in the code for all pages of the site, including navigation through sections, viewing the full news, etc. This is a trick to improve SEO optimization of projects, eliminate duplicate pages if incorrect links to your site are published somewhere on the Internet, or if for some reason it is necessary to disable the control of incorrect CNCs.

For security reasons, a function has been added to automatically protect the site from code uploading or inserting frames on third-party sites. When this setting is enabled, the display of your resource will be automatically blocked if it is embedded in an iframe on someone else's site. By doing this, you can protect your site from attacks such as clickjacking.

One more interesting function for SEO site optimization - this is the advanced capabilities of the "Meta tags" module, now it will be possible to set not only meta tags for pages, but also any separate title for the page and a description of the page, which you can later display anywhere in your template.

(Recommended)
Hosting with a free SSL certificate for site, modern equipment on SSD - one of the leaders in quality and low price... We read in this article.

By the way, if you need a high-quality one with a free SSL certificate, profitable tariff plan and a secure provider, this promo code provides 5% discount for ordering a domain and / or hosting

A460-09C2-059C-5161

For example about free hosting Without advertising and conditions powered by DataLife Engine 12-9.x or any other CMS - this service will help you understand within a month whether hosting is right for you or not.

We offer download DLE different versions on the http: //www. site in the section for everyone without registering (licensed versions of UTF 8 and Win 1251).

The main stage of development of version 12.1 has been completed, the release is under testing and pre-release preparation, but in the meantime, we invite you to familiarize yourself with the information about what awaits you with the release of the new version.

The following changes were prepared and implemented:

1. Added support for categories in the ad management module... You can create headings in this module and place your advertising materials in these headings. Categories are displayed at the very top, in front of the list of added advertising materials, in the form of folders. In the headings themselves, you can also create an unlimited number of additional sub-headings. Thus, with a large number of advertising materials, you can place them for ease of navigation through them, in various headings and subheadings.

2. Added the ability to track the number of views for advertising materials added to the script control panel. Views are recorded only for real users who entered the site using a browser. Bots crawling the site are not counted. Views counting is enabled directly for each banner, so you can count views only for the required advertising materials. You also have the option to specify whether you want to count all views of the banner, or count only views from unique users.


3. Added the ability to limit banner display for advertising materials in the admin panel based on the number of its views, and you can turn off the banner when the specified maximum number of views is reached.

4. Added the ability to track the number of clicks for advertising materials added to the script control panel. DataLife Engine automatically intercepts HTML tags published using tags and automatically keeps track of clicks on them. Any special design of these links is not required, they can lead to any addresses you need. You also have the option to specify whether you want to count all clicks on a link, or count only clicks from unique users.

5. For advertising materials in the admin panel, added the ability to limit the display of the banner based on the number of clicks on your banner, and you can turn off the display of the banner when the specified maximum number of clicks on it is reached.

7. Added use of canonical links, in the code of the pages, for all pages of the site including navigation through sections, viewing the full news, etc. This feature allows you to increase SEO optimization of sites, and also allows you to avoid duplicate pages if incorrect links to your site are published somewhere on the Internet, or if for some reason it is necessary to disable the control of incorrect CNCs.

8. In the category settings in the control panel, added the ability to set by default for a category whether it is allowed to publish news from this category on the main page of the site. These settings are in effect at the time of adding or editing a publication, and if publication on the main page is prohibited for a category, then the corresponding option is removed at the time of adding or editing a publication.

9.In the category settings in the control panel, added the ability to set by default for a category, whether comments are allowed for posts from this category. These settings are in effect at the time of adding or editing a publication, and if comments are disabled for a category, then the corresponding option is removed at the time of adding or editing a publication.

10.In the category settings in the control panel, added the ability to set by default for a category, whether the rating is allowed for publications from this category. These settings are in effect at the time of adding or editing a publication, and if the use of rating is disabled for a category, then the corresponding option is removed at the time of adding or editing a publication.

11.In the script settings in the control panel, in the security settings section, added the ability to enable automatic site protection against embedding into frames on third-party sites. When this setting is enabled, your site will be automatically blocked from showing if it is embedded in an iframe on someone else's site. By doing this, you can protect your site from attacks such as clickjacking.


12. The capabilities of the "Meta Tags" module have been expanded, this module has been renamed to "Titles, Descriptions, Meta Tags". Now in this module you can set not only meta tags for pages, but also a separate title for the page and a description of the page, which you can later display anywhere in your template. For this, new global tags for templates have been added: (page-title) - displays the title you specified for the page, (page-description) - displays the description you specified for the page. It is also allowed to use BB and HTML tags in the page description. Thus, using this module, you can, for example, create and display titles and descriptions for the tag cloud for each tag personally, etc.

13. Added new global template tags text that display the text enclosed in them if a title for the page being viewed has been set in the "Titles, Descriptions, Meta Tags" module. And also added opposite text tags that display the text enclosed in them if the title for the page being viewed has not been set. Similar tags were also added for descriptions: text that displays the text enclosed in them if a description for the page being viewed was set in the "Headers, descriptions, meta tags" module, text that displays the text enclosed in them if there was no description for the page being viewed given.

14. For the category menu template (categorymenu.tpl) added support for new tags text that display the text enclosed in them if the category or news viewed on the site does not belong to a category from the menu. This tag can only be used inside tags and is used, for example, to display some information (for example, links) only for inactive categories from the menu.

15. Expanded options for displaying publications based on the values ​​of additional fields in publications... When accessing the address http: // yoursite / xfsearch / field name / field value / publications will be displayed, as before, containing the specified value in this specific field, if the "use as cross-references" option is set for the field. When accessing the address http: // yoursite / xfsearch / field value /, publications containing this value for all additional fields will be displayed. When accessing the address http: // yoursite / xfsearch / field name / all publications in which this specified field is filled in will be displayed.

16. In the script settings, added the ability to assign a separate page with the name 404.html at the root of your site, to display pages for which there is no content. If this setting is enabled, instead of the standard system message "Unfortunately, this page is not available to you, its address may have been changed or it was deleted.", You can display a separate page specially prepared in advance, with a completely separate design. This innovation will be useful for webmasters who want to make a separate design for 404 pages of their site.

17. Added the ability to assign an HTTP header to the script settings, from where it is necessary to obtain the IP addresses of users. This innovation will be useful for sites that use various external proxy servers, and do not have the ability to properly reconfigure the server for them to get the correct real IP addresses of visitors. For example, when using the cloudflare service and others to protect against DDOS attacks and using a regular hosting plan without access to server settings. Now you can tell the script from where to get the IP address of site visitors in the script settings in the admin panel.

18. When deleting a category in the script control panel, added the ability to choose what to do with publications that are in this category. You can: "Remove this category from publications", "Replace the category with another or other categories", as well as "Delete all publications in this category". In this case, if a category is deleted or replaced from a publication, then only the deleted category will be removed or replaced. For example, if your publication is in the "World", "News", "Popular" categories, and you, for example, delete the "World" category, then for publications in this category, only the "World" category will be removed, or replaced, all other categories in the list for these publications will remain in place.

19. For publications added a new type of additional field: "Pure HTML and JS". When using this field, the DataLife Engine will not interfere with the text written in it, and will not filter the HTML code of this text, and also allows writing pure javascript code in it. This field will be useful when you need to insert some code into a news item that does not need to be checked for security, for example, any of your own player, etc. Attention, taking into account that the script will not filter the text from this field, when creating it, be sure to set restrictions on which groups are allowed to use it. Do not allow ordinary users whom you do not trust to use it, otherwise it may pose a threat to the security of your site.

20. For additional fields of publications that have the "Use as cross-references" option, added the ability to specify the delimiter for these links. You can specify both individual characters and HTML code as a separator. Previously, a comma was used as a list separator, now you can set your own personal separator for each field, which allows you to create a unique layout for each field in the template.

21. Added support for Yandex Turbo technology for regular RSS feeds, without using the inclusion in the settings of the type of RSS stream as "Yandex news", for this added support for displaying the full news tag (full-story) for any type of RSS stream. Also, the standard template /templates/rss.xml has been updated, which demonstrates how a template with full Yandex Turbo support should look like. Similarly, the ability to customize an RSS template for Yandex Zen technology is fully supported.



22. Added the ability to respond to comments when viewing all the latest comments on the site,
if the support for tree comments is enabled in the script settings. Thus, you can, for example, quickly respond to the comments received on the site, without going into every news at the same time., Due to the fact that some of the heavy scripts were transferred to a delayed and independent of the rendering of the page loading. These scripts are loaded into the browser in parallel with the rendering of the page and are launched only after the completion of the formation of the page in the browser. Which visually provides a faster page display.

24. Added the ability for unregistered users on the site, send complaints about news and comments to the administration of the site, just as such an opportunity previously existed only for registered users.

25. Added the use of schema org micro-markup for displaying a rating with the "Score" type. The use of this micro-markup allows for full news, when displaying them in Google search results, to display the publication rating as well.

26. Added automatic detection of the orientation of photos when they are uploaded to the server, based on meta information contained in graphic files. If the original photo was turned upside down, then when it is uploaded to the server, the script will also automatically unfold it to the desired position. This eliminates the need for additional editing of pictures on a computer, if the camera was turned while taking a picture.

27. Added the ability to automatically notify the site administration about the arrival of new news from users
, which is under moderation (if it is enabled in the script settings), if the news was added from the script control panel. Previously, the notification was sent only if the publication was added directly from the site.

28. If the user edits the publication in the control panel, which was previously already published on the site, but according to the settings of his group, it is forbidden to publish without moderation, or it is allowed to publish not in all categories, then the administration of the site will also be sent a corresponding e-mail notification that this news is awaiting moderation.

29. Changes have been made to the work of the Breadcrumbs module on the site. If you are viewing news from a certain category, then for the category in which the user is directly located, this category will be displayed in the form of plain text, and not a link. Only categories that are higher in the hierarchy will be displayed as a link, or there will be a link to this category if, for example, the user has gone further along the page navigation in this category. Thus, this innovation avoids cyclic links of pages to themselves.

30. For the module "Cross-references" in the control panel, added two new replacement areas for links. You can optionally specify replacement only in static pages, and you can also select replacement in static pages, news and comments.

31. For the module "Find and Replace" in the control panel, added the ability to bulk replace text in polls for publications and in polls on the site.


32. Added the ability to delete all publications awaiting moderation from a specific user. To do this, in the user management section, click on the number of its publications and select the appropriate menu item.

33. Added the ability to delete all comments awaiting moderation from a specific user. To do this, in the user management section, click on the number of his comments and select the appropriate menu item.


34. A formatted output of the number of different counters (views, publications, comments) has been added to the script administration panel. The output of these counters is carried out in a formatted form as separating hundreds, thousands, millions, etc. with a space. Which gives a more visual representation and perception of these numbers.

35. For templates for displaying comments and adding comments (addcomments.tpl and comments.tpl) added support for new tags text - displays text in the tag if the news belongs to the specified categories, as well as tags: text - displays text in the tag if the news does not belong specified categories. Thus, you can set a different design for displaying comments and adding comments for publications from different categories.

36. Added support for declensions for the tag displaying the number of votes that were exposed for the rating of publications. For example, you can use (vote-num) review || a | s. Previously, this was not available for this tag, since it contains HTML code, not just a number.

37. If the use of the site only via HTTPS protocol is enabled in the script settings, then cookies by the browser will also be sent to the server only via the HTTPS protocol and will be automatically blocked if the usual HTTP protocol is used.

38. Added control of invalid CNCs for static pages whose publication text is split into several pages. If an incorrect page number is specified, an automatic 301 redirect will be made to the starting address of this page.

39. For RSS import of publications, added support for importing images from the enclosure tag containing an image for publication. If the short description in the RSS stream is just text, and the picture is given in it as a separate tag, then the picture for this publication will also be added to the short news when importing at the very beginning.

40. Added support for redirects to receive full news when using RSS import of publications... If the link from the RSS feed is a redirect for further transition to the full text of the news on the source website, then DataLife Engine will automatically follow this redirect and will take content from the final source. Thus, receiving full news will be of better quality than before.

41. Changes have been made to the work of tags and... If the use and addition of comments is prohibited for a specific publication, then these tags will also hide the content in them.

42. If comments are allowed for publication, but at the same time the user or a group of users was prohibited from posting comments according to other settings, then a message about this will not be displayed at the end of all comments, but in the place where you define the output of the form for adding a comment with the tag (addcomments) in your template, thereby you can determine the location of this message on your site yourself.

43. For authorization using the Odnoklassniki social network, added the ability to automatically receive a user's E-mail, provided that the application itself has received the appropriate rights from Odnoklassniki. Attention, by default, Odnoklassniki does not give the right to receive E-mail, and to obtain appropriate access, you need to additionally contact the social. network for permission to receive e-mail. If permission is granted, then DLE will also automatically import the e-mail address.

44. Improved the system for calculating the proportions of the image when creating small copies... Thus, a more correct and high-quality reduced copy is created.

45. Improved publication search system when the script is enabled in the settings, a simple type of search. The new algorithm makes it possible to find publications more accurately and correctly.

46. ​​Improved control system for the appearance of duplicate pages when viewing all the latest comments on the site.

47. Optimized processing of additional fields of publications when displaying short publications, as well as when the module for displaying popular publications is running.

48. Updated visual editors TinyMCE and Froala to the latest versions... A number of detected errors in these editors have been fixed.

49. Added support for inserting hidden text tags for the TinyMCE editor, using the corresponding button in the editor.

50. When using the Floara editor for comments, added the ability to quickly load and insert images into a comment. You can either click on the icon to insert a picture and select a file to upload, or simply transfer the picture file from the computer to the editor field with the mouse, after which the picture will be automatically loaded and inserted at the cursor position in the editor.

51. Small changes have been made in the layout of the script control panel aimed at eliminating some layout errors and improving interaction with the control panel.

52. Updated to up-to-date versions of the library for sending mail from the site as well as a mobile device definition library.

53. Fixed the problem when in the preview of publications the tags and were not processed.

54. Fixed a problem with incorrectly formed meta tags for social... networks of video and audio, if the video was published in add. fields and consisted of playlists and descriptions of video and audio files.

55. The problem is fixed, when under certain situations and server settings the preview of publications could not work when adding publications from the site.

56. Fixed problem where dynamic loading of comments did not work if this is enabled in the script settings, and the (jsfiles) tag is placed at the very bottom of the site.

57. Fixed a problem where the display of the latest comments did not work, if viewing of some categories was prohibited for a certain group.

58. The detected and previously announced small errors in the script have been fixed.

Hello. I want to devote this topic to the creation of the simplest module for the popular CMS Datalife Engine ... In Russia, as well as in the CIS countries, it is quite popular, however, for some reason, there are still no articles about this cms on the hub. I will try to correct this misunderstanding. In this article, you will learn how to make the simplest module for this CMS, as well as get acquainted with the structure of the engine.

Introduction

I would like to note that the system is in demand among entertainment sites. It is understandable, the system is easy to use, has a sufficient number of modules and templates. And almost everything you need is out of the box. However, it happens that something is missing. We will try to solve this problem.

Why DLE?

You are probably wondering why I chose this particular CMS. The answer is simple: a fairly logical structure of the engine itself, separation of templates from code, a fairly simple template engine, again, a fairly logical placement of everything inside - it's easy to figure out what's what. Plus, the system remains relatively light and comfortable. It is not as functional as, for example, Drupal, but still I like it.

Structure

First, we need to know a thing or two about the structure of the engine. You can't create a mess on the server, so we'll keep everything in our folders.

It is customary to place modules for the engine in a folder / engine / modules /.

In the folder / engine / inc / the admin panel files are located.

Starting with version 8.x, it has been possible to connect modules directly in the template. The template is located in the / templates / template_name / folder. There is a main.tpl file in this folder This is the root file of the template, usually it contains the main structure of the template. Usually the module can be connected like this:

(include file = "engine / modules / mod_category.php")

Where mod_category.php is a file located in the / engine / modules / category. I think everything is clear with this, let's move on.

Let's make a module to display the latest comments with caching. To do this, create a file in the / engine / modules / folder and name it mod_lastcomm.php Next, I give a listing of the code of this file with detailed comments.

The code

DATALIFEENGINE". This constant is defined in index.php and its TRUE value symbolizes that the file is included using include / require, and not just running. * / If (! Defined (" DATALIFEENGINE ")) (die (" Hacking attempt! ");) / * We include the api class so that we can use functions for working with the cache. * / Include (" engine / api / api.class.php "); / * We are trying to read the information stored in the cache from name lastcomm I recommend giving meaningful names to everything we store in the cache. lastcomm Is the file in the folder / engine / cache /, a 60 Is the cache lifetime in seconds. In this case, if more time has passed since the creation of the file than 60 seconds, then we will have to go into the database again. * / $ lastcomm = $ dle_api-> load_from_cache ("lastcomm", 60); / * We check if we have a cache or not. If not, then we climb into the database. * / if (! $ lastcomm) (/ * The actual query in the database. It is performed using the function of the class $ db. The PREFIX constant contains the prefix specified during the cms installation. The names of the columns are quite normal, I think there is no need to explain what they do. Enter the query identifier into the $ sql variable. * / $ Sql ​​= $ db-> query ("SELECT comments.post_id, comments.text, comments.autor, post.id, post.flag, post.category, post.date as newsdate , post.title, post.alt_name FROM ". PREFIX." _comments as comments, ". PREFIX." _post as post WHERE post.id = comments.post_id ORDER BY comments.date DESC LIMIT 0.20 "); / * С using the get_row () function of the $ db class, we read sequentially each row from the selection results. The information is entered into the $ row array with indices equal to the names of the table fields * / while ($ row = $ db-> get_row ($ sql)) (/ * If necessary cut news title * / if (strlen ($ row ["title"])> 50) ($ title = substr ($ row ["title"], 0, 50). "...";) else ($ title = $ row ["title"];) / * Form with a link to the user profile. Likewise * / $ aname = urlencode ($ row ["autor"]); $ name = " ". $ row [" autor "].""; / * Form the comment text and cut it off if necessary * / $ text = htmlspecialchars ($ row [" text "]); if (strlen ($ text)> 1024) $ text = substr ($ text, 0, 1024) . "..."; / * Form a link to the news. The $ config array contains all the system settings. In particular, $ config ["http_home_url"] is the domain url. * / $ Newslink = $ config ["http_home_url"]. $ row ["post_id"]. "-". $ row ["alt_name"]. ". html"; $ hint = "onMouseover = \" showhint ("$ text", this, event, ""); \ "" ; $ title = "(! LANG: ".stripslashes ($ title).""; / * Final post for one comment * / $ lastcomm. =" From $ name in news:
$ title

";) $ db-> free (); / * We cache the received data. To better understand the caching functions, open the file" engine / api / api.class.php "everything is perfectly commented out there * / $ dle_api-> save_to_cache (" lastcomm ", $ lastcomm);) / * Print the result * / echo $ lastcomm;?>

Conclusion

This code is completely working. And of course it has its drawbacks. For example, it is not checked for links - whether the CNC is enabled. Or, when clicking on the link to the user's profile, we get directly to his profile, and not to the jQuery window with brief information. In general, there is something to improve. But all these things were not included here for one reason - to prevent the beginner from getting confused. I also advise you to analyze other files, for example topnews.php. If you have any questions about writing modules or about the system in general, I will be happy to answer them.

That's all for me, if this topic seems interesting to someone, then I will make a series of articles about cms Datalide Engine (DLE).

Oh yes, this is my first article on Habré, so sorry if something goes wrong.