Fetching notification count by object

Author Message

Norman Leutner

Tuesday 03 January 2006 7:24:01 am

Can anyone give me a hint how to fetch the number or list of users which have added a specific object to thier notification list?

Thanks in advance

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Friday 06 January 2006 2:22:33 am

As far as I can see, there is no specific function to fetch the count for a specific object within the /kernel/notification/function_definition.php

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Kåre Køhler Høvik

Friday 06 January 2006 2:47:20 am

Hi

You can get the # of subtree notifications to a specific node using this SQL (mysql):

SELECT count( DISTINCT a.user_id ) as count FROM ezsubtree_notification_rule a, ezcontentobject_tree b WHERE b.node_id=NODE_ID AND b.path_string like concat( '%/', a.node_id , '/%' );

( replace NODE_ID with you node ID. )

Kåre Høvik

Marco Zinn

Friday 06 January 2006 3:10:24 am

If you just need this "once in a while": I have an SQL-statement which does print a list of all users and their "notification nodes" for ez 3.4. I think, this should work for 3.5+, too.
But you'll need some access to your DB for this, of course.

Marco
http://www.hyperroad-design.com

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

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

Main resources:

Total runtime1.1787 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.2578152.6250
Module start 'layout' 0.00520.0027 741.882839.4453
Module start 'content' 0.00791.1693 781.3281606.9609
Module end 'content' 1.17730.0014 1,388.289116.1563
Script end 1.1787  1,404.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2537160.0002
Check MTime0.00120.1045160.0001
Mysql Total
Database connection0.00080.067310.0008
Mysqli_queries1.115094.5914650.0172
Looping result0.00070.0595630.0000
Template Total1.151097.620.5755
Template load0.00170.148120.0009
Template processing1.149397.500720.5746
Template load and register function0.00020.020410.0002
states
state_id_array0.00060.054010.0006
state_identifier_array0.00110.097620.0006
Override
Cache load0.00150.1256230.0001
Sytem overhead
Fetch class attribute can translate value0.00080.064630.0003
Fetch class attribute name0.00170.147880.0002
XML
Image XML parsing0.00640.546130.0021
class_abstraction
Instantiating content class attribute0.00000.0016100.0000
General
dbfile0.00700.5940280.0003
String conversion0.00000.000540.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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