Changeset 29 for recently-pinged-on/trunk
- Timestamp:
- 04/06/05 22:09:03 (4 years ago)
- Files:
-
- 1 modified
-
recently-pinged-on/trunk/recently-pinged-on.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
recently-pinged-on/trunk/recently-pinged-on.pl
r27 r29 1 1 # A plugin for adding 'recently_pinged_on' option to MTEntries container 2 2 # 3 # Release 0.1 2 (Feb 06, 2005)3 # Release 0.15 (Feb 12, 2005) 4 4 # 5 5 # This software is provided as-is. You may use it for commercial or … … 14 14 require MT::Plugin; 15 15 my $plugin = new MT::Plugin(); 16 $plugin->name("recently_pinged_on Plugin 0.1 2");16 $plugin->name("recently_pinged_on Plugin 0.15"); 17 17 $plugin->description("Add 'recently_ping_on' option to MTEntries container"); 18 18 $plugin->doc_link("http://as-is.net/hacks/2005/01/recently_pinged_on_plugin.html"); … … 28 28 sub hdlr_entries { 29 29 my ($ctx, $args, $cond) = @_; 30 return &$mt_hdlr_entries(@_) 31 if $args->{lastn} || $args->{days} || $args->{recently_commented_on}; 30 32 my $recently_pinged_on = $args->{recently_pinged_on} or 31 33 return &$mt_hdlr_entries(@_); 32 34 33 35 my $blog_id = $ctx->stash('blog_id'); 36 my ($start, $end) = ($ctx->{current_timestamp}, 37 $ctx->{current_timestamp_end}); 38 my $cat = $ctx->stash('archive_category'); 34 39 35 40 require MT::TBPing; … … 45 50 46 51 require MT::Trackback; 52 my $trackback = MT::Trackback->load($tb_id) or next; 53 my $entry_id = $trackback->entry_id or next; 54 47 55 require MT::Entry; 48 my @args = ({ status => MT::Entry::RELEASE() }, 49 { join => ['MT::Trackback', 'entry_id', { id => $tb_id }] }); 50 my $entry = MT::Entry->load(@args) or next; 56 my $entry = MT::Entry->load($entry_id) or next; 57 58 next if $entry->status != MT::Entry::RELEASE(); 59 next if $cat && !$entry->is_in_category($cat); 60 next if $start && $end && ($entry->created_on < $start || $entry->created_on > $end); 61 51 62 push(@entries, $entry); 52 63 last if ++$count == $recently_pinged_on;
![(please configure the [header_logo] section in trac.ini)](/public/chrome/common/trac_banner.png)