Changeset 2727

Show
Ignore:
Timestamp:
07/08/08 05:52:36 (19 months ago)
Author:
bchoate
Message:

Updated MultiBlog to issue triggered publishing for scheduled posts. BugId:80355

Location:
branches/release-41
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT/WeblogPublisher.pm

    r2504 r2727  
    15761576              or die $entry->errstr; 
    15771577 
     1578            MT->run_callbacks( 'scheduled_post_published', $mt, $entry ); 
     1579 
    15781580            $rebuild_queue{ $entry->id } = $entry; 
    15791581            $ping_queue{ $entry->id }    = 1; 
  • branches/release-41/plugins/MultiBlog/lib/MultiBlog.pm

    r1522 r2727  
    101101        } 
    102102 
     103        require MT::Entry; 
     104        if ( ( $entry->status || 0 ) == MT::Entry::RELEASE() ) { 
     105            while ( my ( $id, $a ) = each( %{ $d->{'entry_pub'} } ) ) { 
     106                next if $id == $blog_id; 
     107                perform_mb_action( $app, $id, $_ ) foreach keys %$a; 
     108            } 
     109        } 
     110    } 
     111} 
     112 
     113sub post_entry_pub { 
     114    my $plugin = shift; 
     115    my ( $eh, $app, $entry ) = @_; 
     116    my $blog_id = $entry->blog_id; 
     117 
     118    foreach my $scope ("blog:$blog_id", "system") { 
     119        my $d = $plugin->get_config_value( $scope eq 'system' ? 'all_triggers' : 'other_triggers', $scope ); 
    103120        require MT::Entry; 
    104121        if ( ( $entry->status || 0 ) == MT::Entry::RELEASE() ) { 
  • branches/release-41/plugins/MultiBlog/multiblog.pl

    r1185 r2727  
    7676MT->add_callback( 'cms_post_save.entry', 10, $plugin, 
    7777    sub { $plugin->runner( 'post_entry_save', @_ ) } ); 
     78MT->add_callback( 'scheduled_post_published', 10, $plugin, 
     79    sub { $plugin->runner( 'post_entry_pub', @_ ) } ); 
    7880 
    7981# Register Comment/TB post-save callbacks for rebuild triggers