I’d like to allow the world (not logged in and not signed in people) to post comments and,
and as the site’s manager publishing them after aproval, is that possible??
-
MODX Staff
- 12,272 Posts
Comments are stored in the [*content *] area of a regular page, delineated by a special divider and with some extra header information. This could be a pretty cool implementation if we can get this to work. Please have a go at it!
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Cool,
glad to have a programmer interested in improving our current snippets.
Although I have not yet had a chance to try ModX, I looked at the snippet code for the comments and perhaps some parts of a user comments snippet I have would work to achieve the results you are seeking. I am not at all familiar with how ModX works but looking at the snippet code in the install folder, the following should work...
The simplest way would be to add a setting, for example name it $autopublish. Then have it set to either yes or no. Then add an if/else statement to the part of the code that creates the document. If it is set to yes, set the publish variable to 1, if it is set to no then make the publish setting to 0. If it set to no, then I also added the option to send the admin an internal mail to notify them that there is a new entry that needs validation before publishing.
I have attached the user_comments code and it is documented so you can see what it all does and grab the parts you need...
Thanks Mark, I was impressed with the demo and figured I’d try out ModX...
-
☆ A M B ☆
- 24,524 Posts
The block for a new comment would have to be flagged, and the manager would have to scan the whole page to find, then examine the flagged block, then change the flag to "approved". The comment parser would then have to check that flag and skip the block if the flag were not set to "approved".
Or..have a page that the manager has to log in to, with a variation on the snippet that opens the comments document but only displays the new comment blocks? With QuickEdit enabled for the page (maybe a separate template for this?), it would be the work of an instant to remove bad comments entirely or edit the flag to approve it.
I’m wondering what would happen if an article generated hundreds or thousands of comments? Does the snippet have some kind of limit built-in to automatically close commenting after a certain number?