<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">

<channel>
<title>Development and Textpattern - Michael Gravel</title>
<generator>http://textpattern.com/?v=4.8.3</generator>
<link>http://www.dev.michaelgravel.com</link>
<description>Plugins, tutorials, and writings about Textpattern</description>
<pubDate>Sat, 20 Oct 2007 02:10:51 -0700</pubDate>

<item>
<title>Plugin: mg_comments_form</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_comments_form /&#62;</code> allows you to change the class on the paragraph that appears after a comment is posted successfully.</p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_comments_form.php"><code>&#60;txp:mg_comments_form /&#62;</code></a>
 </div>

	<h4>Attributes</h4>

	<p>This plugin takes the same attributes as the stock <code>comments_form</code> tag ( <a href="http://textpattern.net/wiki/index.php?title=Txp:comments_form_/">found here</a> ), with the following addition:</p>

	<ul>
		<li><strong>pclass</strong>:  This is the <span class="caps">CSS</span> class that will be applied to the paragraph that appears after a comment has been posted successfully.</li>
	</ul>

	<h4>Examples</h4>

<pre><code>&#60;txp:mg_comments_form pclass=&#34;success&#34; /&#62;
</code></pre>

	<p>Using the above will simply place the class &#8220;success&#8221; on the paragraph that appears after a comment is posted successfully.  You can then use <span class="caps">CSS</span> to style the paragraph in any way you want.</p>

	<h4> Notes on Usage</h4>

	<p>Pretty straighforward.  The added functionality is described above.</p>

	<h4>Credits</h4>

	<p>Based on base txp code with the modest additions described above.</p>

<p>&#8212; Michael Gravel</p>


]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_comments_form</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_comments_form</guid>
<pubDate>Sat, 20 Oct 2007 02:10:51 -0700</pubDate>

</item>

<item>
<title>Plugin: mg_commentor_name</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_commentor_name /&#62;</code> is identical to the stock txp <code>comment_name</code> tag, but this plugin puts a title on the link to the commentor&#8217;s website. </p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_commentor_name.php"><code>&#60;txp:mg_commentor_name /&#62;</code></a>
 </div>

	<h4>Attributes</h4>

	<p>This plugin takes the same attribute as the stock <code>comment_name</code> tag, which you can read about <a href="http://textpattern.net/wiki/index.php?title=Txp:comment_name_/">here</a>.  </p>

	<h4>Examples</h4>

<pre><code>&#60;txp:mg_commentor_name /&#62;
</code></pre>

	<p>The above would produce a link like this in your comment display:</p>

	<p><a href="http://www.example.com" title="Visit Commentor Name&#39;s Website: http://example.com">Commentor Name</a></p>

	<h4>Notes on Usage</h4>

	<p>This is a drop-in replacement for the standard <code>comment_name</code> tag.  This plugin adds one piece of functionality:  It adds a title to the website link (only to the website link).</p>

	<h4>Credits</h4>

	<p>Written by Michael Gravel and based on the base txp code.</p>



<p>&#8212; Michael Gravel</p>


]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_commentor_name</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_commentor_name</guid>
<pubDate>Sat, 20 Oct 2007 01:10:20 -0700</pubDate>

</item>

<item>
<title>Plugin: mg_recent_comments</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_recent_comments /&#62;</code> makes a few small changes to the stock <code>recent_comments</code> tag offered in Textpattern.  The link is given a title and the commentor&#8217;s name appears. </p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_recent_comments.php"><code>&#60;txp:mg_recent_comments  /&#62;</code></a>
 </div>

	<h4>Attributes</h4>

	<p>This plugin takes the same attributes as the standard <code>recent_comments</code> tag, which can be found <a href="http://textpattern.net/wiki/index.php?title=Txp:recent_comments_/">here</a>.  The only changes this plugin makes are to the appearance of the link and the title of the link.</p>

	<h4>Examples</h4>

