Changeset 16106


Ignore:
Timestamp:
Jun 27, 2012, 11:14:46 PM (8 years ago)
Author:
mistic100
Message:

an try to not delete an image subscription when a category with the same id is deleted!!!!

Location:
extensions/Subscribe_to_comments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php

    r16105 r16106  
    379379  $query = '
    380380DELETE FROM '.SUBSCRIBE_TO_TABLE.'
    381   WHERE element_id IN ('.implode(',', $ids).')
     381  WHERE
     382    element_id IN ('.implode(',', $ids).')
     383    AND type = "image"
    382384';
    383385  pwg_query($query);
    384386}
     387function stc_delete_categories($ids)
     388{
     389  $query = '
     390DELETE FROM '.SUBSCRIBE_TO_TABLE.'
     391  WHERE
     392    element_id IN ('.implode(',', $ids).')
     393    AND (type = "album" OR type = "album-images")
     394';
     395  pwg_query($query);
     396}
    385397
    386398
  • extensions/Subscribe_to_comments/main.inc.php

    r16105 r16106  
    4545  // items deletion
    4646  add_event_handler('begin_delete_elements', 'stc_delete_elements');
    47   add_event_handler('delete_categories', 'stc_delete_elements');
     47  add_event_handler('delete_categories', 'stc_delete_categories');
    4848
    4949  // profile link
Note: See TracChangeset for help on using the changeset viewer.