Display comment count..

Author Message

juan uribe

Tuesday 10 March 2009 3:21:38 pm

what is the correct way to code (count the number of comments) for a given article.

example http://www.lanacion.com.co/

right now I have put message "be the first to comment" (sea el primero en commentar) but this shows up all the time even if an article has many comments. I want the message to be eighther "be the first to comment" or it has 10 comments then "10 comments..."

Is this possible, thanks,

juan uribe

Thursday 12 March 2009 10:24:59 am

we are now using the following code

        {section show=$currentnode.data_map.enable_comments.content}
                {let $comments=fetch_alias( comments, hash( parent_node_id, $currentnode.node_id ) )}
            <a href={$currentnode.url_alias|ezurl()}>
                        {if gt($comments|count,0)}
                    Comments ({$comments|count})
                    {else}
                    Be the First to Comment this Article !
                    {/if}
            </a>
        {/section}

If any one has any idea on how to work with the cache system so that I don't have to manually update cache every 15 min?

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 04:12:15
Script start
Timing: Jan 18 2025 04:12:15
Module start 'layout'
Timing: Jan 18 2025 04:12:15
Module start 'content'
Timing: Jan 18 2025 04:12:15
Module end 'content'
Timing: Jan 18 2025 04:12:15
Script end

Main resources:

Total runtime0.1520 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9375152.6250
Module start 'layout' 0.00590.0062 740.562539.4453
Module start 'content' 0.01210.1383 780.0078426.5938
Module end 'content' 0.15030.0016 1,206.60168.1641
Script end 0.1519  1,214.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.3248160.0002
Check MTime0.00150.9566160.0001
Mysql Total
Database connection0.00080.520610.0008
Mysqli_queries0.111773.5202540.0021
Looping result0.00050.3460520.0000
Template Total0.107370.620.0536
Template load0.00221.449820.0011
Template processing0.105169.142220.0525
Template load and register function0.00020.163810.0002
states
state_id_array0.00110.722510.0011
state_identifier_array0.00261.731220.0013
Override
Cache load0.00181.1788110.0002
Sytem overhead
Fetch class attribute can translate value0.00080.517910.0008
Fetch class attribute name0.00090.623420.0005
XML
Image XML parsing0.00010.071110.0001
class_abstraction
Instantiating content class attribute0.00000.003820.0000
General
dbfile0.00090.6006100.0001
String conversion0.00000.007840.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs