<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
			<title>RSS Feed</title>
			<link>http://scottydelicious.com/feed.xml</link>
			<description></description>
			<language>en</language>
			<copyright>Scotty Delicious: DFPA 2007</copyright>
			<ttl>120</ttl><item>
	<title>FileDownloadPE</title>
	<link>http://scottydelicious.com/blog/2008/06/15/filedownloadpe</link>
	<description><![CDATA[ <p>
    FileDownloadPE (Pirate Edition) is a secure file downloading 
    snippet for the <a class="external_link" href="http://modxcms.com" 
    title="MODx CMS/F">MODx CMS/F</a>. FileDownloadPE is secure as
    it hides the actual path to your file. FileDownloadPE keeps track of
    how many times each file has been downloaded and lets you display
    that number wherever you want. There are no extra plugins to install 
    with FileDownloadPE, and you can have multiple download links per page.
    Each "FileDownloadPE" file being served is a MODx document, so you have
    the full service of Access Control Lists (ACL) meaning you have the
    ability to restrict downloads to certain groups.
    FileDownloadPE uses a <a class="external_link" href="http://gophp5.org" 
    title="Go PHP 5!">PHP5</a> class to ensure data protection and 
    <a class="external_link" href="http://en.wikipedia.org/wiki/Information_hiding" 
    title="Data encapsulation/Information hiding">encapsulation</a>.
    As such, <strong>a server running PHP 5.x or greater is required</strong>.
</p>

<p>
    FileDownloadPE uses MODx Template Variables (TVs) to specify
    file name, file path, and MIME type. To get started, download
    <a class="external_link" 
    href="http://www.modxcms.com/FileDownloadPE-2088.html" 
    title="Download FileDownloadPE">FileDownloadPE</a>.
</p>

<h3 class="contentH3">Installation <span>Updated 2008.06.18 for version 1.1</span></h3>
<ol id="installation">
    <li class="instructions">
        <strong>Step 1:</strong>
        <p>
            Create a new snippet called "FileDownloadPE" and paste 
            the contents of "filedownloadpe.snippet.php" into the
            Snippet code (php) area. Before you paste you should
            remove the opening and closing php tags because the
            text you just copied already has them in it. Click
            "Save" when you are done.
        </p>
    </li>
    
    <li class="instructions">
        <strong>Step 2:</strong>
        <p>
            Create a new template called "Downloads". In the Template
            code (html) area, put [ !FileDownloadPE! ]. (If you 
            copy and paste this snippet call, remove the spaces between
            the square brackets and the exclamation points.)
        </p>
    </li>
    
    <li class="instructions">
        <strong>Step 3:</strong>
            Create <del>three</del> two new template variables:
                <strong class="instructions">File</strong>
                <dl>
                    <dt>Variable Name: </dt>
                    <dd>File</dd>
                
                    <dt>Caption: </dt>
                    <dd>File</dd>
                
                    <dt>Description: </dt>
                    <dd>Path to file</dd>
                
                    <dt>Input Type: </dt>
                    <dd>File</dd>
                
                    <dt>Template Access: </dt>
                    <dd>Make sure the "Downloads" template is checked.</dd>
                </dl>
            
            <hr class="clear"/>
                <strong class="instructions">FileMime</strong>
                <dl>
                    <dt>Variable Name: </dt>
                    <dd>FileMime</dd>
                
                    <dt>Caption: </dt>
                    <dd>FileMime</dd>
                
                    <dt>Description: </dt>
                    <dd>MIME Type</dd>
                
                    <dt>Input Type: </dt>
                    <dd>DropDown List Menu</dd>
                
                    <dt>Input Option Values: </dt>
                    <dd>force-download||application/zip||application/pdf||image/jpg||image/png||text/plain</dd>
                
                    <dt>Default Value: </dt>
                    <dd>force-download</dd>
                
                    <dt>Template Access: </dt>
                    <dd>Make sure the "Downloads" template is checked.</dd>
                </dl>
            
            <hr class="clear"/>
                <strong class="instructions"><del>FileName</del></strong>
                <dl>
                    <dt><del>Variable Name:</del> </dt>
                    <dd><del>FileName</del></dd>
                
                    <dt><del>Caption:</del> </dt>
                    <dd><del>FileName</del></dd>
                
                    <dt><del>Description:</del> </dt>
                    <dd><del>File Name</del></dd>
                
                    <dt><del>Input Type:</del> </dt>
                    <dd><del>Text</del></dd>
                
                    <dt><del>Template Access:</del> </dt>
                    <dd><del>Make sure the "Downloads" template is checked.</del></dd>
                </dl>
                <p class="info">*NOTE: <del>The FileName TV is used to get download counts so make sure it is 
                    unique</del> Now uses the document's alias.</p>
            <hr class="clear"/>
    </li>
</ol>

<h3 class="contentH3">Usage</h3>
<ol>
    <li>
        Create a new MODx Document.
    </li>
    
    <li>
        Give it a title and alias. <span class="info">* The alias is now used in the database to keep count of the downloads.</span>
    </li>
    
    <li>
        Set the "Uses template" drop down menu to "Downloads".
    </li>
    
    <li>
        Skip the Document content, and go right to the "Template Variables" section.
        <ol>
            <li><del>Put a unique file name in the <strong>FileName</strong> TV.</del>
                <span class="info">* No longer needed. Uses the document alias instead.</span>
            </li>
            <li>Select the correct MIME type from the <strong>FileMime</strong> drop down TV.</li>
            <li>
                Click "Insert" on the <strong>File</strong> TV and upload / choose the file to serve.
                <p class="info">*NOTE: You can also manually type in the path of the file relative to the site root.</p>
            </li>
        </ol>
    </li>
    
    <li>
        From the "Page Settings" tab, uncheck "Searchable" and "Cacheable",
        set the "Content Type" to <strong>text/plain</strong>, and set the
        Content Disposition to <strong>Attachment</strong>.
    </li>
    
</ol>

<h3 class="contentH3">Parameters</h3>
<dl>
    <dt>&amp;action (string)</dt>
    <dd>
        set to <strong>count</strong> to use this snippet
        as a download counter.
        <p class="info">
            * Required for providing a download count.
        </p>
    </dd>
    
    <dt><del>&amp;filename</del> &amp;id (int)</dt>
    <dd>
        Used with <strong>&amp;action</strong> to
        specify the document ID to get counts for.
        <p class="info">
            * Required for providing a download count.
        </p>
    </dd>
    
    <dt>&amp;dberror (string)</dt>
    <dd>
        The text displayed when an error is encountered
        while processing the file.
        <p class="info">
            * Optional. Default: "There was an error processing your download request."
        </p>
    </dd>
    
    <dt>&amp;nofile (string)</dt>
    <dd>
        The error displayed when no file is specified.
        <p class="info">
            * Optional. Default: "No file specified."
        </p>
    </dd>
    
    <dt>&amp;fileNameTV (string)</dt>
    <dd>
        The name of the MODx TV that holds the file's unique name.
        <p class="info">
            * Optional. Default: "FileName".
        </p>
    </dd>
    
    <dt>&amp;fileMimeTV (string)</dt>
    <dd>
        The name of the MODx TV that holds the file's MIME type.
        <p class="info">
            * Optional. Default: "FileMime".
        </p>
    </dd>
    
    <dt>&amp;filePathTV (string)</dt>
    <dd>
        The name of the MODx TV that holds the file's path on the server.
        <p class="info">
            * Optional. Default: "File".
        </p>
    </dd>
    
    
</dl>

<h3 class="contentH3 clear">Examples</h3>
<p>
    I created a MODx document (the document ID turned out to be 
    <strong>36</strong>) in the fashion described above and
    set <del>the "FileName" TV to <strong>example</strong>,</del> the "FileMime"
    TV to <strong>application/zip</strong>, and using the "File" TV,
    I uploaded the file <strong>example.zip</strong> to my server
    and chose it as the value for the "File" TV. I gave this
    document an alias of <strong>example.zip</strong>.
    I used the string "example.zip" as the alias so that Windows knows
    what to use to open it if it is downloaded with IE. On this site,
    I have the Friendly alias suffix set to blank (I don't think a
    visitor should <strong><em>EVER</em></strong> have to look at
    file extension, but that is another blog entry), so if you have a
    suffix set in your MODx configuration, it could potentially cause
    problems with a Windows/IE combination unless you manually provide
    the href in your links instead of letting the MODx parser generate
    it from the doc ID.
</p>

<p>
    As an example, I duplicated this document (The new document's 
    ID is <strong>37</strong>) and gave it an
    alias of <strong>random-name-whatever.zip</strong>. As you can
    see, the URI does not need to match the actual file name.
    It can be whatever you want. The actual file was uploaded
    to the root of my site, but you can put your files in any
    web accessible folder.
</p>

<p>
    Download <a href="downloads/example.zip">An example file</a>: 
    <span>Downloaded <strong>
    156
    </strong> times.</span>
</p>

<p>
    Download <a href="downloads/random-name-whatever.zip">Same file, different URI</a>: 
    <span>Downloaded <strong>
    156
    </strong> times.</span>
</p>

<p>
    View the <a class="blogImage sourceCode" href="/example.html" 
    title="Example Source Code">source code</a>
    for this example.
</p>

<h3 class="contentH3">Best Practices</h3>
<p>
    As a best practice for keeping your directory structure clean
    I suggest creating a MODx document at the root of your site
    called "Downloads", with an alias of "downloads". This is
    especially helpful if you use Friendly URLs with Friendly Alias
    Paths. That way, you directory tree stays clean and your download
    URLs point to http://yoursite.tld/downloads/FileName.
    For each file you want to serve, create a new document as a child of
    this "Downloads" document, configured as described in the
    <strong>Usage</strong> section.
</p> ]]></description>
	<pubDate>Sun, 15 Jun 2008 20:24:42 -0400</pubDate>
	<guid isPermaLink="false">http://scottydelicious.com/blog/2008/06/15/filedownloadpe</guid>
	<dc:creator>Scotty Delicious: DFPA</dc:creator>
	
