Most commented

Author Message

Ivo Lukac

Monday 27 July 2009 8:36:20 am

Does anybody has solution to implement "most commented" feature?
Some operator which can sort nodes by subnodes count maybe?

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

André R.

Monday 27 July 2009 8:49:42 am

Its a filter, but could be a starting point:
http://svn.projects.ez.no/ezcore/trunk/ezcore/classes/nodehaschildrenfilter.php

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Ivo Lukac

Monday 27 July 2009 9:01:48 am

Interesting.

Now I only need to figure out how to sort it :)

Thanks

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

Ivo Lukac

Monday 27 July 2009 9:20:49 am

Here we go (if somebody else need it):

<?php
class NodeChildrenCountFilter
{
    function NodeChildrenCountFilter()
    {
    }

    function createSqlParts( $params )
    {

        return array('tables' => '', 'joins' => '', 'columns' => ', ( SELECT count(*) FROM ezcontentobject_tree ezcontentobject_tree_2  WHERE ezcontentobject_tree_2.parent_node_id = ezcontentobject_tree.node_id) AS children_count ');
    }
}
?>

Just need to put this extended filter in fetch and sort it by children_count DESC

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

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

Main resources:

Total runtime1.0151 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.7891152.6094
Module start 'layout' 0.00500.0031 740.398439.4063
Module start 'content' 0.00821.0055 779.8047559.5156
Module end 'content' 1.01360.0014 1,339.320312.2031
Script end 1.0150  1,351.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3035160.0002
Check MTime0.00140.1401160.0001
Mysql Total
Database connection0.00100.094010.0010
Mysqli_queries0.964194.9807600.0161
Looping result0.00050.0528580.0000
Template Total0.985697.120.4928
Template load0.00220.216220.0011
Template processing0.983496.876520.4917
Template load and register function0.00010.008510.0001
states
state_id_array0.00120.118910.0012
state_identifier_array0.00110.109620.0006
Override
Cache load0.00190.1855200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.065720.0003
Fetch class attribute name0.00180.175560.0003
XML
Image XML parsing0.00100.100320.0005
class_abstraction
Instantiating content class attribute0.00000.001680.0000
General
dbfile0.00100.0954240.0000
String conversion0.00000.000640.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs