<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>Eli Van Zoeren: Blog</title>
    <link>http://elivz.com//blog/index/</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:rights>Copyright 2009 by Eli Van Zoeren</dc:rights>
    <dc:date>2009-11-02T01:45:54+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>VZ Members Fieldtype</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fvz_members%2F&amp;seed_title=VZ+Members+Fieldtype</link>
      <guid>http://elivz.com/blog/single/vz_members/</guid>
      <description><![CDATA[<p>VZ Members is my second fieldtype for Brandon Kelly&#8217;s <a href="http://brandon-kelly.com/fieldframe">FieldFrame</a> extension. I needed a way to select any number of site members to associate with an entry. In my case I am doing this to allow entry creators to set permissions on an entry-by-entry basis. You could also use it to link to the profiles of people mentioned in an article, or inside a Matrix field to create a list of events, each with a date, title, and the personnel who will be in attendance. If you find other creative ways to use VZ Members, please share them in the comments.</p>

<p>The fieldtype displays either a dropdown list or a group of checkboxes containing the members in one or more member groups. The allowed member groups can be set on a per-field basis. For each field you can also choose whether the user can select only one member (from a drop-down list) or any number of members (checkboxes).</p>

<h4>Prerequisites</h4>

<p>You must have <a href="http://brandon-kelly.com/fieldframe">FieldFrame</a> (tested on version 1.3.4+) installed to use VZ Members.</p>

<h4>Template Tags</h4>

<h5>Single Tags</h5>

<pre><code>{members_field}</code></pre>

<p>Will output a pipe-delimited list of member ids. You can also use the <code>separator</code> parameter to separate them with something other than a pipe. For instance <code>{members_field separator=', '}</code> would output something like: <code>1, 4, 5, 8</code>.</p>

<pre><code>{members_field:names}</code></pre>

<p>Will output a list of member screen names with a comma and space between each. You can also use the <code>separator</code> parameter to separate them with anything else. For instance <code>{members_field:names separator=' and '}</code> would output something like: <code>Bob Smith and Jane Doe and Jimmy Jones</code>.</p>

<pre><code>{members_field:is_allowed members="1|4" groups="3"}</code></pre>

<p>Checks if the members selected in this entry are among the members or groups specified in the tag parameters. Can also be used as a tag pair, in which case the content between the tags will only be displayed if the selected members are among those specified in the tag. You can specify member ids and/or group ids and either one can be a pipe-delimited list. For example, if you want to show a notice for every weblog entry where a super-admin was selected, use this code: <code>{members_field:is_allowed groups="1"}Super!{/members_filed:is_allowed}</code>. Please note that at this time, FieldFrame does not support using a variable as the value of a parameter. I am looking for a workaround to this issue.</p>

<h5>Tag Pair</h5>

<pre><code>{members_field}{id} - {screen_name}{/members_field}</code></pre>

<p>If you need more control over the output, use the tag pair.</p>

<p><strong>Optional Parameters:</strong></p>

<p><code>orderby=&#8220;id|username|screen_name|group_id&#8221;</code> - The column to use in ordering the output. Default is <code>id</code>.</p>

<p><code>sort=&#8220;asc|desc&#8221;</code> - Which order to sort in. Default is <code>asc</code>.</p>

<p><code>backspace=&#8220;2&#8221;</code> - Remove the last <em>x</em> characters from the final iteration.</p>

<p><strong>Variables:</strong></p>

<p><code>id</code> - The id of the current member.</p>

<p><code>username</code> - The login name of the current member.</p>

<p><code>screen_name</code> - The screen name of the current member.</p>

<p><code>group_id</code> - The id of the group to which the current member belongs.</p>

<p><code>count</code> - The number of the current iteration.</p>

<p><code>total</code> - The total number of members selected.</p>

<p><code>switch=&#8220;odd|even&#8221;</code> - Switch between multiple values each time through the loop.</p>

<h4>Installation</h4>

<p>Download and unzip the extension. Upload the files, following the folder structure in the download. You simply need to enable the VZ Members fieldtype in FieldFrame&#8217;s extension settings to be ready to go.</p>

<h4>Version History</h4>

<ul>
<li><strong>Version 0.97</strong> Fixed a couple bugs in the HTML output.</li>
<li><strong>Version 0.96</strong> Added <code>:is_allowed</code> tag.</li>
<li><strong>Version 0.95</strong> Initial public release. <em>May be buggy! Use at your own risk!</em> If you do find any bugs, please report them on the <a href="http://github.com/elivz/vz_members/issues">GitHub Issues page</a>.</li>
</ul>

<h4><a href="http://github.com/elivz/vz_members">Download VZ Members</a></h4>]]></description>
      <dc:subject>Expression Engine, Programming</dc:subject>
      <dc:date>2009-11-02T01:45:54+00:00</dc:date>
    </item>

    <item>
      <title>All New VZ Url fieldtype</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fnew_vz_url%2F&amp;seed_title=All+New+VZ+Url+fieldtype</link>
      <guid>http://elivz.com/blog/single/new_vz_url/</guid>
      <description><![CDATA[<p>This morning I pushed version 1.1 of my VZ Url fieldtype for <a href="http://brandon-kelly.com/fieldframe/">Brandon Kelly&#8217;s FieldFrame extension</a> up to GitHub. The code for this version completely rewritten to (hopefully!) eliminate some issues with ajax calls returning in the wrong order, leading to false negatives. While I was at it, I made the errors display in a pop-up box, allowing for more verbose errors without breaking the layout.</p>

<p><img src="http://elivz.com/images/uploads/vz_url_popup.jpg" alt="Pop-up error message" width="278" height="126" class="img_small" />There is also one significant new feature. Previously, if the entered url was redirected to another site (i.e. http://google.com, which redirects to http://www.google.com) it would be displayed as an error. Now, a more helpful message is show, with the option to update to the new url.</p>

<p>You can <a href="http://elivz.com/blog/single/vz_url_extension/">get the full details on VZ Url from my original post</a> or <a href="http://github.com/elivz/vz_url" title="Download VZ Url">download it from GitHub</a>.
</p>]]></description>
      <dc:subject>Expression Engine, Programming</dc:subject>
      <dc:date>2009-10-25T15:53:53+00:00</dc:date>
    </item>

    <item>
      <title>Securing your downloads with mod_xsendfile</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fmod_xsendfile%2F&amp;seed_title=Securing+your+downloads+with+mod_xsendfile</link>
      <guid>http://elivz.com/blog/single/mod_xsendfile/</guid>
      <description><![CDATA[<p>I know I haven&#8217;t been the best blogger lately (in part because I&#8217;ve been <a href="http://www.newmediacampaigns.com">blogging over at my new job</a>). So to help remedy that I am going to try posting more short tips and snippets. These are things I want to be able to refer back to myself, and that I think might be useful to other people.</p>

<h3>Why use mod_xsendfile?</h3>

<p>In many case you have files available through your webapp that should only be accessible to certain people. You don&#8217;t want to rely on security through obscurity (throwing them all in a public folder, but only showing the links to certain visitors). Although that will deter casual users from getting ahold of the forbidden files, once someone has the link they could post it anywhere and your security is blown. What you want to do is to squirrel the files away outside of your publicly-accessible folder and then give them out as needed once a user is validated by whatever authentication method you are using.</p>

<p>Apache&#8217;s <a href="http://tn123.ath.cx/mod_xsendfile/">mod_xsendfile module</a> (inspired by <a href="http://blog.lighttpd.net/articles/2006/07/02/x-sendfile">lighthttpd&#8217;s X-Sendfile</a>) is the tool for this job. By intercepting http requests with the &#8220;X-Sendfile&#8221; header and outputting the contents of a specified file, it both enables per-file authentication and is more efficient than processing the file contents through your server-side script and sending it to the browser that way. The file path you give to mod_xsendfile doesn&#8217;t need to be in the server&#8217;s public folder, so it is a very secure way to store sensitive files.</p>

<h3>Installing on Mac OS X</h3>

<p>(<em>Installing on any Apache server will be similar, but I use OS X for development, so that is what these instructions are based on.</em>)</p>

<h4>Prerequisites:</h4>
<ul>
<li>Xcode Developer Tools (which is can be installed from your OS X DVD)</li>
<li>Basic knowledge of the command line</li>
</ul>

<h4>Download the source</h4>

<p>Open up the Terminal and create a folder to hold the mod_xsendfile source files:</p>

<pre><code>mkdir ~/src
cd ~/src</code></pre>

<p>Now download the source and uncompress it:</p>

<pre><code>curl -O http://tn123.ath.cx/mod_xsendfile/mod_xsendfile-0.9.tar.gz
tar xzvf mod_xsendfile-0.9.tar.gz
cd mod_xsendfile-0.9</code></pre>

<p>Compile and install it:</p>

<pre><code>sudo apxs -cia mod_xsendfile.c</code></pre>

<p>You will have to enter your password and it will do its thing. Finally you need to enable the module. You can choose to do this globally in your httpd.conf file or for just a particular project in a .htaccess file. Either way, the syntax is the same:</p>

<pre><code># Enable mod_xsendfile
XSendFile On
# Allow sending files from above the requested uri
XSendFileAllowAbove On</code></pre>

<p>Finally restart Apache by opening your System Preferences and in the Sharing pane unchecking and re-checking the &#8220;Web Sharing&#8221; option.</p>

<h3>Sending a file</h3>

<p>This part is easy. Just set the x_sendfile header with the path to the file you want to send. Make sure you check first if the current user is allowed to access the file! They will not see the xsendfile header or have any way of knowing where the file is actually stored.</p>

<h4>In PHP</h4>

<pre><code>header("X-Sendfile: $filePath");
header("Content-Disposition: attachment; file=$fileName");</code></pre>

<h4>In Ruby on Rails</h4>

<pre><code>response.headers['X-Sendfile'] = @file.path
response.headers['Content-Disposition'] = "attachment; filename=#{@file.file_name}"
render :nothing => true</code></pre>]]></description>
      <dc:subject>Programming</dc:subject>
      <dc:date>2009-10-20T02:21:19+00:00</dc:date>
    </item>

    <item>
      <title>VZ Url extension</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fvz_url_extension%2F&amp;seed_title=VZ+Url+extension</link>
      <guid>http://elivz.com/blog/single/vz_url_extension/</guid>
      <description><![CDATA[<p><a href="http://brandon-kelly.com/">Brandon Kelly</a> has done the <a href="http://expressionengine.com">Expression Engine</a> developer community a great service with the release yesterday of his <a href="http://wiki.github.com/brandonkelly/bk.fieldframe.ee_addon/">FieldFrame</a> extension. He has created a framework for the quick development of new fieldtypes (like the XHTML and drop-down types that come with EE). I couldn&#8217;t resist experimenting with FieldFrame, and&#8212;aside from a few areas that are not yet documented&#8212;it is as easy as promised.</p>

<p>I whipped up a Url fieldtype, somewhat similar to <a href="http://www.designchuchi.ch/index.php/blog/comments/url-field-extension-for-expressionengine/">Designchuchi&#8217;s URL Field Extension</a>, but with the addition of ajax url validation. When the user leaves the url field, it will ping the url they entered and display an error message if it doesn&#8217;t find a valid webpage there.</p>

<p>Please note that VZ Url will not prevent the user from saving their weblog entry if if cannot validate the url&#8212;it just warns them. This is intentional, perhaps they are linking to a page they have not yet created, or the site they are linking to is currently down but they know the url is correct. I may add this functionality as an option later on.</p>

<h4>Prerequisites</h4>

<p>You must have the <em>FieldFrame</em> and <em>jQuery for the  Control Panel</em> extensions installed and enabled. Your server will also need to have the CURL library enabled for the link checking to work.</p>

<h4>Installation</h4>

<p>Download and unzip the extension below. Upload the files, following the folder structure in the download. You will need to enable the VZ Url fieldtype in FieldFrame&#8217;s extension settings. Then you will need to go back to FieldFrame&#8217;s settings &amp; show the settings for VZ Url to set the error message that will be shown if the url is invalid.</p>

<p>That&#8217;s it! Now you can use the VZ Url field type anywhere you were previously using a plain text field. Switching from a Text Field to a VZ Url field (or vice-versa) will not affect your data.</p>

<h4>Version History</h4>

<ul>
<li><strong>Version 1.1.7</strong> Changed handling of redirected url. They are now considered valid as-is, but with the pop-up prompt to update to the final url. Also fixed a bug in checking multiple VZ Url fields when editing an existing entry.</li>
<li><strong>Version 1.1.4</strong> Removed hard-coded url to a testing copy of proxy.php that I had mistakenly left in.</li>
<li><strong>Version 1.1.3</strong> No longer equates &#8220;no url&#8221; as &#8220;invalid url&#8221;.</li>
<li><strong>Version 1.1.2</strong> Compatible with PHP &lt; 5.2. Compatible with Multi-Site Manager installations. Slight styling fixes.</li>
<li><strong>Version 1.1.1</strong> Checks to make sure it&#8217;s even a valid url before trying to ping the remote server.</li>
<li><strong>Version 1.1</strong> Completely refactored code. Displays errors&#8212;inluding a new message for redirected urls&#8212;in a new, prettier, pop-up box. Hopefully also fixed all the bugs mentioned in the comments up to now. <a href="http://elivz.com/blog/single/new_vz_url/">Read more in my blog post</a>.</li>
<li><strong>Version 1.0.2</strong> Preparation for FieldFrame 1.2&#8212;thanks to Brandon Kelly!</li>
<li><strong>Version 1.0</strong> Now checks urls as you type, rather than waiting until you move to the next field. Also some aesthtic adjustments.</li>
<li><strong>Version 0.9.9</strong> Cleaned up the design, refactored the javascript, and added support for FF Matrix.</li>
<li><strong>Version 0.9.8</strong> Moved some code around to simplify things.</li>
<li><strong>Version 0.9.7</strong> Update to new API structure in FieldFrame 0.9.5; moved to GitHub.</li>
<li><strong>Version 0.9.6</strong> Minor update to take advantage of new features in FieldFrame 0.9.2.</li>
<li><strong>Version 0.9.5</strong> Initial public release. <em>May be buggy! Use at your own risk!</em> But please tell me if you do find any bugs and I will do my best to fix them.</li>
</ul>

<h4><a href="http://github.com/elivz/vz_url">Download VZ Url</a></h4>]]></description>
      <dc:subject>Expression Engine, Programming</dc:subject>
      <dc:date>2009-03-11T22:07:46+00:00</dc:date>
    </item>

    <item>
      <title>listFilter jQuery plugin</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Flistfilter_plugin%2F&amp;seed_title=listFilter+jQuery+plugin</link>
      <guid>http://elivz.com/blog/single/listfilter_plugin/</guid>
      <description><![CDATA[<p>A project I am working on needed a way to filter a long list of staff members. We needed to be able to filter by several different criteria, and several different interfaces (text search, dropdown lists). And it needed to happen in-place&mdash;no page reloads. Thus my listFilter <a href="http://jquery.com">jQuery</a> plugin was born.</p>

<p>listFilter allows you to automatically filter out items from a list on the fly, using any number of criteria and data items. You can <a href="/examples/listFilter/">look at the example</a> to see how it works.</p>

<h3>How to use</h3>

<p>First you need to inlude jQuery and the plugin script:</p>

<p><code>&lt;script src=&#8221;/scripts/jquery.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;/scripts/jquery.listfilter.js&#8221;&gt;&lt;/script&gt;</code></p>

<p>You will need to things in you page: a list to filter and a form containing the controls you will use to set the filter criteria. These controls can be text inputs, textboxes, or select boxes. The list can be an actual list&#8212;&lt;ul&gt; or &lt;ol&gt;&#8212;or it can be any other element containing a group of similar elements (for instance a &lt;table&gt;, which contains &lt;tr&gt; elements). The trick here is that each filter criteria needs to match up with a sub-element of the list items. So if your list item looks like this: <code>&lt;li&gt;&lt;h3 class=&#8220;name&#8221;&gt;Name&lt;/h3&gt; &lt;p&gt;Plumber&lt;/p&gt;&lt;/li&gt;</code>, you could have a criteria form that looks like this:</p>

<p><code>&lt;form id=&#8220;criteria&#8221;&gt;<br />
&nbsp;  &lt;label&gt;Name:&gt; &lt;input type=&#8220;text&#8221; id=&#8220;name_filter&#8221; /&gt;<br />
&nbsp;  &lt;label&gt;Job:&gt; &lt;input type=&#8220;text&#8221; id=&#8220;job_filter&#8221; /&gt;<br />
&lt;/form&gt;</code></p>

<p>You will notice that the <em>id</em> of each filter matches the <em>class</em> of an item in the list, with &#8220;_filter&#8221; added to the end. That is how the script knows what to filter.</p>

<p>Finally, you need to initialize the filtering with this line of code (either in the head of you document, or in an external script):</p>

<p><code>$(document).ready(function() {<br />
   $('#listToFilter').listFilter('#criteria');<br />
});</code></p>

<p>There are three optional settings that you can pass to the listFilter function as a second parameter. <em>listElement</em> lets you specify the child element of <code>#listToFilter</code> that represents an individual item (default is &#8220;li&#8221;). <em>transition</em> specifies the effect used to show and hide the list items&#8212;can be &#8220;toggle&#8221;, &#8220;slide&#8221;, or &#8220;fade&#8221; (default is &#8220;toggle&#8221;). Finally, <em>speed</em> specifies the speed at which the transition will take place (default is 500). So if you wanted to filter the rows of a table by sliding unneeded rows up slowly, you would use:</p>

<p><code>$(document).ready(function() {<br />
   $('#tableToFilter').listFilter('#criteria', {listElement: 'tr', transition: 'slide', speed: 2000});<br />
});</code></p>

<h3><a href="http://elivz.com/examples/listFilter/jquery.listfilter.js">Download the script</a></h3>

<p>Leave a comment if you have any questions or improvements. This plugin is loosely based on liveSearch by <a href="http://orderedlist.com/articles/live-search-with-quicksilver-style-for-jquery">John Nunemaker</a> as revised by <a href="http://ejohn.org/blog/jquery-livesearch/">John Resig</a>.
</p>]]></description>
      <dc:subject>Programming</dc:subject>
      <dc:date>2009-02-13T20:57:45+00:00</dc:date>
    </item>

    <item>
      <title>New Business Cards</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fnew_business_cards%2F&amp;seed_title=New+Business+Cards</link>
      <guid>http://elivz.com/blog/single/new_business_cards/</guid>
      <description><![CDATA[<p>I finally got around to having new business cards printed (actually, I got them about a month ago, but I am just getting around to writing about them). Last summer I gave up my old New Orleans-local phone number when I bought my iPhone and had been procrastinating on ordering cards with the new number.</p>

<p>Part of the reason for my procrastination was the need to decide how and where I wanted them printed: Should I spend more to get them letterpressed? Should I get them from one of the many super-cheap online printers? Could I do it locally and/or sustainably? In the end, I went with <a href="http://www.themandatepress.com/">The Mandate Press</a>, a low-cost letterpress shop out of Salt Lake City. They have a running deal on 250 <a href="http://yhst-28030640693459.stores.yahoo.net/suyoownde.html">custom business cards</a> for $95. With a discount coupon (do a search, the coupon codes are everywhere) and shipping, my total came to $93. The tradeoff for such a low price is not having any options for paper or ink color, and a two- to three-week wait for the cards.</p>

<p><img src="http://elivz.com/images/uploads/business_card.jpg" alt="Eli Van Zoeren's business card" class="img_wide" width="578" height="300" /></p>

<p>Overall, I am satisfied with my cards. <a href="http://www.crane.com/CraneLettra/">The paper</a> is good quality&#8212;thick and white with a nice texture. There is a noticeable impression around the letters, which is reason to pay extra for letterpress, right? The printing itself could be better, though. It looks like there wasn&#8217;t quite enough ink on the press, so the black band, in particular, isn&#8217;t actually black. It has the same white specks peeking through that you would expect in a newspaper. I guess for a third the price of anywhere else I have seen, I don&#8217;t expect perfection; and I would certainly consider ordering from Mandate again. But if you really need to impress people with the quality of your card you will probably need to look elsewhere (or use one of Mandate&#8217;s custom options, which I expect are more tightly controlled).
</p>]]></description>
      <dc:subject>Business, Graphic Design</dc:subject>
      <dc:date>2009-01-02T20:30:13+00:00</dc:date>
    </item>

    <item>
      <title>Roadblock extension</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Froadblock_extension%2F&amp;seed_title=Roadblock+extension</link>
      <guid>http://elivz.com/blog/single/roadblock_extension/</guid>
      <description><![CDATA[<p>This is my first (public) extension for <a href="http://expressionengine.com">Expression Engine</a>. A site I am working on for a client needed a way to display the Terms of Use every time a user logs in&#8230;and it needed to be on a by-computer basis, rather than a by-user basis, since more than one person will be using the same login credentials.</p>

<p>What Roadblock does is look every time someone logs in to see if they have been shown a message yet, and how long ago. If they have not yet seen the roadblock, or if it was over a specified length of time ago, the roadblock will be displayed (or, optionally, they will be sent to a url of your choosing). Although I built it for displaying the term of use, it would also be useful for displaying reminders or instructions. <strong>Please note:</strong> There is no checking to ensure that the user &#8220;agrees&#8221; to the message. If you need their access to the site to be conditional on accepting an agreement, you will have to look elsewhere.</p>

<h3>Installation</h3>

<p>Download the file <a href="http://elivz.com/files/ext.roadblock.zip">ext.roadblock.zip</a>. Inside the archive you will find two files: lang.roadblock.php goes in your language/english folder and ext.roadblock.php goes in the extensions folder. You can now enable it in the extensions section of your control panel.</p>

<h3>Settings</h3>

<p><em>Users should see the roadblock</em> The interval between displays of the roadblock for each user.</p>

<p><em>Track users by</em> We can either keep track of who has seen the roadblock by User ID or by Computer. The latter option uses cookies, meaning that if the same user logs on using two different computers (or browsers) they will be shown the roadblock twice.</p>

<p><em>Url to redirect to</em> By default, the roadblock message will be shown in your User Message template (as defined in the Specialty Templates section of the CP) with a link to this address at the bottom. Normally, this would be the home page of you website (which it is set to by default). Optionally, you can leave the remaining settings fields blank, in which case this address will be used as the roadblock itself. This option allows you to create a unique template for the roadblock message, or create additional functionality within it.</p>

<p><em>Title</em> &amp; <em>Text</em> This is the actual content of the roadblock message. Anything you put in the <em>Text</em> field will be run through EE&#8217;s Xhtml processor.</p>

<p><em>Link text</em> The link to continue on to the website.</p>

<p><em>Url to redirect to when the roadblock is not shown</em> If this field is filled in, the user will be routed directly to the specified url when the roadblock is not shown, bypassing the Expression Engine &#8220;you are logged in&#8221; confirmation message.</p>

<h3>Disclaimer</h3>

<p>Remember, this is my first real extension, and I have tested it on my own system but if it blows up you installation of Expression Engine I cannon be held responsible. <strong>Use at your own risk!</strong></p>

<p>If you have questions, find bugs, or otherwise need help, please see my post on the <a href="http://expressionengine.com/forums/viewthread/93878/">Expression Engine Forums</a>.
</p>]]></description>
      <dc:subject>Expression Engine, Web design</dc:subject>
      <dc:date>2008-10-14T20:04:34+00:00</dc:date>
    </item>

    <item>
      <title>Are people really convinced by this?</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fare_people_really_convinced_by_this%2F&amp;seed_title=Are+people+really+convinced+by+this%3F</link>
      <guid>http://elivz.com/blog/single/are_people_really_convinced_by_this/</guid>
      <description><![CDATA[<p>This election is getting <a href="http://www.johnmccain.com/Informing/Multimedia/Player.aspx?guid=848322d6-92fe-403e-9cc7-85b6b3ee4011" title="Celeb" TV ad">more</a> and <a href="http://online.wsj.com/article_email/SB121755336096303089-lMyQjAxMDI4MTA3MTUwNTEzWj.html" title="Too Fit to Be President?">more</a> <a href="http://www.johnmccain.com/Informing/Multimedia/Player.aspx?guid=779c7d13-7d76-47a5-a4cd-e928e8f1f1d6" title=""The One" TV ad">ridiculous</a>.
</p>]]></description>
      <dc:subject>Politics</dc:subject>
      <dc:date>2008-08-01T20:49:54+00:00</dc:date>
    </item>

    <item>
      <title>Elevated initial caps with jQuery</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Finitial_caps%2F&amp;seed_title=Elevated+initial+caps+with+jQuery</link>
      <guid>http://elivz.com/blog/single/initial_caps/</guid>
      <description><![CDATA[<p>For a project I am currently working on I wanted to use elevated initial capitals to set off each block of text. The obvious way to do this would have been with the <code><a href="http://reference.sitepoint.com/css/pseudoelement-firstletter">:first-letter</a></code> pseudo-element, which is what I initially did. This worked great in Safari, but in Internet Explorer, I got a series of bugs and idiosyncrasies that eventually became more trouble than they were worth. Line spacing was alternately too loose or too tight, depending on what I did, and in IE6 it interacted with the <a href="http://code.google.com/p/ie7-js/">IE7-js</a> script to make all but the first paragraph tiny.</p>

<p>So I turned to jQuery to wrap the first letter of the first paragraph with a <code>&lt;span&gt;</code> tag that I could style however I wanted. I found inspiration for this script on the <a href="http://www.learningjquery.com/2006/10/fancy-drop-cap-part-2">Learning jQuery</a> website, but I couldn&#8217;t find a pre-made script that would do exactly what I needed. So here is my script, hopefully it will help someone else out.</p>

<h4>Stylesheet</h4>

<pre><code>.init-cap {
&nbsp;&nbsp;font-size: 1.5em;  /* Set the size of the raised letter */
&nbsp;&nbsp;line-height: 1.2em;  /* Adjust the line spacing */
&nbsp;&nbsp;}</code></pre>

<h4>Javascript</h4>

<pre><code>$(document).ready(function() {
&nbsp;&nbsp;$('.cap p:first').each(function() {
&nbsp;&nbsp;&nbsp;&nbsp;var text = $(this).html();
&nbsp;&nbsp;&nbsp;&nbsp;var first_letter = text.substr(0,1);
&nbsp;&nbsp;&nbsp;&nbsp;if ( /[a-zA-Z]/.test(first_letter) ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).html('&lt;span class="init-cap"&gt;' + first_letter + '&lt;/span&gt;' + text.slice(1));
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}); 
});</code></pre>

<p>What we are doing is selecting the first paragraph inside each element with the class &#8220;cap&#8221; applied to it. We then chop the first letter off that paragraph, check to be sure it is really a letter (rather than a tag, for instance), and add it back on wrapped inside a <code>&lt;span&gt;</code> tag. By adjusting the CSS, this could easily be used for drop-caps, as well.
</p>]]></description>
      <dc:subject>Programming, Web design</dc:subject>
      <dc:date>2008-07-02T19:44:39+00:00</dc:date>
    </item>

    <item>
      <title>Photoblog updates</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Fphotoblog_updates%2F&amp;seed_title=Photoblog+updates</link>
      <guid>http://elivz.com/blog/single/photoblog_updates/</guid>
      <description><![CDATA[<p>I finally had time today to migrate the &#8220;Photography&#8221; section of my website over to the Expression Engine system that I am using for the rest of the site. So now everything is under one roof, with the same interface for uploading photos as for writing blog posts. Everything looks and works more or less the same, but it is easier for me to maintain.</p>

<p>I have been using <a href="http://www.pixelpost.org/">PixelPost</a> for my photoblog for nearly two years, since I got tired of the size limit of photos in Blogger. PixelPost always served me well, and as a purpose-built photoblog package, it can&#8217;t be beat. However, it has suffered from a (seeming) lack of developer attention lately, and is now showing it&#8217;s age.</p>

<p><a href="http://elivz.com/photo/"><img src="http://elivz.com/images/uploads/photoblog.jpg" alt="Photoblog screenshot" class="img_med" /></a>Since there is no native export functionality in PixelPost, I had to write a custom script to dump the database into the MoveableType export format that EE will import. That worked pretty well, although there were a few things I had to go in and fix by hand. When I have some spare time, I will try to clean up the script and make it available for anyone in my situation. (Or contact me if you want a copy of the file to play with.)</p>

<p>If you were subscribed to my photography RSS feed, please update your subscriptions to the new link: <a href="http://elivz.com/photo/feed/">http://elivz.com/photo/feed/</a>. It should redirect the old address, but I may not keep the redirect active forever.</p>

<p>Hope you enjoy! I am going up to Portland, ME tomorrow, so I should have some new photos to post, as well.</p>

<p>
</p>]]></description>
      <dc:subject>Expression Engine, Web design, Photography</dc:subject>
      <dc:date>2008-05-30T01:16:00+00:00</dc:date>
    </item>

    <item>
      <title>Return to Durham</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Freturn_to_durham%2F&amp;seed_title=Return+to+Durham</link>
      <guid>http://elivz.com/blog/single/return_to_durham/</guid>
      <description><![CDATA[<p>I am going to be back in Durham from June 3rd through the 14th. To anyone who will be there, let&#8217;s get together!</p>

<p><a href="http://www.amandavs.com">Amanda</a> has some final scanning and printing of photos to do at Duke in preparation for her show in August. I will also be working on some design projects, but I expect to have plenty of free time. So give me a call, we&#8217;ll have a drink on my porch, go for a walk, or you can make me dinner (all of our dishes and cookware will still be here in Somerville).
</p>]]></description>
      <dc:subject>Personal</dc:subject>
      <dc:date>2008-05-28T15:49:01+00:00</dc:date>
    </item>

    <item>
      <title>Inline image replacement</title>
      <link>http://elivz.com/feeder/?FeederAction=clicked&amp;feed=Blog+Feed&amp;seed=http%3A%2F%2Felivz.com%2Fblog%2Fsingle%2Finline_image_replacement%2F&amp;seed_title=Inline+image+replacement</link>
      <guid>http://elivz.com/blog/single/inline_image_replacement/</guid>
      <description><![CDATA[<p>You may have noticed the very last line on this website, crediting the <a href="http://expressionengine.com">cms</a> and <a href="http://www.webfaction.com">host</a> I am using. It turned out to be much more difficult to make that effect work than I was expecting, so I thought I would explain my code for anyone else who needs to do something similar.</p>

<p>The easiest solution would have been to use an <code>&lt;img /&gt;</code> tag in the flow of the text. There were two problems with this: The first is my philosophical issue with using an image tag when semantically I want text. The second problem is making the image change color when the user hovers their mouse over it, like all the other links on the page. Of course I could have set up and onMouseOver script that would switch the images, but I didn&#8217;t like that, either. The classic image-replacement trick of saving both the normal and the &#8220;hot&#8221; images in one file and then adjusting the <code>background-image-position</code> in css is so much faster and more elegant.</p>

<p>So I started looking at image replacement techniques. Unfortunately, all the standard methods require the replaced image to be a block-level element. This obviously won&#8217;t work in my case, since it would put each image on a separate line. With a bit of experimentation, I found a method that allows me to keep the replaced image as an inline element, keeps the link and tooltip active, and even lets me underline the image on mouseover, just like a normal link.</p>

<h4>First try</h4>

<p>I am going to be working with this xHTML for my first experiments:</p>

<p><code>&lt;p&gt;This is a line of text with a &lt;a href=&#8221;#&#8221; class=&#8220;replaced&#8221; id=&#8220;butterfly&#8221;&gt;butterfly&lt;/a&gt; in the middle.&lt;/p&gt;</code></p>

<p>I want to replace the word butterfly with an image of a butterfly: <img src="http://elivz.com/images/uploads/butterfly.png" alt="Butterfly image" /></p>

<p>There is a CSS <code>position</code> property called &#8220;inline-block&#8221; that would seem to combine the necessary qualities of both &#8220;inline&#8221; positioning&mdash;keeping the replaced image inside the flow of text&mdash;and &#8220;block&#8221; positioning&mdash;creating a defined space that an image can be placed in. And it does, except that it is not part of the CSS specification and Firefox doesn&#8217;t support it. However, Firefox does support their own implementation, called &#8220;-moz-inline-box&#8221;. So combining those with the standard image-replacement code, we get:</p>

<p><code><br />
.replaced {<br />
	display: inline-block;<br />
	display: -moz-inline-box;<br />
	background-repeat: no-repeat;<br />
	background-position: 0 0;<br />
	overflow: hidden;<br />
	text-indent: -9999px;<br />
}
#butterfly {<br />
	width: 22px;<br />
	height: 18px;<br />
	background: url(butterfly.png) no-repeat;<br />
}
</code></p>

<p>Which gives us:</p>

<p>&nbsp;</p><style type="text/css">#example-1 { display: inline-block; display: -moz-inline-box; overflow: hidden; text-indent: -9999px; width: 22px; height: 18px; background: url(http://elivz.com/images/uploads/butterfly.png) no-repeat 0 0; }</style><p>This is a line of text with a <a href="#"  id="example-1">butterfly</a> in the middle.</p>

<p>That&#8217;s close&mdash;the image shows up in the middle of the sentence, as desired, but in Firefox and IE the image is still overlaid with text.</p>

<h4>Second Try</h4>

<p>Adding two new rules to the stylesheet will make it work in Firefox:</p>

<p><code>.replaced {<br />
	display: inline-block;<br />
	display: -moz-inline-box;<br />
	background-repeat: no-repeat;<br />
	background-position: 0 0;<br />
	overflow: hidden;<br />
	text-indent: -9999px;<br />
	font-size: 0;<br />
	vertical-align: text-top;<br />
}</code></p>

<p>&nbsp;</p><style type="text/css">#example-2 { display: inline-block; display: -moz-inline-box; overflow: hidden; text-indent: -9999px; font-size: 0; vertical-align: text-top; width: 22px; height: 18px; background: url(http://elivz.com/images/uploads/butterfly.png) no-repeat 0 0; } </style><p>This is a line of text with a <a href="#" id="example-2">butterfly</a> in the middle.</p>

<p>But Internet Explorer, the bad boy of the browser world, only shows a little glob at the top of where the image should be. Fortunately, my default solution to all IE bugs works in this case. Adding <code>zoom: 1</code> gives the image &#8220;<a href="http://www.satzansatz.de/cssd/onhavinglayout.html">layout</a>&#8221; and causes it to re-appear. (Incidentally, both <code>display: inline-block</code> and setting the dimensions should trigger hasLayout, but for some reason they don&#8217;t in this case.) <code>Zoom</code> is a Microsoft proprietary extension to CSS, so it won&#8217;t validate, but neither will <code>display: -moz-inline-box</code>. If that bothers you, move them to alternate style sheets&hellip;I&#8217;m not too worried about it.</p>

<h4>Underlining on hover</h4>

<p>On my site, like many others, an line appears under links when you place your mouse over them. Since I wanted to directly replace the text in my sentence with an image, it would make sense that it would also have the underline. If you have a rule in your stylesheet for <code>a:hover</code> already, the image-replaced link will inherit it automatically, but the line will be directly under the image rather than a few pixels lower like it would be with normal text. So I add some padding to the bottom on hover. I also adjust the background position to show the second, hightlighted, image that is below the normal one.</p>

<p><code>#butterfly:hover {<br />
	background-position: 0 -18px;<br />
	border-bottom: 1px solid;<br />
	padding: 0 0 2px;<br />
}</code></p>

<p>&nbsp;</p><style type="text/css">#example-3 { display: inline-block; display: -moz-inline-box; overflow: hidden; text-indent: -9999px; font-size: 0; vertical-align: text-top; width: 22px; height: 18px; background: url(http://elivz.com/images/uploads/butterfly.png) no-repeat 0 0; } #example-3:hover { background-position: 0 -18px; border-bottom: 1px solid; padding: 0 0 2px; }</style><p>This is a line of text with a <a href="#" id="example-3">butterfly</a> in the middle.</p>

<p>Looks great, right? Except if you are using Firefox, which refuses to add the padding to the bottom. As reported by <a href="http://www.getfirebug.com/">Firebug</a>, Firefox actually decreases the height of the element to cancel out the added padding. Weird. The only solution I have found requires adding an extra <code>&lt;span&gt;</code>, which I generally avoid. I moved a number of CSS rules to the new span and added three extra rules. The line height of the span is set to the height of the image, to prevent it from showing part of the highlighted image below. Also, IE7 no longer shows the &#8220;hand&#8221; cursor, so I added a rule to fix that. Lastly, I added -3 pixels of margin to the bottom to offset the padding and border.</p>

<p>The final code is:</p>

<p><code>&lt;p&gt;This is a line of text with a &lt;a href=&#8221;#&#8221; class=&#8220;replaced&#8221; id=&#8220;butterfly&#8221;&gt;&lt;span&gt;butterfly&lt;/span&gt;&lt;/a&gt; in the middle.&lt;/p&gt;</p>

<p>.replaced {<br />
	display: inline-block;<br />
	display: -moz-inline-stack;<br />
	background-repeat: no-repeat;<br />
	background-position: 0 0;<br />
	vertical-align: text-top;<br />
	zoom: 1;<br />
}
.replaced span {<br />
	display: block;<br />
	overflow: hidden;<br />
	text-indent: -9999px;<br />
	line-height: 18px;<br />
	cursor: pointer;<br />
}
#butterfly {<br />
	width: 22px;<br />
	background: url(butterfly.png) no-repeat;<br />
}
#butterfly:hover {<br />
	background-position: 0 -18px;<br />
	border-bottom: 1px solid;<br />
	padding-bottom: 2px;<br />
	margin-bottom: -3px;<br />
}</code></p>

<p>And the final result is:</p>

<style type="text/css">#example-4 { display: inline-block; display: -moz-inline-box; vertical-align: text-top; zoom: 1; width: 22px; background: url(http://elivz.com/images/uploads/butterfly.png) no-repeat 0 0; } #example-4 span { display: block; overflow: hidden; text-indent: -9999px; line-height: 18px; cursor: pointer; }&nbsp;  #example-4:hover { background-position: 0 -18px; border-bottom: 1px solid; padding-bottom: 2px; margin-bottom: -3px; }</style><p>This is a line of text with a <a href="#" id="example-4"><span>butterfly</span></a> in the middle.</p>

]]></description>
      <dc:subject>Web design</dc:subject>
      <dc:date>2008-05-22T21:54:54+00:00</dc:date>
    </item>

    
    </channel>
</rss>