Plugins
: Global Listings 2.0.2
Jan 03 2003
| #
| C:44
Global Listings 2.0.2
January 3, 2003
- updated February 8, 2006
(Download)
This plugin allows you to list Entries, Comments, Categories and TrackBack pings across multiple blogs within one MovableType installation.
Important: If you want a page that contains <MTGlobal…> tags to be correctly rebuilt every time you update an entry or comment in a related blog, you must use the same template in each of the blogs. The easiest way to do this is to link the template to a file. All the affected blogs should link to the same file, so that you only have to edit it in one place.
General
MTGlobalListingsVersion
Returns the current version of the Global Listings plugin.
MTIfGlobalBlog
Conditional tag that is true if the current global object is not a member of the blog being built.
Used inside of MTGlobalObjects or MTGlobalObject tags.
MTIfNotGlobalBlog
Conditional tag that is true if the current global object is a member of the blog being built.
Used inside of MTGlobalObjects or MTGlobalObject tags.
MTGlobalObject
Container tag for the a specified object within any blog.
The following attributes are supported:
- id=”123”
Specifies the ID of the object.
MTGlobalObjects
Container tags that generates a listing of specified objects across multiple blogs.
In the context of a date-based archive, only object in the specified date range are listed.
The following attributes specify which blogs are included:
- include_blogs=”3,4,6”
Limits the objects to blogs specified in the attribute. The default behavior is to include all blogs.
- exclude_blogs=”3,4,6”
Excludes objects from blogs specified in the attribute. The include_blogs setting overrides the exclude_blogs setting.
MTGlobalObjectCount
Tag that returns a count of the specified object across multiple blogs.
In the context of a date-based archive, only object in the specified date range are counted.
The following attributes specify which blogs are included:
- include_blogs=”3,4,6”
Limits the objects to blogs specified in the attribute. The default behavior is to include all blogs.
- exclude_blogs=”3,4,6”
Excludes objects from blogs specified in the attribute. The include_blogs setting overrides the exclude_blogs setting.
Global Entries
- MTGlobalEntries
A container tag representing a list of entries/posts from multiple blogs in a MovableType installation. The actual list of posts can be configured using optional attributes to this tag. The default is to display the last 7 days of entries. This tag supports all the attributes of the MTEntries tag, with the exception of the category attribute.
In addition to the MTGlobalObjects attributes, you can also provide one of the following additional attributes:
- lastn_modified=”N”
Display the last N modified posts to this blog, where N is some number greater than 0. The lastn setting overrides the lastn_modified setting.
- MTGlobalEntryCount
Returns the number of entries in multiple blogs.
Accepts MTGlobalObjectCount attributes.
- MTGlobalEntry
Container for a single entry in any blog.
- id=”123”
Specifies the ID of the entry.
Global Comments
- MTGlobalComments
A container tag representing a list of comments across multiple blog. This tag supports all the attributes of the MTComments tag.
In addition to the MTGlobalObjects attributes, you can also provide one of the following additional attributes:
- MTGlobalCommentCount
Returns the number of comments in multiple blogs.
Accepts MTGlobalObjectCount attributes.
- MTGlobalComment
Container for a single comment in any blog.
- id=”123”
Specifies the ID of the comment.
Global Categories
Global Pings
- MTGlobalPings
A container tag representing a list of TrackBack pings across multiple blog. This tag supports all the attributes of the MTPings tag.
The tag accepts MTGlobalObjects attributes.
- MTGlobalPingCount
Returns the number of TrackBack pings in multiple blogs.
The tag accepts MTGlobalObjectCount attributes.
- MTGlobalPing
Container for a single TrackBack ping in any blog.
- id=”123”
Specifies the ID of the TrackBack ping.
Version History
- Version 2.0.2 - December 9 2003
Pin listings to date range inside of date-based archives.
Added listings: MTGlobalCategories,
MTGlobalPings.
Added counts: MTGlobalEntryCount,
MTGlobalCommentCount,
MTGlobalCategoryCount,
MTGlobalPingCount.
Added objects: MTGlobalEntry,
MTGlobalComment,
MTGlobalCategory,
MTGlobalPing.
Added MTIfGlobalBlog and MTIfNotGlobalBlog
conditional tags.
- Version 1.05 - September 9 2003
Fixed recently_commented_on.
- Version 1.04 - August 26 2003
Fixed sometimes-incorrect MTDateHeader, MTDateFooter, MTEntriesFooter when specifying include_blogs/exclude_blogs.
- Version 1.03 - July 28 2003
If lastn_modified is specified, default sort is modified_on.
- Version 1.02 - Jan 19 2003
Added lastn_modified attribute to MTGlobalEntries.
Fixed some warnings.
- Version 1.01 - Jan 16 2003
Added MTGlobalListingsVersion tag.
Fixed problem with categories not being present.
Added strict checking.
Version 1.0 - Jan 3 2003
Initial release.
-
21)
Great work on this plugin!
FYI, on my system using the exclude_blogs and lastn attributes together within an MTGlobalComments tag causes the lastn attribute to be disregarded.
-
22)
It seems that GlobalCategories only shows categories that have posts. Am I missing something? I’d like to have it show all the categories, not just ones with posts.
-
23)
The behavior is the same as MTCategories. If you want to see all categories, you need to specify a show_empty=1 attribute.
-
24)
Is there an equivalent of MTGlobalAuthorEntryCount ? It would be a godsend :)
-
25)
I guess I should say why. I have a page listing all authors of a multi-author blog, and I want to shwo the total # of posts for each author. Thanks! I started to try the MTTagInvoke plugin, but then I realized that MTGlobal doesn’t support teh ‘author’. um, object. Is that right?
-
26)
Hi, I get this error on rebuild: MT::App::CMS=HASH(0x82f95dc) Use of uninitialized value at /home/sites/site4/web/mt/plugins/GlobalListings.pl line 204.
running MT 2.661 on Mysql
here’s the relevant part of my template:
<MTGlobalEntries>
<MTGlobalObjects include_blogs=”1,2,3,4”>
<MTIfGlobalBlog>
(some MTentry tags)
</MTIfGlobalBlog>
<MTIfNotGlobalBlog>
(some other MTentry tags)
</MTIfNotGlobalBlog>
</MTGlobalObjects>
</MTGlobalEntries>
thanks, great work.
-
27)
Also, I linked 2 weblog’s (same MT install, diff folders) main index templates containing <MTGlobal…> tags to a single template, and when I update either, it does not rebuild the other’s index.html. The template link works since I make changes in one and it reflects in the other. Any hints?
-
28)
I love Global Entries! I use it at Telegraph and X-POLLEN already as well as in most of my other sites to make in-house syndicated feeds.
Now I want to aggregrate all the posts to about six different blogs on my server but only if they are posted to a category called “foo.” (All the relevant blogs have an identically named foo category.)
I see that MTGlobalEntries doesn’t support category=”” and I don’t think MTGlobalCategories works the way I was thinking of.
Do you have any suggestions to implement what I want to do, or workarounds? Thanks!
-
29)
I second xian that it would be tremendous if there was support for categories in MTGlobalEntries. That would make this very worthwhile for me. I confess to have no idea if that would be too diffilcult. Thanks for this plugin.
-
30)
This seems like I must be missing this, but I’d like a way to have each entry on the page id blog it is coming from.
If there were a tag for this, I could have it show up as text, or use it to make different CSS classes and have them show differently through CSS… but it seems like I’m missing it. Is there no (this entry belongs to the weblog xxxxxx) or even (this entry belongs to blog_id # )???
-
31)
Never mind, I found it. I can use
Sorry about that.
-
32)
um, that shoulda been <$MTBlogName$>
-
33)
Does this work with MT 3.1?
-
34)
Thank you for your nice plugin!
But I have a problem that “$MTEntryModifiedDate” tag is not working between “MTGlobalEntries” and “/MTGlobalEntries”.
The “$MTEntryModifiedDate” tag shows the created date such as “$MTEntryDate” in this case.
Do you have any answer that I can show the correct date?
MT is 3.151-ja, your plugin is Global Listings 2.0.2.
-
35)
I fixed it and put a diff with no warranty.
@@ -71,6 +71,8 @@
return _global_item(‘Entry’, $ctx, $args, sub { {
EntryIfExtended => $_[0]->text_more ? 1 : 0,
EntryIfAllowComments => $_[0]->allow_comments,
+ EntryIfCommentsOpen => $_[0]->allow_comments &&
+ $_[0]->allow_comments eq ‘1’,
EntryIfAllowPings => $_[0]->allow_pings,
}});
});
@@ -221,6 +223,7 @@
for my $e (@entries) {
local $ctx->{__stash}{entry} = $e;
local $ctx->{current_timestamp} = $e->created_on;
+ local $ctx->{modification_timestamp} = $e->modified_on;
my $this_day = substr $e->created_on, 0, 8;
my $next_day = $this_day;
my $footer = 0;
@@ -235,13 +238,15 @@
local $ctx->{__stash}{blog} = $blog;
local $ctx->{__stash}{blog_id} = $blog->id;
MT::ConfigMgr->instance->NoPlacementCache(1) unless $e->blog_id == $blog_id;
-
+ my $allow_comments ||= 0;
my $out = $builder->build($ctx, $tok, {
%$cond,
DateHeader => ($this_day ne $last_day),
DateFooter => $footer,
EntryIfExtended => $e->text_more ? 1 : 0,
EntryIfAllowComments => $e->allow_comments,
+ EntryIfCommentsOpen => $e->allow_comments &&
+ $e->allow_comments eq ‘1’,
EntryIfAllowPings => $e->allow_pings,
EntriesHeader => !$i,
EntriesFooter => !defined $entries[$i+1],
-
36)
Thanks!
This ia just I am looking for! Cool plugin!
-
37)
is there a way to Specifies the BlogID for the MTGlobalComment tag?
-
38)
CommentIDs are already global, so it doesn’t make sense to need to specify a BlogID for the MTGlobalComment tag. Or is there something else you’re trying to do?
-
39)
This plugin is great—except that it is unfortunately showing *all* comments across blogs, instead of just the comments that have been approved! The code I’m using is below:
[div id="blog-comments"]
[h2]Recent Comments[/h2]
[MTGlobalComments lastn="6" include_blogs=”2,4,5,6,7,8,10”]
[h3][MTCommentDate format="%B %e, %Y"] at [MTCommentDate format="%I:%M %p"][/h3]
[MTCommentEntry][h4][a href="[$MTEntryPermalink$]"][$MTEntryTitle encode_ampersands="1"$][/a][/h4][/MTCommentEntry]
[p][span class="user"][MTCommentAuthor default="Anonymous"]:[/span] "[MTCommentBody convert_breaks="0" formatted_words="20" remove_html="1" encode_ampersands="1"]"[/p]
[/MTGlobalComments]
[/div]
As I said, this code is showing all comments, rather than all *approved* comments, which is what I want. Ideas for code modification or a fix to this otherwise-great plugin, please?
-
40)
This plugin was written for MT 2.6 which didn’t have comment moderation. However, changing it to only list approved comments in MT 3.x is simple.
In GlobalListings.pl, replace the line 281 which should look like this:
my (%args, %terms);
with the following two lines:
my (%args, %terms);
$terms{visible} = 1;
You may also want to fix the MTGlobalCommentsCount tag to only count approved comments.
Replace line 105:
return _global_count($_[0], $_[1], 'MT::Comment');
with the following:
return _global_count($_[0], $_[1], 'MT::Comment', { visible => 1 });
I’ll try to fix these in the next official release.
|
|