Forums / Developer / Fetching notification count by object / Comment45081
Norman Leutner
Wednesday 11 January 2006 8:01:48 am
Thanks a lot, I made a small template operator extension:
{$node.node_id|count_notification()} function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, &$currentNamespace, &$operatorValue, &$namedParameters ) { switch ( $operatorName ) { case 'count_notification': { $db =& eZDB::instance(); $query = "SELECT count( DISTINCT a.user_id ) as count FROM ezsubtree_notification_rule a, ezcontentobject_tree b WHERE b.node_id=".$operatorValue." AND b.path_string like concat( '%/', a.node_id , '/%' )"; $countResultArray = $db->arrayQuery( $query ); $operatorValue=$countResultArray[0]['count']; } break; } }
Mit freundlichen Grüßen Best regards Norman Leutner ____________________________________________________________ eZ Publish Platinum Partner - http://www.all2e.com http://ez.no/partners/worldwide_partners/all2e_gmbh