How to remove notifications from all users?

Author Message

zurgutt -

Monday 02 November 2009 12:39:55 pm

Anyone knows how to remove notification subscription from all users who have managed to click on button before cronjob was set up? I have cleared the notificationevent table but want to remove old registrations too.

Its a deathtrap btw, it should not be possible to subscribe before that cronjob is set up, managed to kill the job when only few hundred was sent out, there was thousands in queue.. I hope that button is not there in forum anymore in 4.2?

EDIT: it seems clearing ezsubtree_notification_rule table should help, let me know if this could create any problems.

Certified eZ developer looking for projects.
zurgutt at gg.ee

Romain Petit

Saturday 07 November 2009 4:03:42 am

Hi,

Subscription date is not stored, you have no way to filter notification rules by subscription date.

PS :You should not manually accessing tables, you may be able to remove all notifications by doing something like that :

$db = eZDB::instance();
$rows = $db->arrayQuery('SELECT DISTINCT content_object_id FROM ezuser WHERE 1');
foreach( $rows as $row )
{
    eZSubtreeNotificationRule::removeByUserID($row['content_object_id']);
}

Good luck !

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 02:06:48
Script start
Timing: Jan 18 2025 02:06:48
Module start 'layout'
Timing: Jan 18 2025 02:06:48
Module start 'content'
Timing: Jan 18 2025 02:06:49
Module end 'content'
Timing: Jan 18 2025 02:06:49
Script end

Main resources:

Total runtime0.5938 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.0066 589.4688152.6406
Module start 'layout' 0.00660.0035 742.109439.4766
Module start 'content' 0.01010.5822 781.5859521.8828
Module end 'content' 0.59230.0014 1,303.46888.2813
Script end 0.5937  1,311.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5563160.0002
Check MTime0.00140.2317160.0001
Mysql Total
Database connection0.00060.109110.0006
Mysqli_queries0.551792.9156540.0102
Looping result0.00050.0761520.0000
Template Total0.564295.020.2821
Template load0.00230.394620.0012
Template processing0.561894.617320.2809
Template load and register function0.00010.017510.0001
states
state_id_array0.00090.159310.0009
state_identifier_array0.00080.130320.0004
Override
Cache load0.00190.3218130.0001
Sytem overhead
Fetch class attribute can translate value0.00070.124620.0004
Fetch class attribute name0.00150.245530.0005
XML
Image XML parsing0.00060.094820.0003
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00080.1344170.0000
String conversion0.00000.001840.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs