📜 ⬆️ ⬇️

Installing LivestreetCMS on MODX Revolution from the package in 10 clicks

image I have written more than once about my modLivestreet module for a MODX Revolution + LivestreetCMS bundle (In this topic , the idea and implementation with schemas, etc.) is detailed.
After almost two weeks from the beginning of the development of the module, I came to the following conclusion: everything is too complicated. The idea itself is simple: to fasten LivestreetCMS to MODX Revolution (which historically lacked modules for building blogs), in order to get a sort of social network with good functionality.

I quickly added the first packet, and he completely provided the redirection of requests to Livestreet and the output of content to MODX. But then I wanted to implement synchronous work with users of MODX- and LS-., Then something else ... In general, the functionality grew, the code also. Problems manifested themselves in the difficulties of setting up this union. If you can say no serious problems with MODX (in any case, you didn’t have to touch a single byte of the engine code), then everything turned out to be more difficult with Livestreet ... One way or another, you had to go into the code. Of course, I understand that some things can be done by overloading classes in my plugin, but this is only a private solution to the problem. Yes, and some moments do not overload, as for example the case with the Jevix class. But these are not important details. The main thing - setting up this whole thing requires a lot of manual work. When I wrote the manual for installing and configuring the whole of this business, I was completely puzzled ... It seems not much, but still more than nothing.

So anyway, yesterday I decided to change the policy. I decided to build such a package for MODX, which already has a fully configured Livestreet, and installing which we already have a ready extension for social programs.
Nevertheless, the module itself can also be used independently (for example, by changing the settings of Livestreet in the system settings for different contexts, you can get work with several Livestreet sites at once). In general, the module is quite suitable for a bunch of already existing Livestreet sites (in this case, you will have to use manual settings in the manual).
')
So how is the installation going?
1. Downloading the package for MODX Revolution (for synchronous work with users, a version not lower than 2.2.0 is required, if only content is given, then earlier versions can be used).
2. Fill it in / core / packages / and install locally (sorry, until you are allowed into the MODX repository).
Who are interested in the pictures of the installation process, they are here










3. After the package is installed, simply insert the [[! ModLivestreet.run]] snippet into the starting document we need (with an empty template. Or create a template with this snippet), that's all.
For those who have never done this




That's all :-)
Go to the page, and see Livestreet :-)


In the future, this project will be developed in this direction (package with ready Livestreet). It seems to me right. Who needs to quickly and simply - is already there. Do you want tuning? The module itself is completely independent, without problems, finish to your Livestreet. Useful info is on the offsite .

And finally, a small FAQ.

And if I do not want Livestreet right on the main one to hang out? If I want it to be somewhere in the / forum / section?
Just go into the MODX system settings (hereinafter the modLivestreet namespace), and change modLivestreet.url_prefix / to / forum / (or whatever you need).
Everything, this section will be for Livestreet basic. Just do not forget to make the main page with the modLivestreet.run snippet for this section.

And if I want on a separate domain, such as forum.moysite.com?
Create a new context in MODX, have a main page with a modLivestreet.run snippet, attach a URL to this context in MODX and that's it. If you want Livestreet links to lead to the domain forum., And Wayfinder, etc. Formed links to the main site, then set the context for site_url - the main domain, and the modLivestreet.site_url setting specify the forum domain. True, you still need to change the Wayfinder settings, so that it forms full URLs, but these are trifles and do not apply directly to the module.

Will MODX tags work if I insert them into Livestreet templates?
Yes, they will. All Livestreet content is processed before output by the MODX parser.

But what about security? And if someone writes MODX tags to the topic (snippet, system setting, etc.)?
Taki do not be afraid. All security measures taken. All requests to the server are cleaned, and the square brackets of the MODX tags are replaced with codes, so there is someone who writes something and sees exactly what he wrote.
But there is one big BUT: if you linked Livestreet with MODX, then do not display it in its pure form without a bundle with MODX, since MODX performs tag cleaning, and if someone writes tags in LS, then they will be processed in MODX .
Later the cleaner will be written on the side of Livestreet.

And what tips to optimize give?
The most important advice is to set up rewrite rules on your server. In the basic configuration MODX completely banishes all the statics Livestreet through itself.
I have nginx and the rules are written like this
location /templates/{ root /www/site.ru/public_html; access_log off; expires 30d; } location /uploads/{ root /www/site.ru/public_html; access_log off; expires 30d; } location ~/engine/.*\.js{ root /www/site.ru/public_html; access_log off; expires 30d; } 
That is, physically Livestreet can be completely outside of DOCUMENT_ROOT.
In general, for sure you will understand.

And what is "Synchronous work with users"?
In MODX, its users, in Livestreet - its own. In normal mode, Livestreet does independent work (the user is registered - he is only in Livestreet, he is logged in - he himself).
In synchronous mode, everything works synchronously: registered - there is also in Livestreet, there is also in MODX (even if you created a user through the MODX admin panel), logged in - your Livestreet user and MODX logged in, where did the error occur? - completion of the process both there and there (that is, if the password is incorrect for at least one user, none of them can enter).
By default, synchronous mode is disabled. You can enable it by changing the modLivestreet.sync_users setting
By the way, in the installed Livestreet admin:
login: admin
pass: admin

But if ....?
All, all other questions in the comments.

Source: https://habr.com/ru/post/156889/


All Articles