<pre><code>&#60;txp:mg_recent_comments wraptag=&#34;ul&#34; break=&#34;li&#34; limit=&#34;3&#34; class=&#34;comments-list&#34; /&#62;
</code></pre>

	<p>The above produces a ul of links like this, with the class &#8220;comments-list&#8221;:</p>

	<ul>
		<li><a href="http://www.example.com" title="Read this comment by Mike Gravel">Mike Gravel on First Post</a></li>
		<li><a href="http://www.example.com" title="Read this comment by Rodney Dangerfield">Rodney Dangerfield on Caddyshack</a></li>
	</ul>
	<ul>
		<li><a href="http://www.example.com" title="Read this comment by Eric Carmen">Eric Carmen on Make Me Lose Control</a></li>
	</ul>

	<h4>Notes on Usage</h4>

	<p>This plugin behaves exactly as the stock <code>&#60;txp:recent_comments /&#62;</code> tag.  It&#8217;s only change is to the look of the output, and the addition of a title attribute stating the commentor&#8217;s name.</p>

	<h4>Credits</h4>

	<p>Written by Michael Gravel, based, obviously, on the base txp code.  I was unhappy with the appearance of the stock code and frustrated by the lack of a title on the link.  So here is my solution.</p>

 

<p>&#8212; Michael Gravel</p>


]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_recent_comments</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_recent_comments</guid>
<pubDate>Sat, 20 Oct 2007 01:10:50 -0700</pubDate>

</item>

<item>
<title>Plugin: mg_page_title</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_page_title /&#62;</code> is identical to the stock txp <code>page_title</code> tag, but it reverses the post name and site name on permanent link pages.</p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_page_title.php"><code>&#60;txp:mg_page_title /&#62;</code></a>
 </div>

	<h4>Attributes</h4>

	<p>This plugin takes the same attribute as the stock <code>&#60;txp:page_title /&#62;</code> tag:</p>

	<ul>
		<li><strong>separator</strong>: Choose any separating character you like.</li>
	</ul>

	<h4>Examples</h4>

<pre><code>&#60;txp:mg_page_title separator=&#34; #8226; &#34; /&#62;
</code></pre>

	<p>In the above example, the output would be &#8220;Post Title &#8226; Site Name&#8221;.  On all other pages, the output is the same as the stock <code>&#60;txp:page_title /&#62;</code> tag.</p>

	<h4>Notes on Usage </h4>

	<p>This tag is a simple drop in replacement for <code>&#60;txp:page_title /&#62;</code>.  The only difference is this:  On permanent archive pages, the site name and the post title are reversed so that the post title is first (the stock txp tag places the site name first). </p>

	<h4>Credits</h4>

	<p>Written by Michael Gravel.</p>

 

<p>&#8212; Michael Gravel</p>

<p>1 comment on this entry.  <a href="http://www.dev.michaelgravel.com/text/plugin-mg_page_title#comment">View comments (commentary closed).</a></p>
]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_page_title</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_page_title</guid>
<pubDate>Sat, 20 Oct 2007 01:10:15 -0700</pubDate>

</item>

<item>
<title>Plugin: mg_comments_count</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_comments_count /&#62;</code> returns the number of comments on a post followed by the word of your choice.  It&#8217;s a simple plugin that adds some user friendliness to comment display.</p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_comments_count.php"><code>&#60;txp:mg_comments_count /&#62;</code></a>
 </div>

	<h4>Attributes</h4>

	<p>This plugin takes three attributes:</p>

	<ul>
		<li><strong>zero</strong>: The text to display if there are no comments.  <span class="caps">NOTE</span>:  A zero numeral is <span class="caps">NOT</span> returned.  <em>Defaults to &#8216;No comments&#8217;.</em></li>
		<li><strong>one</strong>: The text to display if there is one comment.  The number &#8220;1&#8221; will precede the text.  <em>Defaults to &#8217;1 comment&#8217;.</em></li>
	</ul>
	<ul>
		<li><strong>many</strong>: The text to display if there is more than 1 comment.  The number of comments will precede the text. <em>Defaults to &#8216;x comments&#8217;.</em></li>
	</ul>

	<h4>Examples</h4>

	<p><strong>Example #1</strong></p>

<pre><code>&#60;txp:mg_comments_count /&#62;
</code></pre>

	<p>The above would output the following:</p>

	<ul>
		<li>&#8220;No comments&#8221; if there are no comments</li>
		<li>&#8220;1 comment&#8221; if there is one comment</li>
	</ul>
	<ul>
		<li>&#8220;16 comments&#8221; if there are 16 comments</li>
	</ul>

	<p><strong>Example #2</strong></p>