</item><item>
	<title>Star Tattoos</title>
	<link>http://scottydelicious.com/blog/2008/06/14/star-tattoos</link>
	<description><![CDATA[ <div class="photoSet">
    <a class="blogImage" href="/images/2008/06/tattoo/01-Waiting-to-get-stuck.jpg" title="01 : Waiting to get stuck" rel="chicago">
        <img src="/images/2008/06/tattoo/01-Waiting-to-get-stuck_thumb.jpg" alt="Waiting to get stuck" />
    </a>

    <a class="blogImage" href="/images/2008/06/tattoo/02-the-pattern.jpg" title="02 : The Pattern" rel="chicago">
        <img src="/images/2008/06/tattoo/02-the-pattern_thumb.jpg" alt="The pattern" />
    </a>

    <a class="blogImage" href="/images/2008/06/tattoo/03-Tattoo-outline.jpg" title="03 : Tattoo Outline" rel="chicago">
        <img src="/images/2008/06/tattoo/03-Tattoo-outline_thumb.jpg" alt="Tattoo Outline" />
    </a>

    <a class="blogImage" href="/images/2008/06/tattoo/04-Getting-needled-like-it-aint-no-thing.jpg" title="04 : Getting needled like it ain't no thing" rel="chicago">
        <img src="/images/2008/06/tattoo/04-Getting-needled-like-it-aint-no-thing_thumb.jpg" alt="Getting needled like it ain't no thing" />
    </a>
    
    <!-- NEXT SET -->
    <br class="clear" />

    <a class="blogImage" href="/images/2008/06/tattoo/05-Right-one-done.jpg" title="05 : Right one done" rel="chicago">
        <img src="/images/2008/06/tattoo/05-Right-one-done_thumb.jpg" alt="Right one done" />
    </a>

    <a class="blogImage" href="/images/2008/06/tattoo/06-Starting-the-left-side.jpg" title="06 : Starting the left side" rel="chicago">
        <img src="/images/2008/06/tattoo/06-Starting-the-left-side_thumb.jpg" alt="Starting the left side" />
    </a>

    <a class="blogImage" href="/images/2008/06/tattoo/07-One-hour-post-tattooing.jpg" title="07 : One hour post tattooing" rel="chicago">
        <img src="/images/2008/06/tattoo/07-One-hour-post-tattooing_thumb.jpg" alt="One hour post tattooing" />
    </a>

    <a class="blogImage" href="/images/2008/06/tattoo/08-Raise-em-up-kid.jpg" title="08 : Raise 'em up kid!" rel="chicago">
        <img src="/images/2008/06/tattoo/08-Raise-em-up-kid_thumb.jpg" alt="Raise 'em up kid!" />
    </a>
</div> ]]></description>
	<pubDate>Sat, 14 Jun 2008 18:47:44 -0400</pubDate>
	<guid isPermaLink="false">http://scottydelicious.com/blog/2008/06/14/star-tattoos</guid>
	<dc:creator>Scotty Delicious: DFPA</dc:creator>
	
</item><item>
	<title>XHTML links in new window with jQuery</title>
	<link>http://scottydelicious.com/blog/2008/06/12/xhtml-new-window-links</link>
	<description><![CDATA[ <p>
    When I am visiting a website and reading a blog post or forum thread,
    I like it when I click on a link that is going to take me to another
    domain, that it opens in a new tab or window. It is just a personal
    preference but, especially on really long pages, it takes forever
    to reload the content when I click the back button. It is far more
    convenient for me to just hit Command + W (ctrl + W) to close the
    new tab when I am done reading it and be right were I was on the
    page where I clicked the link. For example, When I am reading
    articles on <a href="http://digg.com" class="external_link" title="Digg">
    Digg</a> and I click a link to read the actual article, it would suck
    if it simply went to the article, especially if I am halfway through
    a boatload of nested comments. 
</p>

<p>
    With HTML 4, all you needed to do was add a <strong>target="_blank"</strong>
    attribute to your anchor tags. In XHTML, the "target" attribute has
    been depreciated.
</p>

<p>
    If you want your pages to validate to XHTML 1.0 Strict or XHTML 1.1,
    You are S.O.L. on opening the links in a new window without some
    Javascript. I prefer to use the <a class="external_link" 
    href="http://jquery.com" title="jQuery">jQuery</a> library, so I am
    going to discuss how to open links in a new window with that.
</p>

<p>
    First, I marked up all my external links with a class of "external_link".<br/>
    For example &lt;a href=&quot;http://google.com&quot; 
    class=&quot;external_link&quot; title=&quot;Google&quot;&gt;Google&lt;/a&gt;.
</p>

<p>
    The next step is to include the jQuery library in the head of 
    your document, then use a few lines of code to find the a tags that have
    been marked as external.
</p>
<code class="html">
&lt;script src=&quot;/js/jquery.packed.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
    $(document).ready( function() {
    	$(&#x27;a.external_link&#x27;).click( function() {
    		window.open(this.href); 
    		return false;
    	});
    });
&lt;/script&gt;
</code>

<p>
    I will step through this one line at a time.
</p>

<code class="js">
$(document).ready( function () {
</code>

<p>
    In this first line, the document is wrapped in a jQuery object.
    The "ready" method of the jQuery object is called and we pass,
    as it's only parameter, an anonymous function. The "ready" function
    is called as soon as the DOM is available. This is important, because
    we need to make sure all the anchor tags that are marked can be
    accessed before trying to operate on them. This is different than
    "window.onload" because it does not need to wait for all the
    resources (images, scripts, etc...) to load before it is safe to use.
    Once the DOM is "ready", the anonymous function is run.
</p>

<code class="js">
$('a.external_link').click( function() {
</code>

<p>
    This line finds all the anchor tags with a class of "external_link"
    and binds a "click" function to them. This event is fired when
    a DOM element matching the criteria encounters the "onclick" event.
    The click function is passed another anonymous function.
</p>

<code class="js">
window.open(this.href);
</code>

<p>
    A standard javascript window object method, the "open" method
    opens a URL (passed as it's paramter) in a new window.
    You can of course specify other parameters such as window size,
    toobar, window title, etc... But that is not needed for this particular
    implementation. The parameter passed as "this.href" is the value
    of the href attribute for the link that was clicked.
</p>

<code class="js">
return false;
</code>

<p>
    The last step is to prevent the browser from taking its standard
    action, which is to open the link inline in the current browser
    window. by specifying "return false;", we are squelching that
    behavior.
</p> ]]></description>
	<pubDate>Thu, 12 Jun 2008 21:10:46 -0400</pubDate>
	<guid isPermaLink="false">http://scottydelicious.com/blog/2008/06/12/xhtml-new-window-links</guid>
	<dc:creator>Scotty Delicious: DFPA</dc:creator>
	
</item><item>
	<title>Redesign</title>
	<link>http://scottydelicious.com/blog/2008/06/10/redesign</link>
	<description><![CDATA[ <p>
    I have been busy this last week rebuilding my site.
    Over the last few months I have been experimenting
    with the <a class="external_link" title="Zend Framework" 
    href="http://framework.zend.com">Zend Framework</a>.
    As far as frameworks go, it fits my coding style better
    than some of the others I tried (CakePHP, CodeIgniter,
    Symfony, RoR). It is a pretty schwag setup, but there
    are some things, like Zend_Form, that were just taking
    too much work to get it functioning &amp; displaying like I
    wanted to. There is a tremendous amount of flexibility
    in this framework, but with that comes a <strong>LOT</strong>
    of additional ground work.
</p>

<p>
    Previously, this site had been built on the 
    <a class="external_link" href="http://modxcms.com" 
    title="MODx Content Management System">
    MODx Content Management System</a>. I like MODx, but I was
    looking for a change and something to sharpen my (PHP) teeth
    on.
</p>

<p>
    As I set out on this redesign project, my intention was
    to build the entire application with the Zend Framework.
    After spending about 50 hours working with it, the site was
    still nowhere close to ready. So... I decided to roll my
    own. This site is now build on a combination of the 
    Zend Framework and a heavily modified MODx. I get the
    convenience of the MODx Document Parser class, and with
    a little (read as "a lot of") modification, I have Ditto
    (for the blog) and Jot (for the comments) working with 
    the database abstraction taken care of via Zend_Db_Table.
    The great thing about using Zend_Db_Table for the database
    queries is that the entire application lives ouside
    the web root.
</p>

<p>
    I am curious as to what you think about the design of the
    site, and if anyone has any success or horror stories on
    using the Zend Framework, please post a comment. I did roll
    along with <a class="external_link" title="Astrum Futura" 
    href="http://blog.astrumfutura.com/">Pádraic Brady's blog</a>,
    which is a great resource, and I have a few side projects that 
    I think will be perfect as 100% Zend Framework powered, 
    but I needed to get this done post 
    haste.
</p> ]]></description>
	<pubDate>Tue, 10 Jun 2008 01:42:25 -0400</pubDate>
	<guid isPermaLink="false">http://scottydelicious.com/blog/2008/06/10/redesign</guid>
	<dc:creator>Scotty Delicious: DFPA</dc:creator>
	
</item><item>
	<title>Anniversary in Chicago</title>
	<link>http://scottydelicious.com/blog/2008/06/04/chicago</link>
	<description><![CDATA[ <p>
    Tuesday, June 3rd was Andria's and my two year anniversary. 
    We decided to take a trip to Chicago to get away and have some fun.
    Andria booked a hotel room at <a class="external_link" 
    href="http://www.allegrochicago.com/" title="Hotel Allegro">Hotel Allegro</a>
    In the theater district (Randlolph &amp; LaSalle). It was pretty swank.
    They just dropped a bunch of cash redesigning all the rooms. It's an old
    building, and it has this real classic charm (and smell, unfortunately).
    Also, it is within a few blocks of the museums and the aquarium, so that
    was convenient.
</p>

<p>
    The weather was <strong>really</strong> nice all three days we were there
    so we walked everywhere. I don't know how many miles we put on, but my
    dogs were barking for a few days. We got in on to town on the 3rd, around
    3:30pm and spent the first afternoon rushing through exhibits at the
    <a class="external_link" href="http://www.artic.edu/aic/" 
    title="The Art Institute of Chicago">Art Institute</a> (they close at 5pm), 
    but we managed to take in quite a bit.
</p>

<p>
    Day 2 we hiked up to the <a class="external_link" href="http://www.fieldmuseum.org/" 
    title="The Field Museum">Field Museum</a>. We spent most of the day there.
    The &quot;Evolving Planet&quot; exhibit and &quot;Mythic Creatures: Dragons, 
    Unicorns &amp; Mermaids&quot; were really, really cool.
</p>

<p>
    In the afternoon, we walked up to the <a class="external_link" 
    title="The Shedd Aquarium" href="http://www.sheddaquarium.org/">Shedd Aquarium</a>.
    It was ok, but not as cool as I remember it when I was a kid. That eveneing
    we grabbed some dinner at the hotel restaurant and hoofed it down to
    the <a class="external_link" title="The Sears Tower" href="http://www.searstower.com/">
    Sears Tower</a> observation deck to check out the fireworks they shoot off from
    <a class="external_link" title="Navy Pier" href="http://www.navypier.com/">Navy Pier</a> 
    every Wednesday during the summer. It was an incredible perspective to say the least.
    Andria tried to snap some pics with the Nikon D40, but the backlighting caused too
    many reflections, and the focal area was too dark so even with a high ISO, the 
    shutter speed was too slow to get any clear images.
</p>

<div class="photoSet">
    <a class="blogImage" href="/images/2008/06/chicago/Andria_Chicago_Theater.jpg" title="Andria in front of the Chicago Theater" rel="chicago">
        <img src="/images/2008/06/chicago/Andria_Chicago_Theater_thumb.jpg" alt="Andria in front of the Chicago Theater" />
    </a>

    <a class="blogImage" href="/images/2008/06/chicago/Scott_Chicago_Theater.jpg" title="Scott in front of the Chicago Theater" rel="chicago">
        <img src="/images/2008/06/chicago/Scott_Chicago_Theater_thumb.jpg" alt="Scott in front of the Chicago Theater" />
    </a>

    <a class="blogImage" href="/images/2008/06/chicago/Scott_Chicago_Theater2.jpg" title="Scott, again in front of the Chicago Theater" rel="chicago">
        <img src="/images/2008/06/chicago/Scott_Chicago_Theater2_thumb.jpg" alt="Scott, again in front of the Chicago Theater" />
    </a>

    <a class="blogImage" href="/images/2008/06/chicago/Scott_Sue.jpg" title="Scott and Sue the T-Rex at the Field Museum" rel="chicago">
        <img src="/images/2008/06/chicago/Scott_Sue_thumb.jpg" alt="Scott and Sue the T-Rex at the Field Museum in Chicago" />
    </a>

    <br class="clear" />

    <a class="blogImage" href="/images/2008/06/chicago/Andria_Shedd.jpg" title="Andria at the Shedd Aquarium" rel="chicago">
        <img src="/images/2008/06/chicago/Andria_Shedd_thumb.jpg" alt="Andria at the Shedd Aquarium" />
    </a>

    <a class="blogImage" href="/images/2008/06/chicago/Scott_Shedd.jpg" title="Scott at the Shedd Aquarium" rel="chicago">
        <img src="/images/2008/06/chicago/Scott_Shedd_thumb.jpg" alt="Scott at the Shedd Aquarium" />
    </a>

    <a class="blogImage" href="/images/2008/06/chicago/Cloud_Gate.jpg" title="The Cloud Gate monument at Millenium Park" rel="chicago">
        <img src="/images/2008/06/chicago/Cloud_Gate_thumb.jpg" alt="The Cloud Gate monument at Millenium Park in chicago" />
    </a>

    <a class="blogImage" href="/images/2008/06/chicago/Scott_Cloud_Gate.jpg" title="Scott at the Cloud Gate monument at Millenium Park" rel="chicago">
        <img src="/images/2008/06/chicago/Scott_Cloud_Gate_thumb.jpg" alt="Scott at the Cloud Gate monument at Millenium Park in Chicago" />
    </a>
</div> ]]></description>
	<pubDate>Wed, 04 Jun 2008 14:20:29 -0400</pubDate>
	<guid isPermaLink="false">http://scottydelicious.com/blog/2008/06/04/chicago</guid>
	<dc:creator>Scotty Delicious: DFPA</dc:creator>
	
</item>	</channel>
</rss>