Help - Search - Members - Calendar
Full Version: Showing latest comments from another blog
Movable Type Community Forum > Additional Resources > Tips and Tricks
shogun
I have created a guestbook for my site using another blog. Can i make latest entries to my guestbook (comments) appear on the index on my main site? (My main site and the guestbook are two separate blogs)

How?

Thanks,
Siggi
girlie
You could use the OtherBlog plugin.

Or if you have PHP or SSI, you can create an index page in your guestbook blog which lists the comments, and pull its output file into your main blog with an include statement.
shogun
Ok, thanks

I downloaded and inserted the plugin. Now I am trying this code:

CODE
<span class="small">
<MTOtherBlog blog_id="4">
<MTEntries>
<MTComments lastn="5" sort_order="descend">
<b><$MTCommentAuthorLink spam_protect="1"$>:</b><br>
...<a href="<MTEntryPermalink>#comment<MTCommentID pad="1">"><$MTCommentBody trim_to="25" convert_breaks="0"$></a>  <br />  
<br>
</MTComments>
</MTEntries>
</MTOtherBlog>
</span>


But nothing appears. The id of my guestbook is 4. Is something missing?
stepan
For starters, remove the MTEntries tag.  Also, you'll need to surround the MTEntryPermalink tag with MTCommentEntry:
CODE
<MTOtherBlog blog_id="4">
<MTComments lastn="5" sort_order="descend">
<b><$MTCommentAuthorLink spam_protect="1"$>:</b><br>
...<a href="<MTCommentEntry><MTEntryPermalink></MTCommentEntry>#comment<MTCommentID pad="1">"><$MTCommentBody trim_to="25" convert_breaks="0"$></a>  <br />  
<br>
</MTComments>
</MTOtherBlog>
girlie
So - why doesn't it work with the MTEntries tags? What if you wanted to display the last five comments from each entry in your blog, and not just the last five comments overall?
stepan
Girlie, I think it should work with the MTEntriesTag and do what you describe (although it's not what shogun wants).

Shogun, any chance you could post a link to your guestbook?
girlie
It didn't work - I tested his original code as is, and got no results either.  ???
stepan
Sounds like a bug with the plugin, then.  You could report it via bugs.mt-plugins.org.

Another way of doing this (I just tested it and it works) is to use the GlobalListings plugin like so:
CODE
<MTGlobalComments lastn="5" sort_order="descend" include_blogs="3">
<b><$MTCommentAuthorLink spam_protect="1"$>:</b><br>
...<a href="<MTCommentEntry><MTEntryPermalink></MTCommentEntry>#comment<MTCommentID pad="1">"><$MTCommentBody trim_to="25" convert_breaks="0"$></a>  <br />  
<br>
</MTGlobalComments>
kavavita
is there also a way to do this with SSI?  just curious if anyone knows.
girlie
QUOTE
Or if you have PHP or SSI, you can create an index page in your guestbook blog which lists the comments, and pull its output file into your main blog with an include statement.

As noted.
shogun
QUOTE
Girlie, I think it should work with the MTEntriesTag and do what you describe (although it's not what shogun wants).

Shogun, any chance you could post a link to your guestbook?

This is the code I am now using, and it works fine.

You can see this at work on My Webpage. The links to my recent guestbook entries are on the left side under the words "Nýjar gestabókarfærslur" (its in Icelandic and translates ="New guestbook entries")

CODE
<MTOtherBlog blog_id="4">
<MTComments lastn="5" sort_order="descend">
<b><$MTCommentAuthorLink spam_protect="1"$>:</b><br>
...<a href="http://www.skodun.is/guestbook/">
<$MTCommentBody trim_to="25" convert_breaks="0"$></a>  <br />  
<br>
</MTComments>
</MTOtherBlog>


My guestbook
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.