<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joey Rivera &#187; Uploader</title>
	<atom:link href="http://www.joeyrivera.com/tag/uploader/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joeyrivera.com</link>
	<description>Blogging about PHP, Actionscript, MySQL, and other interests.</description>
	<lastBuildDate>Wed, 04 Aug 2010 14:52:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick update to Uploader &#8211; fixed some minor bugs</title>
		<link>http://www.joeyrivera.com/2008/quick-update-to-uploader-fixed-some-minor-bugs/</link>
		<comments>http://www.joeyrivera.com/2008/quick-update-to-uploader-fixed-some-minor-bugs/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:42:44 +0000</pubDate>
		<dc:creator>Joey</dc:creator>
				<category><![CDATA[Uploader]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.joeyrivera.com/?p=207</guid>
		<description><![CDATA[Two bugs were found and addressed. The first bug happened while trying to upload a link. I dropped a URL on the Uploader and the app got stuck in the &#8220;Thinking&#8221; phase. After some troubleshooting, I noticed the page for the URL did not have a &#60;title&#62; tag so the app was sending the PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Two bugs were found and addressed. The first bug happened while trying to upload a link. I dropped a URL on the Uploader and the app got stuck in the &#8220;Thinking&#8221; phase. After some troubleshooting, I noticed the page for the URL did not have a &lt;title&gt; tag so the app was sending the PHP page an empty &#8216;name&#8217; variable causing the PHP page to stop executing during the validation phase.  The fix was to assign a default name to the link if no title tag is present. In these cases, I&#8217;ll manually give the link a proper title.</p>
<p>The second issue also had to do with the &lt;title&gt; tag. In this case, the HTML did have a title tag but the case was different that what I was looking for. My code was looking for all lowercase characters and the tag in the HTML was in uppercase. My first thought was to do a .toLowerCase() on the HTML code but then all the titles would be in lower case and wouldn&#8217;t look as presentable (ex: the size of our planet vs The Size of Our Planet). After giving this some more thought, it seemed using regex would be the cleanest solution. A quick Google search returned <a title="Regular Expressions" href="http://www.troubleshooters.com/codecorn/littperl/perlreg.htm" target="_blank">this page</a> which said by adding an &#8216;i&#8217; to the end of my regex, the search would be case insensitive. I gave it a try and it worked like a charm.</p>
<p>Before Code:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">var</span> <span class="kw3">start</span>:<span class="kw3">Number</span> = s.<span class="kw3">indexOf</span><span class="br0">&#40;</span><span class="st0">&#8216;&lt;title&gt;&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> <span class="kw3">end</span>:<span class="kw3">Number</span> = s.<span class="kw3">indexOf</span><span class="br0">&#40;</span><span class="st0">&#8216;&lt;/title&gt;&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> title:<span class="kw3">String</span> = s.<span class="kw3">substr</span><span class="br0">&#40;</span><span class="kw3">start</span> + <span class="nu0">7</span>, <span class="kw3">end</span> &#8211; <span class="kw3">start</span> &#8211; <span class="nu0">7</span><span class="br0">&#41;</span>;</div>
<p>After Code:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">var</span> <span class="kw3">start</span>:<span class="kw3">Number</span> = s.<span class="me1">search</span><span class="br0">&#40;</span>/&lt;title&gt;/i<span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> <span class="kw3">end</span>:<span class="kw3">Number</span> = s.<span class="me1">search</span><span class="br0">&#40;</span>/&lt;\/title&gt;/i<span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> title:<span class="kw3">String</span> = s.<span class="kw3">substr</span><span class="br0">&#40;</span><span class="kw3">start</span> + <span class="nu0">7</span>, <span class="kw3">end</span> &#8211; <span class="kw3">start</span> &#8211; <span class="nu0">7</span><span class="br0">&#41;</span>;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.joeyrivera.com/2008/quick-update-to-uploader-fixed-some-minor-bugs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Uploader Phase 2 complete!</title>
		<link>http://www.joeyrivera.com/2008/uploader-phase-2-complete/</link>
		<comments>http://www.joeyrivera.com/2008/uploader-phase-2-complete/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 03:45:52 +0000</pubDate>
		<dc:creator>Joey</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uploader]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.joeyrivera.com/?p=165</guid>
		<description><![CDATA[So today after work I decided it was about time to start working on phase two of my Uploader tool. Phase two consists of allowing me to drag and drop an image URL into the app so the app can then download the image to a folder in my server, create a thumbnail of this [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 157px"><img title="Uploader screen shot" src="/blog_files/96/uploader_ss.gif" alt="Here is a screen shot of the Uploader 0.1.0" width="147" height="172" /><p class="wp-caption-text">Uploader 0.2.0</p></div>
<p>So today after work I decided it was about time to start working on phase two of my Uploader tool. Phase two consists of allowing me to drag and drop an image URL into the app so the app can then download the image to a folder in my server, create a thumbnail of this image, and update the WordPress database with information about the new image. The new image would then show up the next time a person visits my blog. If you notice, there is now a &#8220;Pics of Interest&#8221; section on the sidebar to the right of the page (similar to what people are doing with the flickr plugin). Every time I drag an image URL into the Uploader, the new image thumbnail will show in that area and if you click on the thumbnail you&#8217;ll see the full size image.</p>
<p>It was actually much easier than I originally thought to make this work. Technically, the Uploader already has the drag/drop functionality and already takes in a URL. The only extra <a title="Main.as" href="http://www.joeyrivera.com/blog_files/165/Main.as" target="_blank">AS3 code</a> was a check to see if the URL was an image and if so call the PHP page with a code (I&#8217;m passing &#8211;@IMAGE@&#8211; to know it&#8217;s an image &#8211; it was just the first thing that came to my head) so then PHP knows this URL should be treated as an image not just a URL. If you remember, phase 1 for the Uploader allows a person to drag/drop a URL into the app so it creates a new link under the &#8220;Links of Interest&#8221;.<span id="more-165"></span></p>
<p>Most of the changes were on the PHP end. The file that handles the request from the AIR app now does a check to see if this URL is an image. If so, it has to download the original image to the local server, make a thumbnail copy of it, and finally update the wp_images table (this is a new table I created for this - <a title="MySQL create script" href="http://www.joeyrivera.com/blog_files/165/wp_images.sql" target="_blank">MySQL script</a>) in WordPress. I&#8217;m using two PEAR packages to do this: HTTP_Request and Image_Transform. The same can be done just as easily without them but I like using PEAR on my projects. Here&#8217;s the code that does this (<a title="index.php file as text" href="http://www.joeyrivera.com/blog_files/165/file.txt" target="_blank">file.txt</a>):</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$name</span> == <span class="st0">&#8216;&#8211;@IMAGE@&#8211;&#8217;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">// later use unique names?</span><br />
    <span class="re0">$name</span> = <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$url</span>, strripos<span class="br0">&#40;</span><span class="re0">$url</span>,<span class="st0">&#8216;/&#8217;</span><span class="br0">&#41;</span> + <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
        <br />
&nbsp; &nbsp; <span class="kw1">require</span> <span class="st0">&#8216;HTTP/Request.php&#8217;</span>;<br />
    <span class="re0">$req</span> = <span class="kw2">new</span> HTTP_Request<span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span>;<br />
    <span class="re0">$req</span>-&gt;<span class="me1">sendRequest</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
    <br />
&nbsp; &nbsp; <span class="re0">$fp</span> = <a href="http://www.php.net/fopen"><span class="kw3">fopen</span></a><span class="br0">&#40;</span><span class="st0">&#8216;images/&#8217;</span>.<span class="re0">$name</span>, <span class="st0">&#8216;w&#8217;</span><span class="br0">&#41;</span>;<br />
    <a href="http://www.php.net/fwrite"><span class="kw3">fwrite</span></a><span class="br0">&#40;</span><span class="re0">$fp</span>, <span class="re0">$req</span>-&gt;<span class="me1">getResponseBody</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp;   <a href="http://www.php.net/fclose"><span class="kw3">fclose</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span>;<br />
    <br />
&nbsp; &nbsp; <span class="co1">// create thumbnail</span><br />
    <span class="kw1">require</span> <span class="st0">&#8216;Image/Transform.php&#8217;</span>;</p>
<p>&nbsp;   <span class="co1">//create transform driver object</span><br />
&nbsp;   <span class="re0">$it</span> = Image_Transform::<span class="me2">factory</span><span class="br0">&#40;</span><span class="st0">&#8216;GD&#8217;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp;   <span class="co1">//load the original file</span><br />
&nbsp;   <span class="re0">$it</span>-&gt;<span class="me1">load</span><span class="br0">&#40;</span><span class="st0">&#8216;images/&#8217;</span>.<span class="re0">$name</span><span class="br0">&#41;</span>;</p>
<p>&nbsp;   <span class="co1">//scale it to 100px</span><br />
&nbsp;   <span class="re0">$it</span>-&gt;<span class="me1">scaleMaxLength</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span>;</p>
<p>&nbsp;   <span class="co1">//save it into a different file</span><br />
&nbsp;   <span class="re0">$tn</span> = <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$name</span>,<span class="nu0">0</span>,strripos<span class="br0">&#40;</span><span class="re0">$name</span>,<span class="st0">&#8216;.&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;-tn.&#8217;</span>.<a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$name</span>,strripos<span class="br0">&#40;</span><span class="re0">$name</span>,<span class="st0">&#8216;.&#8217;</span><span class="br0">&#41;</span><span class="nu0">+1</span><span class="br0">&#41;</span>;<br />
&nbsp;   <span class="re0">$it</span>-&gt;<span class="me1">save</span><span class="br0">&#40;</span><span class="st0">&#8216;images/&#8217;</span>.<span class="re0">$tn</span><span class="br0">&#41;</span>;</p>
<p>&nbsp;   <span class="re0">$query</span> = <span class="st0">&#8216;<br />
&nbsp;           Insert Into wp_images<br />
&nbsp;           Values (null, &#8216;</span>.<span class="re0">$db</span>-&gt;<span class="me1">quote</span><span class="br0">&#40;</span><span class="re0">$name</span>, <span class="st0">&#8216;text&#8217;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;, &#8216;</span>.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$db</span>-&gt;<span class="me1">quote</span><span class="br0">&#40;</span><span class="re0">$tn</span>, <span class="st0">&#8216;text&#8217;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;, &#8216;</span>.<span class="re0">$db</span>-&gt;<span class="me1">quote</span><span class="br0">&#40;</span><span class="re0">$url</span>, <span class="st0">&#8216;text&#8217;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;);<br />
}</span></div>
<p>Then I had to add some code to the sidebar.php for my template in WordPress to show the new section &#8220;Pics of Interest&#8221;. As you read this keep in mind this is just a quick beta and I&#8217;ll be doing refactoring later. This is by no means a finished product but it works fine and it&#8217;s a good start for anyone who wants to try it out. This is the new code I added to my <a title="sidebar.php" href="http://www.joeyrivera.com/blog_files/165/sidebar.txt" target="_blank">sidebar.php</a>:</p>
<div class="dean_ch" style="white-space: wrap;">&lt;div <span class="kw2">class</span>=<span class="st0">&quot;block poi&quot;</span>&gt;<br />
&nbsp;       &lt;h3&gt;Pics of Interest&lt;/h3&gt;<br />
&nbsp;       <span class="kw2">&lt;?php</span><br />
&nbsp;               <span class="kw1">require</span> <span class="st0">&#8216;./uploader/lib/DB.php&#8217;</span>;<br />
&nbsp;               DB::<span class="me2">conn</span><span class="br0">&#40;</span><span class="st0">&#8216;live&#8217;</span><span class="br0">&#41;</span>;<br />
&nbsp;               <span class="re0">$db</span> = DB::<span class="me2">getInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp;               <span class="re0">$query</span> = <span class="st0">&#8216;<br />
&nbsp;                       Select image_file, image_thumbnail, image_origin<br />
&nbsp;                       From wp_images<br />
&nbsp;                       Order By image_id desc<br />
&nbsp;                       Limit 6;<br />
&nbsp;                       &#8217;</span>;</p>
<p>&nbsp;               <span class="re0">$rs</span> = <span class="re0">$db</span>-&gt;<span class="me1">query</span><span class="br0">&#40;</span><span class="re0">$query</span><span class="br0">&#41;</span>;<br />
&nbsp;               <span class="kw1">while</span><span class="br0">&#40;</span><span class="re0">$row</span> = <span class="re0">$rs</span>-&gt;<span class="me1">fetchRow</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8216;&lt;a href=&quot;/uploader/images/&#8217;</span>.<span class="re0">$row</span><span class="br0">&#91;</span><span class="st0">&#8216;image_file&#8217;</span><span class="br0">&#93;</span>.<span class="st0">&#8216;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title=&quot;From: &#8216;</span>.<span class="re0">$row</span><span class="br0">&#91;</span><span class="st0">&#8216;image_origin&#8217;</span><span class="br0">&#93;</span>.<span class="st0">&#8216;&quot;&gt;&lt;img<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; src=&quot;/uploader/images/&#8217;</span>.<span class="re0">$row</span><span class="br0">&#91;</span><span class="st0">&#8216;image_thumbnail&#8217;</span><span class="br0">&#93;</span>.<span class="st0">&#8216;&quot; /&gt;&lt;/a&gt;&#8217;</span>;<br />
&nbsp;       <span class="kw2">?&gt;</span><br />
&lt;/div&gt;</div>
<p>The last thing I had to do was to add the style for my images in the styles.css file and I was done. Make sure your images folder has the proper privileges so you can upload an image into it. The next phase will be allowing me to drag files from my local file system into the AIR app so it&#8217;ll upload it to my server. Right now the Uploader only does something when a URL is dropped on it: adds a link if it&#8217;s not a image, adds the image if it&#8217;s an image.</p>
<p>Question, comments, conerns are always welcome!</p>
<p>Edit:</p>
<p><a title="Info about Uploader Phase 1" href="http://www.joeyrivera.com/2008/uploader-phase-1/" target="_self">Uploader Phase 1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeyrivera.com/2008/uploader-phase-2-complete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploader Phase 1</title>
		<link>http://www.joeyrivera.com/2008/uploader-phase-1/</link>
		<comments>http://www.joeyrivera.com/2008/uploader-phase-1/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 15:49:47 +0000</pubDate>
		<dc:creator>Joey</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uploader]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress tools]]></category>

		<guid isPermaLink="false">http://www.joeyrivera.com/?p=96</guid>
		<description><![CDATA[If you missed the previous post explaining what Uploader is go check it out.
So after having some fun with code I think I&#8217;m close to being done with phase 1.  I currently have a working beta (0.1.0) that I&#8217;m going to share with you all and explain what I&#8217;ve done in case anyone else wants [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 157px"><img title="Uploader screen shot" src="/blog_files/96/uploader_ss.gif" alt="Here is a screen shot of the Uploader 0.1.0" width="147" height="172" /><p class="wp-caption-text">Uploader 0.1.0</p></div>
<p>If you missed the previous post explaining what Uploader is go <a title="About the uploader" href="http://www.joeyrivera.com/2008/uploader-automating-wordpress-links-and-file-uploads/" target="_self">check it out</a>.</p>
<p>So after having some fun with code I think I&#8217;m close to being done with phase 1.  I currently have a working beta (0.1.0) that I&#8217;m going to share with you all and explain what I&#8217;ve done in case anyone else wants to do something similar.  For the most part this was pretty straight forward.  There were a few hiccups here and there that I&#8217;ll try to address in this post. The link to the code will be at the end.</p>
<p> <span id="more-96"></span></p>
<p>First I looked online for some info on Drag/Drop in AIR and I found these two posts that I used for reference:</p>
<ul>
<li><a href="http://www.senocular.com/air/tutorials/dragdropimageviewer/" target="_blank">http://www.senocular.com/air/tutorials/dragdropimageviewer/</a></li>
<li><a href="http://www.mikechambers.com/blog/2007/11/07/air-example-native-drag-and-drop/" target="_blank">http://www.mikechambers.com/blog/2007/11/07/air-example-native-drag-and-drop/</a></li>
</ul>
<p>I should have read the comments in those post since they answer the question of using &#8216;NativeDragManager&#8217; instead of &#8216;DragManager&#8217;.  I had that issue and had to figure out why it wasn&#8217;t working.</p>
<p>This is an AIR app made in Flash.  So far I only have one &#8216;Main&#8217; class taking care of most of the action.  I&#8217;ll clean the code up later and comment it but here&#8217;s the <a title="Main.as file" href="http://www.joeyrivera.com/blog_files/96/com/joeyrivera/uploader/Main.as" target="_blank">class</a> so far. Using the &#8216;NativeDragEvent&#8217;, Uploader waits for something to be dragged over it.  When it does, &#8216;dragEnter&#8217; is called. Usually you can do some validation here to see if this is a file type you want to accept but I just do that later.  Before a file/URL can be dropped you need to call &#8216;NativeDragManager.acceptDragDrop(<em>object</em>)&#8217;. By doing this, you let AIR know that the object is ready to accept the drop.</p>
<p>Once an item is dropped, &#8216;dragDrop&#8217; is called to see if this is a file or a URL.  If URL, &#8216;urlDropped&#8217; is called which creates a listener for the loader var and sends the request to the URL that was dropped on the app.  When the request is complete, &#8216;urlLoaded&#8217; is called.  The reason we are loading the dropped URL is so we can grab the title of that page in between the &lt;title&gt; tag of the html.  This is going to be used as the display name when we insert the new link in WordPress. &#8216;grabTitle&#8217; does a quick substr and when all is done we do one last request.  I had to make sure to remove the listener on &#8216;loader&#8217; for &#8216;urlLoaded&#8217; since later when I make a new listener and request, both the new and old listeners were triggering (so make sure to remove a listener from a loader if you are going to reuse that var with a different event call back).</p>
<p>&#8216;SERVER&#8217; is the constant that needs to by modified to point to the correct PHP page that will insert the link to the WordPress DB.  &#8217;urlLoaded&#8217; finishes by sending two variables to the SERVER page, &#8216;name&#8217; and &#8216;url&#8217;. After the request is loaded, the &#8217;serverUpdated&#8217; function will display if the process was successful or not based on what is returned by the PHP page.</p>
<p>That&#8217;s pretty much it for the AS3 code.  The PHP file is much more light weight.  At first I had PHP request the HTML for the URL and strip out the title but after thinking about it, it makes more sense to put that burden on the client and not the server so I moved the code to Flash.</p>
<p>The <a title="PHP Code file" href="http://www.joeyrivera.com/blog_files/96/file.html" target="_blank">PHP code</a> starts out by checking for the two needed variables &#8216;url&#8217; and &#8216;name&#8217;.  There&#8217;s a tiny bit of validation going on, definitely more to come as well as implementing some security features since at the moment anyone can submit variables to this page if they know the URL.  (<em>Before posting this, I decided to add a quick security check for now which will see if the remote IP address matches a couple different valid IP address &#8211; such as my home or work PC &#8211; and if it does, it will continue executing</em> ) Then we make a DB connection to the WordPress DB. I have a standard DB class I use, just use regular <a title="php.net mysql_connect info" href="http://us2.php.net/mysql_connect" target="_blank">mysql_connect</a> instead (ask if you need help with this). Next is the query to insert the data into the &#8216;wp_links&#8217; table.  I kept the name default during my WordPress install, so the table name might be different for others. And at last, the query is executed and true is returned. The assumption is if we make it down that far everything worked correctly.  Like I said, I need to add more validation and security but that will be later&#8230; maybe phase 2 or 3.</p>
<p>The only issue I&#8217;m having now that I can&#8217;t seem to figure out is where the WordPress DB tracks what category a link is attached to?  When I log into the WordPress admin area and go to manage links, all the links I&#8217;m inserting using this method don&#8217;t show anything under &#8216;Categories&#8217;. I&#8217;m assuming this information isn&#8217;t in the &#8216;wp_links&#8217; table?  If anyone has an answer to this, please let me know.</p>
<p>Here is a <a title="FLA, Main.as, PHP file, and AIR xml file" href="http://www.joeyrivera.com/blog_files/96/Uploader_0.1.0.zip">zip</a> of all the files (FLA, PHP file, Main class, and AIR xml).  Make sure to edit the ActionScript &#8216;SERVER&#8217; const and DB info in the PHP file.</p>
<p>* Quick side note, I need to give credit to my fiance Ashley who created a quick graphic for me to use last night. Visit her <a title="Ashley Fleishel" href="http://www.ashleyfleishel.com" target="_blank">site</a> to see some of her work.</p>
<p>EDIT:</p>
<p>I forgot to mention I made some edits to the Uploader-app.xml file. These settings were to remove the system chrome and make the app window transparent. More information about these settings can be found at <a title="Information about AIR" href="http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff1.html" target="_blank">help.adobe.com</a>.</p>
<p><a title="Uploader Phase 2 done!" href="http://www.joeyrivera.com/2008/uploader-phase-2-complete/" target="_self">Uploader Phase 2 complete</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeyrivera.com/2008/uploader-phase-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Uploader: Automating WordPress Links and File Uploads</title>
		<link>http://www.joeyrivera.com/2008/uploader-automating-wordpress-links-and-file-uploads/</link>
		<comments>http://www.joeyrivera.com/2008/uploader-automating-wordpress-links-and-file-uploads/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 01:12:41 +0000</pubDate>
		<dc:creator>Joey</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uploader]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress links]]></category>

		<guid isPermaLink="false">http://www.joeyrivera.com/?p=93</guid>
		<description><![CDATA[So now that I&#8217;m starting to get my WordPress and new hosting server settled in I&#8217;m trying to think of what I can create to help me automate some tasks. One of the things I know I&#8217;ll be doing quite often is adding new links to the &#8216;Links of Interest&#8217; on the front page.  I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>So now that I&#8217;m starting to get my WordPress and new hosting server settled in I&#8217;m trying to think of what I can create to help me automate some tasks. One of the things I know I&#8217;ll be doing quite often is adding new links to the &#8216;Links of Interest&#8217; on the front page.  I&#8217;ll also be uploading files/images to use on posts or to share with others but I&#8217;m too lazy to be ftping files constantly. So&#8230; time for a new tool!</p>
<p>The Uploader (yeah I know, I&#8217;m very creative) is going to do all the above for me. This will be a app I can keep running on my desktop somewhere and when I need to upload a file or link I can just drag it over and drop it in. The tool will then figure out what kind of item was dropped in and what to do with it.</p>
<p>Phase 1 will handle the links. The way the tool should work for links is the following.  I visit a page that I find interesting and want to add to the &#8216;Links of Interest&#8217;.  Instead of logging into WordPress to create it, I highlight the link from the address bar of the browser, drag it over to the app, and drop it. Now the app needs to figure out the &lt;title&gt; of that page to use as the name since we need a name and url to create a link. Once it has that, the tool will send the information to a PHP page which will do an insert to the links table in the WordPress DB.  </p>
<p>Phase 2 will deal with images and files. I may break phase 2 into two since I may do some stuff differently with images versus other files.  I&#8217;m thinking I may want to upload images, create a thumbnail, and insert to a DB to display in the front page the same way some people do with their flickr images. Other files I would just upload and store somewhere else.  I&#8217;ll give this more thought when I get to it.</p>
<p>I&#8217;m going to be writing the tool in Flash CS3/AIR with PHP in the backend using the current WordPress MySQL DB.  Stay tuned for updates!</p>
<p>EDIT:</p>
<p><a title="Uploader Phase 1 done" href="http://www.joeyrivera.com/2008/uploader-phase-1/" target="_self">Uploader Phase 1 completed</a> <br />
<a title="Uploader Phase 2 done" href="http://www.joeyrivera.com/2008/uploader-phase-2-complete/" target="_self"> Uploader Phase 2 completed</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeyrivera.com/2008/uploader-automating-wordpress-links-and-file-uploads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