<pre><code>&#60;txp:mg_comments_count zero=&#34;Not a single comment yet.&#34; one=&#34;One lonely comment.&#34; many=&#34;hot comments so far.&#34; /&#62;
</code></pre>

	<p>The above would output the following:</p>

	<ul>
		<li>&#8220;Not a single comment yet.&#8221; if there are no comments</li>
		<li>&#8220;One lonely comment.&#8221; if there is one comment</li>
	</ul>
	<ul>
		<li>&#8220;16 hot comments so far.&#8221; if there are 16 comments</li>
	</ul>

	<h4>Notes on usage</h4>

	<p>Typically, I use this plugin at the top of my comment display.  It could also be worked into a comment invite if you combine it with a few conditionals.</p>

	<h4>Credits</h4>

	<p>Written by Michael Gravel.</p>

<p>&#8212; Michael Gravel</p>


]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_comments_count</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_comments_count</guid>
<pubDate>Sat, 20 Oct 2007 01:10:47 -0700</pubDate>

</item>

<item>
<title>Plugin:  mg_txpversion</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_txpversion /&#62;</code> simply returns the version of your current Textpattern installation.  You can use this in the head of your pages or in your <span class="caps">RSS</span> feed.</p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_txpversion.php"><code>&#60;txp:mg_txpversion /&#62;</code></a>
 </div>

	<h4>Attributes</h4>

	<p>This plugin takes / has no attributes.</p>

	<h4>Examples</h4>

	<p>In a feed template, in the &#8216;channel&#8217; portion of the feed:</p>

<pre><code>&#60;generator&#62;http://textpattern.com/?v=&#60;txp:mg_txpversion /&#62;&#60;/generator&#62;
</code></pre>

	<h4>Notes on Usage</h4>

	<p>Could also be placed in the head of a standard template, or anywhere else where you might want to display the version of your txp installation.</p>

	<h4>Credits</h4>

	<p>This one is embarrassingly simple, but it was written by Michael Gravel.</p>

<p>&#8212; Michael Gravel</p>


]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_txpversion</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_txpversion</guid>
<pubDate>Sat, 20 Oct 2007 12:10:53 -0700</pubDate>

</item>

<item>
<title>Plugin:  mg_setheader</title>
<description>
<![CDATA[
	<p>The plugin <code>&#60;txp:mg_setheader /&#62;</code> allows one to change/specify the header for any textpattern page.  By default, textpattern delivers section pages as text/html.  This plugin can be used to serve up a valid <span class="caps">RSS</span> feed from a standard page template.</p>
 <div class="download">
Download it:  <a href="http://www.dev.michaelgravel.com/plugins/mg_setheader.php"><code>&#60;txp:mg_setheader /&#62;</code></a>
 </div>

<h4>Attributes</h4>

	<p>This plugin takes two attributes:</p>

	<ul>
		<li><strong>name</strong>:  Defaults to &#8216;Content-Type&#8217;</li>
	</ul>
	<ul>
		<li><strong>value</strong>:  Defaults to &#8216;text/xml&#8217;</li>
	</ul>

<h4>Examples</h4>

	<p><strong>Example #1:</strong></p>

<pre><code>&#60;txp:mg_setheader name=&#34;Content-Type&#34; value=&#34;application/rss+xml&#34; /&#62;&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62; 
(and so on...) 
</code></pre>

	<p>The above example would be used on a page template and would set the header for that page to the spec&#8217;d value.  In the above example, you could generate a valid <span class="caps">RSS</span> feed using the appropriate <span class="caps">RSS</span> tags (see the <a href="http://cyber.law.harvard.edu/rss/rss.html"><span class="caps">RSS</span> spec</a> for more information) and standard textpattern tags.  This would allow you to insert images, create podcasts (see my tutorial <a href="http://www.dev.michaelgravel.com/text/podcasting-with-textpattern-a-tutorial">Podcasting With Textpattern</a>), and place images at the top of your feeds.</p>

	<p><strong>Example #2:</strong></p>

<pre><code>&#60;txp:mg_setheader /&#62;&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62; 
(and so on...) 
</code></pre>

	<p>The above example simply sets the header to &#8216;text/xml&#8217; (which is an equally valid header for an <span class="caps">RSS</span> feed).</p>

<h4>Notes on usage</h4>

	<p>This plugin is most commonly used to generate an <span class="caps">RSS</span> feed from a standard Textpattern page template.  When you do this, <code>&#60;txp:mg_setheader /&#62;</code> must reside <span class="caps">AT THE VERY TOP OF YOUR PAGE TEMPLATE</span>, and the opening <code>&#60;?xml&#62;</code> tag must follow <span class="caps">IMMEDIATELY</span> behind it (i.e. no linebreak, no space between the <code>&#60;txp:mg_setheader /&#62;</code> tag and the opening <code>&#60;?xml&#62;</code> tag).</p>

<h4>Credits</h4>

	<p>I&#8217;d love to take credit for this, but the code belongs to Sencer.  I gleaned this from a post in the textpattern forum.  I can&#8217;t seem to find the thread, otherwise I&#8217;d post a link here.</p>

  

<p>&#8212; Michael Gravel</p>

<p>3 comments on this entry.  <a href="http://www.dev.michaelgravel.com/text/plugin-mg_setheader#comment">View comments (commentary closed).</a></p>
]]>
</description>
<link>http://www.dev.michaelgravel.com/text/plugin-mg_setheader</link>
<guid>http://www.dev.michaelgravel.com/text/plugin-mg_setheader</guid>
<pubDate>Fri, 20 Jul 2007 02:07:05 -0700</pubDate>

</item>

<item>
<title>Podcasting With Textpattern - A Tutorial</title>
<description>
<![CDATA[
	<h4>Introduction</h4>

	<p>This tutorial is aimed at those who wish to publish an iTunes-friendly audio podcast with <a href="http://www.textpattern.com">Textpattern</a>.  It&#8217;s skued towards an audio broadcast, but with a few mods you can rig it for video as well.  I wrote this tutorial because I felt that there was not a single comprehensive, easy-to-follow tutorial on the process of creating and publishing a podcast with Textpattern.  It should be noted that there are much easier ways to publish a podcast than this (i.e. <a href="http://www.feedburner.com">feedburner</a> and <a href="http://www.libsyn.com">libsyn</a> are two services that make it easy).  This tutorial is also aimed at the control freaks:  Those who like to have fine-grained control over everything they publish.  This document will show you how to generate a proper podcast feed, and how to set up an audio player so that visitors to your site can listen to streaming audio of your episodes.</p>
	<h4>What this tutorial will not show you</h4>

	<p>This tutorial does not show you how to create and / or edit an audio file.  It assumes that you know how to do that.  It doesn&#8217;t tell you all the ins and outs of using iTunes.  Read the podcast specs (link below) for that information. </p>

	<h4>Before you start</h4>

	<p>Before undertaking this tutorial, it is very important to read <a href="http://www.apple.com/itunes/store/podcaststechspecs.html">Apple&#8217;s tech specs for podcasters</a>.  There is a ton of valuable, easy-to-read information there.  Read it before proceeding.  Once you&#8217;ve read the specs, you&#8217;re ready to start.</p>

	<h4>Step One &#8211; Create Two New Sections</h4>

	<p>You&#8217;ll need to create two new sections &#8211; one in which you will post your podcast episodes, and one that will generate your podcast feed.  In this example, we&#8217;re going to name these two sections like so:</p>

	<ol>
		<li><strong>Podcast</strong>.  We will post our podcast episodes to this section.</li>
	</ol>
	<ol>
		<li><strong>Broadcast</strong>.  This section will generate a valid, iTunes-friendly <span class="caps">RSS</span> feed.</li>
	</ol>

	<p>Name these sections any names you want, but keep them consistent throughout this tutorial.    </p>

	<h4>Step Two &#8211; Download mg_setheader</h4>

	<p><a href="http://www.dev.michaelgravel.com/plugins/mg_setheader.php">Download my plugin <code>&#60;txp:mg_setheader /&#62;</code></a>.  Install and activate the plugin as per normal.  I&#8217;ll show you how to implement it later on.</p>

	<h4>Step Three &#8211; Name three new custom fields</h4>

	<p>You&#8217;ll need to name three new custom fields.  Custom fields are named in Admin &#62; Preferences &#62; Advanced.  If you need to expand the number of custom fields you have available (i.e., if you need more than 10 in total), please see <a href="http://gerhardlazu.com/blog/32/10-more-custom-fields-please">Gerhard Lazu&#8217;s tutorial on creating 10 more custom fields in Textpattern</a>. In this example, we&#8217;re naming our three new custom fields like so:</p>

	<ol>
		<li><strong>podcast-audio-url</strong>.  This is the <span class="caps">URL</span> (<span class="caps">NOT</span> the local path) to your podcast episode.</li>
		<li><strong>audio-file-bytes</strong>.  This is the size of our audio file in bytes (you can get this information by checking the properties of the file in Windows or Mac OS).</li>
	</ol>
	<ol>
		<li><strong>podcast-duration</strong>.  This is the length of the file in this format:  HH:MM:SS.  You can also go MM:SS.  <strong><span class="caps">PLEASE NOTE</span></strong> that the value you place here will be plunked directly into your feed.  If you plug in something like &#8220;3 minutes&#8221; in this field, you&#8217;ll get an error when you submit your feed to iTunes.</li>
	</ol>

	<h4>Step Four &#8211; Set up your feed template</h4>

	<p>Create a page template called &#8216;broadcast&#8217;. Make sure that the &#8216;broadcast&#8217; section is using the &#8216;broadcast&#8217; page template (set this in Presentation &#62; Sections).  Plunk the following into the &#8216;broadcast&#8217; page template:</p>

<pre><code>&#60;txp:mg_setheader value=&#34;application/rss+xml&#34; /&#62;&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;rss xmlns:itunes=&#34;http://www.itunes.com/dtds/podcast-1.0.dtd&#34; version=&#34;2.0&#34;&#62;
&#60;channel&#62;
&#60;title&#62;Example Podcast&#60;/title&#62;
&#60;link&#62;http://www.example.com&#60;/link&#62;
&#60;language&#62;en-us&#60;/language&#62;
&#60;copyright&#62;&#38;#x2117; &#38;amp; &#38;#xA9; 2007 onwards by The Author&#60;/copyright&#62;
&#60;itunes:subtitle&#62;A Podcast About Everything and Nothing&#60;/itunes:subtitle&#62;
&#60;itunes:author&#62;Fictitious Author&#60;/itunes:author&#62;
&#60;itunes:summary&#62;A good description of your podcast should go here.  This is what iTunes will use to search for your podcast.  Make it good and short.&#60;/itunes:summary&#62;
&#60;description&#62;A good description of your podcast should go here.  This is what iTunes will use to search for your podcast.  Make it good and short.&#60;/description&#62;
&#60;itunes:keywords&#62;example, example, example, example&#60;/itunes:keywords&#62;
&#60;itunes:owner&#62;
	&#60;itunes:name&#62;Fictitious Author&#60;/itunes:name&#62;
	&#60;itunes:email&#62;you@example.com&#60;/itunes:email&#62;
&#60;/itunes:owner&#62;
&#60;itunes:explicit&#62;No&#60;/itunes:explicit&#62;
&#60;itunes:image href=&#34;http://www.example.com/images/podcast-image.jpg&#34; /&#62;
&#60;itunes:category text=&#34;Main Category&#34;&#62;
	&#60;itunes:category text=&#34;Sub Category&#34; /&#62;
&#60;/itunes:category&#62;
&#60;txp:article_custom form=&#34;podcast&#34; limit=&#34;10&#34; section=&#34;podcast&#34; /&#62;
&#60;/channel&#62;
&#60;/rss&#62;
</code></pre>

	<p><strong>Notes on the above:</strong></p>

	<ul>
		<li>Change all tag information to your own.</li>
		<li>Note the position of the <code>&#60;txp:mg_setheader /&#62;</code> tag (you downloaded, installed, and activated this plugin in step #2, remember?).  This position is <span class="caps">NON NEGOTIABLE</span>.  It must reside at the top of the page and the opening <span class="caps">XML</span> tag <span class="caps">MUST</span> immediately follow it.  No spaces, no linebreaks.</li>
		<li>Be sure to change the <span class="caps">URL</span> in the <code>&#60;itunes:image&#62;</code> tag to the <span class="caps">URL</span> of your own podcast image.</li>
	</ul>
	<ul>
		<li>Change the category of your podcast to suit.</li>
	</ul>

	<p>Again, for those who missed it earlier, please read <a href="http://www.apple.com/itunes/store/podcaststechspecs.html">Apple&#8217;s tech specs for podcasters</a>.   The above will make alot more sense if you do.  Note that everything above the <code>&#60;txp:article_custom /&#62;</code> tag can be hard coded into the feed, OR you can use Textpattern tags (like <code>&#60;txp:site_url /&#62;</code> or <code>&#60;txp:site_slogan /&#62;</code> to generate the title or link, etc. </p>

	<p>This template will be called when iTunes (or another user agent) hits http://www.example.com/broadcast/.  We&#8217;re using the <code>&#60;txp:article_custom /&#62;</code> tag to pull in items from the &#8216;podcast&#8217; section.  In other words, when you want to post a new podcast episode, <span class="caps">DO NOT</span> post it to the &#8216;broadcast&#8217; section.  It won&#8217;t show up.  Post it to the &#8216;podcast&#8217; section. </p>

	<h4>Step Five &#8211; Create an article form called &#8216;podcast&#8217;</h4>

	<p>From the above step, you&#8217;ll notice that we also need to create an article form called &#8216;podcast&#8217;.  Create the form and plunk the following into it:</p>

<pre><code>&#60;item&#62;
&#60;title&#62;&#60;txp:title /&#62;&#60;/title&#62;
&#60;itunes:author&#62;&#60;txp:author /&#62;&#60;/itunes:author&#62;
&#60;itunes:subtitle&#62;&#60;txp:php&#62;$text = body ( array () ); echo strip_tags($text);&#60;/txp:php&#62;&#60;/itunes:subtitle&#62;
&#60;itunes:summary&#62;
&#60;txp:php&#62;$text = body ( array () ); echo strip_tags($text);&#60;/txp:php&#62;
&#60;/itunes:summary&#62;
&#60;description&#62;
&#60;![CDATA[&#60;txp:body /&#62;]]&#62;
&#60;/description&#62;
&#60;enclosure url=&#34;&#60;txp:custom_field name=&#34;podcast-audio-url&#34; /&#62;&#34; length=&#34;&#60;txp:custom_field name=&#34;audio-file-bytes&#34; /&#62;&#34; type=&#34;audio/mpeg&#34; /&#62;
&#60;guid&#62;&#60;txp:custom_field name=&#34;podcast-audio-url&#34; /&#62;&#60;/guid&#62;
&#60;pubDate&#62;&#60;txp:posted format=&#34;%a, %d %b %Y %I:%m:%S %z&#34; /&#62;&#60;/pubDate&#62;
&#60;itunes:duration&#62;&#60;txp:custom_field name=&#34;podcast-duration&#34; /&#62;&#60;/itunes:duration&#62;
&#60;itunes:explicit&#62;Yes&#60;/itunes:explicit&#62;
&#60;/item&#62;
</code></pre>

	<p><strong>Notes on the above:</strong>   </p>

	<ul>
		<li>The date format (%a, %d %b %Y %I:%m:%S %z) is non-negotiable.  This is the standard <span class="caps">RSS</span> date format.  If another format is used, your feed will be invalid.</li>
		<li>You may have to tweak the timezone (%z) to your own &#8211; you can throw that in there manually, if need be.</li>
		<li>Be sure to change the <code>&#60;itunes:explicit&#62;</code> tag to suit.  You could modify this on an article-to-article basis by using an additional custom field.</li>
		<li>Obviously, the above example won&#8217;t suit everyone&#8217;s fancy.  Feel free to tweak and modify as you see fit.  For instance, you might want to use a different field for the <code>&#60;itunes:subtitle&#62;</code> tag.  You could populate it with data from an additional custom field, if so desired.</li>
	</ul>
	<ul>
		<li>If you&#8217;re doing a video podcast, you&#8217;ll want to change the &#8216;type&#8217; attribute on the enclosure tag.  If you&#8217;re mixing media types (i.e. one episode is video, the next is audio), you could populate that attribute with an additional custom field so that the type is selectable on an article-to-article basis.</li>
	</ul>

	<h4>Step Six &#8211; Set up and tweak your podcast section</h4>

	<p>It&#8217;s good practice to have your audio content available for both podcast subscribers and regular visitors to your website.  You&#8217;ll need to get your hands on a drop-in audio player that you can include in your articles. Fortunately, someone has thought of this and made one available.  Here it is:  </p>

	<p><a href="http://www.textpatternmania.com/2006/04/29/plugin-jnmaudio">http://www.textpatternmania.com/2006/04/29/plugin-jnmaudio</a> </p>

	<p>Download the plugin and associated files and set them up as described on the above page.  The next step in this process is to create a page template for the &#8216;podcast&#8217; section and customize it as needed.  How you do that is completely up to you.  When you want to display the audio player for your visitors, you&#8217;d use this code in an article form:</p>

<pre><code>&#60;txp:jnm_audio url=&#34;.&#34;&#62;&#60;txp:custom_field name=&#34;podcast-audio-url&#34; /&#62;&#60;/txp:jnm_audio&#62;
</code></pre>

	<p>That will place the audio player on the page (provided that you have downloaded and installed the jnm_audio plugin as per instructions) and allow your visitors to listen to your podcast.  The above can also be accomplished by building your own audio player (in Dreamweaver, say) and using custom fields.  Again, how you actually implement this is completely up to you.</p>

	<p>The net effect of this step is this:  When someone visits www.example.com/podcast/, they can listen to your episodes on an audio player.  This has absolutely no effect on your podcast feed.</p>

	<h4>Step Seven &#8211; Posting a test episode</h4>

	<p>Before you submit your podcast to iTunes, it is <span class="caps">ABSOLUTELY</span> <span class="caps">IMPERATIVE</span> that you test the feed that you built in steps four and five.  It&#8217;s time to post a test episode.  You&#8217;ve set up your Textpattern templates and forms.  You&#8217;ve recorded your audio file.  Lets post a test epsiode and check the results.</p>

	<ul>
		<li>Make sure that you gather the information you need:  Size of the audio file in bytes (no commas in the value, i.e. 2,300,202 is not acceptable &#8211; 2300202 <strong>is</strong> acceptable), duration of audio file in HH:MM:SS format (or MM:SS), and the url of the audio file.  Obviously, the audio file must reside on a publicly-accessible web server.  If you&#8217;re using your own server, be aware of the bandwidth implications of audio files.  They chew up alot of transfer capacity really quick.</li>
		<li>Create a new article and place your information in the appropriate fields.  The body of the article will become the subtitle of the episode &#8211; this is what will show up in the &#8216;description&#8217; column in iTunes.</li>
		<li><strong>Make sure that you post your article to the &#8216;podcast&#8217; section.</strong>  Otherwise, it won&#8217;t show up in your feed.</li>
	</ul>
	<ul>
		<li>Once you&#8217;ve posted your test episode, have a look at your feed.  It should look something like this (with the correct values of course):</li>
	</ul>

<pre><code>&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;rss xmlns:itunes=&#34;http://www.itunes.com/dtds/podcast-1.0.dtd&#34; version=&#34;2.0&#34;&#62;
&#60;channel&#62;
&#60;title&#62;Example Podcast&#60;/title&#62;
&#60;link&#62;http://www.example.com&#60;/link&#62;
&#60;language&#62;en-us&#60;/language&#62;
&#60;copyright&#62;&#38;#x2117; &#38;amp; &#38;#xA9; 2007 onwards by The Author&#60;/copyright&#62;
&#60;itunes:subtitle&#62;A Podcast About Everything and Nothing&#60;/itunes:subtitle&#62;
&#60;itunes:author&#62;Ficitious Author&#60;/itunes:author&#62;
&#60;itunes:summary&#62;A good description of your podcast should go here.  This is what iTunes will use to search for your podcast.  Make it good and short.&#60;/itunes:summary&#62;
&#60;description&#62;A good description of your podcast should go here.  This is what iTunes will use to search for your podcast.  Make it good and short.&#60;/description&#62;
&#60;itunes:keywords&#62;example, example, example, example&#60;/itunes:keywords&#62;
&#60;itunes:owner&#62;
	&#60;itunes:name&#62;Fictitious Author&#60;/itunes:name&#62;
	&#60;itunes:email&#62;you@example.com&#60;/itunes:email&#62;
&#60;/itunes:owner&#62;
&#60;itunes:explicit&#62;No&#60;/itunes:explicit&#62;
&#60;itunes:image href=&#34;http://www.example.com/images/podcast-image.jpg&#34; /&#62;
&#60;itunes:category text=&#34;Arts&#34;&#62;
	&#60;itunes:category text=&#34;Design&#34; /&#62;
&#60;/itunes:category&#62;
&#60;item&#62;
&#60;title&#62;Episode Title&#60;/title&#62;
&#60;itunes:author&#62;Fictitious Athor&#60;/itunes:author&#62;
&#60;itunes:subtitle&#62;Body of test episode&#60;/itunes:subtitle&#62;
&#60;itunes:summary&#62;
Body of test episode
&#60;/itunes:summary&#62;
&#60;description&#62;
&#60;![CDATA[body of test epsiode]]&#62;
&#60;/description&#62;
&#60;enclosure url=&#34;http://www.example.com/audio/episode-1.mp3&#34; length=&#34;2116532&#34; type=&#34;audio/mpeg&#34; /&#62;
&#60;guid&#62;http://www.example.com/audio/episode-1.mp3&#60;/guid&#62;
&#60;pubDate&#62;Sat, 15 Jun 2007 17:00:00 MDT&#60;/pubDate&#62;
&#60;itunes:duration&#62;02:20&#60;/itunes:duration&#62;
&#60;itunes:explicit&#62;No&#60;/itunes:explicit&#62;
&#60;/item&#62;
&#60;/channel&#62;
&#60;/rss&#62;
</code></pre>

	<p>At this stage, you should definitely run your feed through a feed validator:  <a href="http://www.feedvalidator.org">http://www.feedvalidator.org</a>.  Just enter the <span class="caps">URL</span> of your feed.  In this example, you&#8217;d enter www.example.com/broadcast/.  If your feed is similar to the example above and it validates, it&#8217;s time to test it in iTunes.</p>

	<h4>Step Eight &#8211; Testing in iTunes</h4>

	<p>The real acid test of this whole process is testing your podcast feed in iTunes.  Obviously, you must have iTunes on your computer to do this.  Here are the steps:</p>

	<ul>
		<li>Launch iTunes.</li>
		<li>In the Advanced menu, select &#8216;Subscribe to Podcast&#8217;.</li>
		<li>Enter the <span class="caps">URL</span> of your podcast feed.  In this example, we&#8217;d enter www.example.com/broadcast/.</li>
	</ul>
	<ul>
		<li>Click OK.</li>
	</ul>

	<p>If your feed is good and you posted everything properly, iTunes should add your podcast to your list of podcasts and start downloading your first episode.  If this happens, cogratulations!  You&#8217;ve just entered the world of podcasting.  If it doesn&#8217;t happen, you&#8217;ll have to go back and troubleshoot.</p>

	<h4>Step Nine &#8211; Submit your podcast to iTunes</h4>

	<p>Read the <a href="http://www.apple.com/itunes/store/podcaststechspecs.html">podcaster tech specs</a> for complete details on how to submit your podcast to iTunes.</p>

	<h4>Thanks for reading    </h4>

	<p>I know this tutorial was exhaustive, but I hope it was worth it.  Thanks for reading.</p>

<p>&#8212; Michael Gravel</p>

<p>3 comments on this entry.  <a href="http://www.dev.michaelgravel.com/text/podcasting-with-textpattern-a-tutorial#comment">View comments (commentary closed).</a></p>
]]>
</description>
<link>http://www.dev.michaelgravel.com/text/podcasting-with-textpattern-a-tutorial</link>
<guid>http://www.dev.michaelgravel.com/text/podcasting-with-textpattern-a-tutorial</guid>
<pubDate>Sat, 28 Apr 2007 11:04:28 -0700</pubDate>

</item>



</channel>
</rss>