Howto filter out hidden nodes in ezflow

Author Message

Georg Schröder

Tuesday 19 May 2009 6:01:47 am

Hello,
can anyone tell me how to filter out hidden nodes in the fetch-function of ezFlow?
Obviously the function

eZContentObjectTreeNode::subTreeByNodeID( $subTreeParameters, $nodeID )

ignores, if a node is visible or not.

Here is the complete code:

----------------------------------------------------------------------------

class fetchtopnews extends eZFlowFetchInterface
{
function fetch( $parameters, $publishedAfter, $publishedBeforeOrAt )
{
if ( isset( $parameters['Source'] ) )
{
$nodeID = $parameters['Source'];
$node = eZContentObjectTreeNode::fetch( $nodeID, false, false ); // not as an object
}
else
{
$nodeID = 0;
}

$subTreeParameters = array();
$subTreeParameters['AsObject'] = false;
$subTreeParameters['SortBy'] = array( 'published', false );
$subTreeParameters['Limit'] = isset( $parameters['Limit'] ) ? $parameters['Limit']:false;
$subTreeParameters['Depth'] = isset( $parameters['Depth'] ) ? $parameters['Depth']:false;

if ( isset( $parameters['Class'] ) )
{
$subTreeParameters['ClassFilterType'] = 'include';
$subTreeParameters['ClassFilterArray'] = explode( ';', $parameters['Class'] );
}

$subTreeParameters['AttributeFilter'] = array( array('article/top_news', '=', 1 ) );

$result = eZContentObjectTreeNode::subTreeByNodeID( $subTreeParameters, $nodeID );
$fetchResult = array();

foreach( $result as $item )
{
$fetchResult[] = array( 'object_id' => $item['contentobject_id'],
'node_id' => $item['node_id'],
'ts_publication' => $item['published'] );
}
// shuffle($fetchResult);
return $fetchResult;
}
}
----------------------------------------------------------------------------
Please help!

Thanks a lot!

Georg

Bin LIU

Tuesday 19 May 2009 6:27:45 am

 $params["IgnoreVisibility"] = true


$list = eZContentObjectTreeNode::subTreeByNodeID( $params, 2222222 )

:-;

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

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

Main resources:

Total runtime0.1498 sec
Peak memory usage4,096.0000 KB
Database Queries56

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.1953152.6406
Module start 'layout' 0.00550.0044 741.835939.4766
Module start 'content' 0.01000.1383 781.3125536.0938
Module end 'content' 0.14820.0016 1,317.406312.1328
Script end 0.1498  1,329.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.3046160.0002
Check MTime0.00140.9479160.0001
Mysql Total
Database connection0.00080.538110.0008
Mysqli_queries0.093162.1604560.0017
Looping result0.00060.4327540.0000
Template Total0.107371.620.0536
Template load0.00191.285620.0010
Template processing0.105470.321720.0527
Template load and register function0.00010.084710.0001
states
state_id_array0.00624.152510.0062
state_identifier_array0.00140.955020.0007
Override
Cache load0.00171.1255540.0000
Sytem overhead
Fetch class attribute can translate value0.00050.312420.0002
Fetch class attribute name0.00171.162230.0006
XML
Image XML parsing0.00070.491320.0004
class_abstraction
Instantiating content class attribute0.00000.005130.0000
General
dbfile0.00120.7881150.0001
String conversion0.00000.008040.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
6content/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
1content/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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs