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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:45:50
Script start
Timing: Jan 18 2025 11:45:50
Module start 'layout'
Timing: Jan 18 2025 11:45:50
Module start 'content'
Timing: Jan 18 2025 11:45:50
Module end 'content'
Timing: Jan 18 2025 11:45:50
Script end

Main resources:

Total runtime0.6665 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.6797152.6250
Module start 'layout' 0.00560.0030 742.304739.4453
Module start 'content' 0.00860.6566 781.7500595.5078
Module end 'content' 0.66520.0013 1,377.257812.1641
Script end 0.6664  1,389.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5083160.0002
Check MTime0.00150.2185160.0001
Mysql Total
Database connection0.00070.107010.0007
Mysqli_queries0.615092.2721620.0099
Looping result0.00050.0775600.0000
Template Total0.636395.520.3181
Template load0.00240.355220.0012
Template processing0.633995.116320.3170
Template load and register function0.00020.035010.0002
states
state_id_array0.00130.201710.0013
state_identifier_array0.00080.119420.0004
Override
Cache load0.00210.3082280.0001
Sytem overhead
Fetch class attribute can translate value0.00060.089130.0002
Fetch class attribute name0.00180.273260.0003
XML
Image XML parsing0.00120.174930.0004
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00100.1464230.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs