• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • Gallery
  • Bugs
Gallery

E-mail notifications for comments sent when it's spam

Intuitive web based photo gallery

Brought to you by: bharat, ckdake
  • Summary
  • Files
  • Reviews
  • Support
  • Mailing Lists
  • Tickets ▾
    • Translations
    • Patches
    • Bugs
    • Feature Requests
  • News
  • Code
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

  • Gallery 1
  • Gallery 2
  • Gallery Remote

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#2453 E-mail notifications for comments sent when it's spam

Gallery 2
open
nobody
None
5
2010-06-02
2010-06-02
Jason Lingohr
No

Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.11 apache2handler

I'm receiving e-mail notifications for comments that are marked as spam.

Perhaps there should be a notification -- but it should point to the moderation queue, not the item itself (where of course, it doesn't appear).

Is this behaviour intentional?

Discussion

  • Jigoro

    Jigoro - 2010-06-17

    Hi,

    I have modified my g2 installation to get rid of the very same issue... I am attaching the diff so it can be helpful for others. Please note that I am using notifications only for comments, therefore there might be side effects that I am not aware of.

    Hope this helps...

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • Jigoro

    Jigoro - 2010-06-17

    Well, I cannot find how to attach a file, so here is the diff:

    Index: modules/notification/module.inc

    --- modules/notification/module.inc (rテゥvision 20968)
    +++ modules/notification/module.inc (copie de travail)
    @@ -140,7 +140,9 @@
    $handlerPath = 'modules/notification/classes/NotificationRouter.class';
    $ret = GalleryCoreApi::registerFactoryImplementation('GalleryEventListener',
    'NotificationRouter', 'NotificationRouter',
    - $handlerPath, 'notification', empty($hints) ? null : $hints, 4);
    + $handlerPath, 'notification', empty($hints) ? null : $hints, 6);
    +// UPDATE g2_FactoryMap SET `g_orderWeight`=6 WHERE `g_classType`='GalleryEventListener' AND `g_className` = 'NotificationRouter';
    +// rm -rf .../g2data/cache/{module,entity}/* */
    if ($ret) {
    return $ret;
    }
    Index: modules/comment/classes/CommentAddNotification.class
    ===================================================================
    --- modules/comment/classes/CommentAddNotification.class (rテゥvision 20968)
    +++ modules/comment/classes/CommentAddNotification.class (copie de travail)
    @@ -34,6 +34,10 @@
    */
    function getDescription() {
    global $gallery;
    + if (($this->_event != NULL) && ($this->_event->getEntity() != NULL)) {
    + if ($this->_event->getEntity()->getPublishStatus() == COMMENT_PUBLISH_STATUS_SPAM)
    + return $this->_translateText('comment', $gallery->i18n('New SPAM detected'));
    + }
    return $this->_translateText('comment', $gallery->i18n('Comment Added'));
    }

    @@ -49,12 +53,21 @@
    }

    $title = GalleryUtilities::markup($item->getTitle(), 'strip');
    + if ($this->_event->getEntity()->getPublishStatus() == COMMENT_PUBLISH_STATUS_SPAM) {
    return $this->_translateText('comment',
    + array('text' => $gallery->i18n('A suspected SPAM comment has been posted on %s. The full '
    + . 'comment is provided below. '. "\n\n" . '%s'
    + . "\n\nTo view the new comment at the site click here (will not work):\n" . '%s'),
    + 'arg1' => $title, 'arg2' => $this->getComment(),
    + 'arg3' => $this->getItemUrl()));
    + } else {
    + return $this->_translateText('comment',
    array('text' => $gallery->i18n('A new comment has been posted on %s. The full '
    . 'comment is provided below. '. "\n\n" . '%s'
    . "\n\nTo view the new comment at the site click here:\n" . '%s'),
    'arg1' => $title, 'arg2' => $this->getComment(),
    'arg3' => $this->getItemUrl()));
    + }
    }

    /**

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise