Changeset 285

Show
Ignore:
Timestamp:
04/19/08 16:00:52 (8 months ago)
Author:
kevin
Message:

Fixed problem with auto-notification.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • notification/lib.php

    r275 r285  
    8181    include($CFG->dirroot.'mod/notification/notification.config.php'); 
    8282     
     83    error_log("in init AUTONOTIFICATION_FOR_ADD: $AUTONOTIFICATION_FOR_ADD"); 
     84     
    8385    if (!in_array($CFG->prefix . "notifications",$METATABLES)) { 
    8486        if (file_exists($CFG->dirroot . "mod/notification/$CFG->dbtype.sql")) { 
     
    124126     
    125127    include($CFG->dirroot.'mod/notification/notification.config.php'); 
     128    error_log("AUTONOTIFICATION_FOR_ADD: $AUTONOTIFICATION_FOR_ADD"); 
    126129    if (isset($notification_data)) { 
    127130        foreach($notification_data as $n) { 
     
    132135            } 
    133136        } 
     137    } 
     138} 
     139 
     140function notification_exists($object_owner, $object_type, $userid) { 
     141     
     142    global $CFG; 
     143     
     144    $query = <<<END 
     145SELECT n.ident FROM {$CFG->prefix}notifications n 
     146INNER JOIN  
     147{$CFG->prefix}notifications no 
     148ON (no.ident = n.notification_object_id) 
     149WHERE no.owner = $object_owner 
     150AND no.object_type = '$object_type' 
     151AND n.owner = $userid 
     152END; 
     153 
     154    $results = get_records_sql($query); 
     155    if ($results) { 
     156        return true; 
     157    } else { 
     158        return false; 
    134159    } 
    135160} 
  • notification/plugin.info

    r259 r285  
    11Maintainer: Kevin Jardine <kevin@radagast.biz> 
    22Title: Notifications 
    3 Version: 0.1 
     3Version: 0.2 
    44Package: notification 
    55Source-URL: https://svn.elgg.org/plugins/notification