Changeset 2611

Show
Ignore:
Timestamp:
06/19/08 22:03:04 (6 months ago)
Author:
bchoate
Message:

Fixes for older MT releases. BugId:80017 - pre_save callbacks for MT 3.x. BugId:80020 - count tag fix for MT 3.x, 4.0, 4.1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-40/plugins/TypePadAntiSpam/TypePadAntiSpam.pl

    r2461 r2611  
    7171    MT->add_callback('HandleJunk',    5, $plugin, \&handle_junk); 
    7272    MT->add_callback('HandleNotJunk', 5, $plugin, \&handle_not_junk); 
     73    MT->add_callback('MT::Comment::pre_save', 5, $plugin, \&pre_save_obj); 
     74    MT->add_callback('MT::TBPing::pre_save', 5, $plugin, \&pre_save_obj); 
    7375    MT->register_junk_filter({ 
    7476        name => 'TypePadAntiSpam', 
     
    107109    my ($ctx, $args, $cond) = @_; 
    108110    my $blog = $ctx->stash('blog'); 
    109     return $ctx->count_format($plugin->blocked($blog), $args); 
     111    if ($ctx->can('count_format')) { 
     112        return $ctx->count_format($plugin->blocked($blog), $args); 
     113    } else { 
     114        return $plugin->blocked($blog) || 0; 
     115    } 
    110116} 
    111117