/**
 * Event handler for group forum posts
 *
 */
function group_object_notifications($event, $object_type, $object)
{
    static $flag;
    if (!isset($flag)) {
        $flag = 0;
    }
    if (is_callable('object_notifications')) {
        if ($object instanceof ElggObject) {
            if ($object->getSubtype() == 'groupforumtopic') {
                //if ($object->countAnnotations('group_topic_post') > 0) {
                if ($flag == 0) {
                    $flag = 1;
                    object_notifications($event, $object_type, $object);
                }
                //}
            }
        }
    }
}
示例#2
0
        $album->first_upload = true;
        add_to_river('river/object/album/create', 'create', $album->getOwnerGUID(), $album->getGUID());
        // "created album" notifications
        // we throw the notification manually here so users are not told about the new album until
        // there are at least a few photos in it
        if ($album->shouldNotify()) {
            object_notifications('create', 'object', $album);
            $album->last_notified = time();
        }
    } else {
        // "added image to album" notifications
        if ($album->first_upload) {
            $album->first_upload = false;
        }
        if ($album->shouldNotify()) {
            object_notifications('create', 'object', $album);
            $album->last_notified = time();
        }
    }
}
if (count($not_uploaded) > 0) {
    if (count($uploaded_images) > 0) {
        $error = sprintf(elgg_echo("tidypics:partialuploadfailure"), count($not_uploaded), count($not_uploaded) + count($uploaded_images)) . '<br />';
    } else {
        $error = elgg_echo("tidypics:completeuploadfailure") . '<br />';
    }
    $num_failures = count($not_uploaded);
    for ($i = 0; $i < $num_failures; $i++) {
        $error .= "{$not_uploaded[$i]}: {$error_msgs[$i]} <br />";
    }
    register_error($error);
示例#3
0
/**
 * Event handler for videolist
 *
 * @param string $event
 * @param string $object_type
 * @param ElggObject $object
 */
function videolist_object_notifications($event, $object_type, $object)
{
    static $flag;
    if (!isset($flag)) {
        $flag = 0;
    }
    if (is_callable('object_notifications')) {
        if ($object instanceof ElggObject) {
            if ($object->getSubtype() == 'videolist_item') {
                if ($flag == 0) {
                    $flag = 1;
                    object_notifications($event, $object_type, $object);
                }
            }
        }
    }
}