<?xml version="1.0" encoding="iso-8859-1"?> 
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
	xmlns:dc="http://purl.org/dc/elements/1.1/" 
	xmlns:dcterms="http://purl.org/dc/terms/" 
	xmlns:admin="http://webns.net/mvcb/"
	xmlns:thr="http://purl.org/rss/1.0/modules/threading/"
	xmlns:pb="http://www.ideaspace.net/users/wkearney/schema/postback/" 
	xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" 
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:mt="http://movabletype.org/"
	xmlns:foaf="http://xmlns.com/foaf/0.1/" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:html="http://www.w3.org/TR/REC-html40/"
	xmlns="http://purl.org/rss/1.0/"
> 

<rdf:Description rdf:about="http://www.ideaspace.net/users/wkearney/archives/entries/000198.html"> 
	<title>MTPingEntry plugin for MT</title>
	<link>http://www.ideaspace.net/users/wkearney/archives/entries/000198.html</link>
	<description>Want to use Entry links inside an MTPings template on you MovableType site?  Here&apos;s how.</description> 

	<dc:creator>wkearney</dc:creator> 
	<dc:date>2003-03-25T19:50:54-05:00</dc:date> 
	<dc:identifier>http://www.ideaspace.net/users/wkearney/archives/entries/000198.html</dc:identifier>
	<dc:language>en-us</dc:language>

	

	<trackback:ping rdf:resource="http://www.ideaspace.net/mt/tb.cgi/196" />
	<pb:trackbacksFrom> 
		<rdf:Seq> 
			<rdf:li rdf:resource="http://kristk.klaki.net/dagbok/skjalasafn/2003_04.shtml#000542" />
		</rdf:Seq>
	</pb:trackbacksFrom>

	

	
	
	
	<dcterms:abstract>Want to use Entry links inside an MTPings template on you MovableType site?  Here&apos;s how.</dcterms:abstract> 
	<dcterms:created>2003-03-25T19:50:54-05:00</dcterms:created> 
	<dcterms:isPartOf rdf:resource="http://www.ideaspace.net/users/wkearney/" /> 

	<mt:body><![CDATA[<p>I'd asked the MovableType <a href="http://www.movabletype.org/support/">support forum</a> for a way to make use of Entry data within comments and ping containers.  This to allow running a container loop over trackbacks and comments independent of categories or entries.  Ben Trott <a href="http://www.movabletype.org/cgi-bin/ikonboard/ikonboard.cgi?s=3e80f15815e4ffff;act=ST;f=14;t=5357">posted up a code snippet</a> on how to do it.  Here's how you can use that code in your own site.</p>]]></mt:body>
	<mt:excerpt>Want to use Entry links inside an MTPings template on you MovableType site?  Here&apos;s how.</mt:excerpt> 
	<mt:more><![CDATA[<p>Your MT site has the ability to use plug-ins.  If you're not using them already you'll need to create a directory.</p>

<p>First find where your system keeps it's mt.cgi script.  You'll need to create a directory here named 'plugins'.  If you're connecting to your site via FTP then 'cd' to the mt.cgi directory and 'mkdir plugins'. </p>

<p>Now that you know the directory exists you can put plugin scripts into it.  You'll need to create a text file.  You'll create this locally on your computer and then use FTP to put it up on your MT site.  I created a file named pingentry.pl and put this text inside it:</p>

<blockquote><pre>
##
# 
# pingentry.pl
#
# code snippet from Ben Trott on the MT support board
#	http://www.movabletype.org/support/
#
# wrapped up nice and neat like this by 
#	Bill Kearney
#	http://www.ideaspace.net/users/wkearney
##

use strict;
use MT::Template::Context;
use MT::Trackback;

MT::Template::Context->add_container_tag(PingEntry => sub {
   my($ctx, $args, $cond) = @_;
   my $p = $ctx->stash('ping')
       or return $ctx->_no_ping_error('MTPingEntry');
   require MT::Trackback;
   my $tb = MT::Trackback->load($p->tb_id);
   my $entry_id = $tb->entry_id || return '';
   require MT::Entry;
   my $entry = MT::Entry->load($entry_id)
       or return '';
   local $ctx->{__stash}{entry} = $entry;
   local $ctx->{current_timestamp} = $entry->created_on;
   $ctx->stash('builder')->build($ctx, $ctx->stash('tokens'), $cond);
}); 
</pre></blockquote>

<p>Save the file and then upload it via FTP to your MT site 'plugins' directory.  Once that's done your MT site will automagically recognize it.  Check your web server error_log just in case.</p>

<p>The above plugin lets you use Entry tags inside an MTPings container.  I've made use of is like so:</p>

<blockquote><pre>
&lt;MTPings lastn="15" sort_order="descend"&gt;			
  &lt;h3 class="title"&gt;&lt;a href="&lt;$MTPingURL$&gt;"&gt;&lt;$MTPingTitle$&gt;&lt;/a&gt;&lt;/h3&gt;
  &lt;MTPingEntry&gt;&lt;i&gt;Re: &lt;a href="&lt;$MTEntryLink$&gt;"&gt;&lt;$MTEntryTitle$&gt;&lt;/a&gt;&lt;/i&gt;&lt;br/&gt;&lt;/MTPingEntry&gt;
  &lt;$MTPingExcerpt$&gt;
  &lt;div class="posted"&gt;Pinged: &lt;$MTPingDate language="en" format="%a, %d %b %Y %H:%M:%S"$&gt; from: &lt;$MTPingBlogName$&gt;&lt;/div&gt;
&lt;/MTPings&gt;
</pre></blockquote>

The point of my using this container is to allow me to iterate over the pings themselves independent of entries.  

]]></mt:more>
	<mt:keywords>mt, movabletype, plugins</mt:keywords> 
	<mt:entryID>198</mt:entryID>

	<mt:entryPrev>197</mt:entryPrev>
	<mt:entryNext>200</mt:entryNext>

	<html:link rel="prev" type="application/xml" href="http://www.ideaspace.net/users/wkearney/archives/entries/000197.html.xml" title="TurboRing RIP" />
	<html:link rel="next" type="application/xml" href="http://www.ideaspace.net/users/wkearney/archives/entries/000200.html.xml" title="Toward secure comments" />
	
	<mt:author>wkearney</mt:author> 
	<mt:authorNickname>Bill Kearney</mt:authorNickname> 
	<mt:authorEmail>wkearney@ideaspace.net</mt:authorEmail>
	<mt:authorURL rdf:resource="http://www.ideaspace.net/users/wkearney" /> 
	
	<foaf:name>wkearney</foaf:name> 
	<foaf:mbox rdf:resource="mailto:wkearney@ideaspace.net" /> 
	<foaf:nick>Bill Kearney</foaf:nick> 
	<foaf:homepage rdf:resource="http://www.ideaspace.net/users/wkearney" />
	
	<rdfs:seeAlso rdf:resource="http://www.ideaspace.net/users/wkearney/xml/index.rdf" />
	<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.64" /> 
</rdf:Description>
</rdf:RDF>