For a long time did not write anything on Habré - was busy. During this time, much has been done, but even more in the plans. But yesterday, I released a new component, Tickets , to create a technical support system. It is clear only in MODX Revolution.
The principle is simple - the user asks a question and gets answers in the comments.
In the process, it turned out that the system can, in general, be used for sites with user-generated content, such as a simple LiveStreet ( video with a demonstration of work at the end of the post ). So what are the possibilities at the moment? ')
Own types of resources.
All tickets are stored in resources, but they have their own classes that inherit modResource . This makes it possible to organize separate rules for creating / modifying / outputting them and even their own pages in the manager.
For example, tickets are not shown in the resource tree (and do not inhibit it, by their quantity), all of them are managed from the special page of the ticket section. Comments are also displayed there for management.
If you’ve seen Articles , the blogging extension from MODX authors, it’s done in much the same way.
Creating \ editing pages from the frontend
Here it is clear, the main functionality. Used by the wonderful editor MarkItUp . A set of buttons and their work can be set in the system settings.
Own quick ajax-comments, with control in the admin panel.
Comments on this are half the job. For MODX Revolution, there is exactly one commenting system - the terribly slow Quip , with which I initially wanted to become friends. He wrote his classes, which expanded Quip and made it possible to work through Ajax. Everything was going well, until I put it on my website, and I did not understand that it was terribly slow. The topic with 315 comments opened 10 -12 seconds, without a cache.
Therefore, I had to strain and add comments to an independent state, without dependencies on Quip. This is how the second commenting system for MODX Revolution appeared. Habr and LiiveStreet comments were taken as a sample.
A page with 315 comments now opens in 0.6 seconds without a cache. I haven't even screwed it yet.
Security Policy Support
There is nothing special to tell here - the Revolution rights system is used, which does everything for me. The installation package adds its permissions and policies, which can then be used.
Separately, the rights to work with tickets “in general” are given, and to create them in a specific section. There is also permission to create a comment.
Separate cache engine
The main complaint about MODX is the constant clearing of the cache with any bunch in the manager. It is clear that caching in Revolution is very cool and it is impossible to otherwise clear all possible links of the updated resource. But on a website with a couple thousand resources, this becomes a real headache. Considering that users can edit their tickets - the site will simply be a stake for serious numbers.
Therefore, when updating the ticket in the admin panel or the frontend, only the cache of this particular ticket and its parent page (ticket section) is cleared. Everything else can be cleaned by the plugin on the OnDocFormSave event, if necessary.
Jevix to filter when displaying
First of all, the extension is intended for user-created content. And they can cram us all XSS and other dirty tricks.
This question is thoughtfully dealt with by an excellent Jevix , the rules of which are configured by separate sets of parameters. Moreover, separately for the ticket and comment.
If you do not have this extension for filtering and printing, Tickets will automatically download and install it. Without Jevix, you can not work yet
Well, even the little things:
Post notifications about comments to the author of the ticket, and those who responded to his comment.
The output of the latest comments and tickets, broken down by section and the possibility of caching.
Complete snippets for competent cutting and filtering text, as well as counting the number of comments of the ticket.
All the necessary design chunks, the prescribed parameters for snippets, 2 languages - Russian and English.
In total, this job took me about 40 days. Pure time, approximately 140 hours. Video installation and setup of Tickets on a clean site.
This is the first public beta, the version is quite early - but quite stable.
I can not fail to mention the kind studio Simple Dream , who ordered this extension, paid for it, and post it for free in the repository .