Forums / General / blog comments hidden by default

blog comments hidden by default

Author Message

Mirko Battisti

Monday 15 June 2009 6:36:56 am

We are implementing a blog connected to a website we're developing.
We started from the classes and templates found in ezwebin.
The default way is to allow comments only to registered users. If I give anonymous user the permission to create comments, then everybody can comment. But there is no filter, no moderation of any kind, so that the comments are visible on the website.
Is there a way to make comments hidden by default?

I was thinking about adding an attribute to the comment class, and check that attribute before showing the comment, but I think that hide/show is easier for the moderator.

Another thing: I would like to show the comment form straight after the blog post.
What I don't totally get is how the creation of the object (comment) works: I'm not sure where it gets its ID from once the comment form is submitted, and what happens if the submission fails (I would like the user to see the error message on the blog post page and not on the comment page - in fact I wouldn't have a comment page at all). Is it feasable?

Thanks in advance,
Mirko.

Jean-Luc Nguyen

Wednesday 17 June 2009 12:56:57 am

Hello,

I don't know if you can hide objects by default, but you can:

- As you said, add an attribute to the comment class, "status", with values "waiting for validation, validated, rejected".

- Use the workflow module, where the admin can approve / reject the comments.

http://www.acidre.com

Ivo Lukac

Wednesday 17 June 2009 1:08:51 am

If you want to make object hidden after first publish you can do it adding next lines under form tag in your edit template:

{if $edit_version|eq(1)}
	<input name="FutureNodeHiddenState_{$main_node_id}" type="hidden" value="hidden" />
	<input type="hidden" name="MainNodeID" value="{$main_node_id}" />
{/if}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Mirko Battisti

Thursday 18 June 2009 5:05:13 am

Thanks Ivo,
I've tried your suggestion and it works fine.

And thanks Jean-Luc, your solution is probably more elegant. I haven't tried it yet, but I'm planning to look into the creation of an approval workflow.

Thank you very much!
Mirko.

eZ debug

Timing: Jan 18 2025 05:08:17
Script start
Timing: Jan 18 2025 05:08:17
Module start 'content'
Timing: Jan 18 2025 05:08:17
Module end 'content'
Timing: Jan 18 2025 05:08:17
Script end

Main resources:

Total runtime0.1562 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 587.7031180.8438
Module start 'content' 0.00690.0054 768.546997.9609
Module end 'content' 0.01230.1438 866.5078527.2734
Script end 0.1561  1,393.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00432.7467200.0002
Check MTime0.00211.3147200.0001
Mysql Total
Database connection0.00090.576910.0009
Mysqli_queries0.112972.29521410.0008
Looping result0.00100.66301390.0000
Template Total0.143391.810.1433
Template load0.00171.093710.0017
Template processing0.141690.669910.1416
Override
Cache load0.00140.876610.0014
Sytem overhead
Fetch class attribute can translate value0.00070.477710.0007
XML
Image XML parsing0.00030.183010.0003
General
dbfile0.00352.2504200.0002
String conversion0.00000.005030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs