<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - FatFolderDesigner</title>
<link>http://snipplr.com/users/FatFolderDesigner</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 20 Jun 2013 10:07:13 GMT</pubDate>
<item>
<title>(PHP) Intergrating the wordpress media uploader into your plugin</title>
<link>http://snipplr.com/view/67849/intergrating-the-wordpress-media-uploader-into-your-plugin/</link>
<description><![CDATA[ <p>It's a 3 part process, first is the PHP that you need to run, which includes the appropriate scripts and styles into the admin header, then you need an html button and input field to put the stored value in, then you need some jQuery to open the popup and get the appropriate information from it (then close it again).

There more information on implementation at the URL.</p> ]]></description>
<pubDate>Sun, 21 Oct 2012 08:29:36 GMT</pubDate>
<guid>http://snipplr.com/view/67849/intergrating-the-wordpress-media-uploader-into-your-plugin/</guid>
</item>
<item>
<title>(PHP) Perfect PHP .htaccess rewrites</title>
<link>http://snipplr.com/view/66655/perfect-php-htaccess-rewrites/</link>
<description><![CDATA[ <p>These two snippets together, the first in the .htaccess file, and the second in your PHP create an elegantly simple solution to arbitrary URLs with php. For a breakdown and example check out the link.

Don't want to follow the link, how about the quick version. The .htaccess redirects anything that doesn't exist to the PHP, where the script breaks it apart and places it all in the $_urlvars for your own uses.</p> ]]></description>
<pubDate>Sat, 11 Aug 2012 17:02:37 GMT</pubDate>
<guid>http://snipplr.com/view/66655/perfect-php-htaccess-rewrites/</guid>
</item>
<item>
<title>(JavaScript) Google Maps API V3 Javascript Full Example</title>
<link>http://snipplr.com/view/65525/google-maps-api-v3-javascript-full-example/</link>
<description><![CDATA[ <p>This javascript will create a complex google javascript map with multiple locations selected marked. The map will be centered in the middle and zoomed so that all point can be seen. It also stylizes the map making it mostly desaturated with bits of orange. More explanation as to how to set this up and change it at the url.</p> ]]></description>
<pubDate>Mon, 11 Jun 2012 08:31:18 GMT</pubDate>
<guid>http://snipplr.com/view/65525/google-maps-api-v3-javascript-full-example/</guid>
</item>
<item>
<title>(JavaScript) Google Maps API V3 Javascript Basic Example</title>
<link>http://snipplr.com/view/65524/google-maps-api-v3-javascript-basic-example/</link>
<description><![CDATA[ <p>This javascript will create a google map on the div with the ID "the_map" and centered on an address with a marker on it. In this example the address is for Jet City Improv. More information on setup and customization at the link.</p> ]]></description>
<pubDate>Mon, 11 Jun 2012 08:27:38 GMT</pubDate>
<guid>http://snipplr.com/view/65524/google-maps-api-v3-javascript-basic-example/</guid>
</item>
<item>
<title>(HTML) Google Maps V2 Static Maps</title>
<link>http://snipplr.com/view/65523/google-maps-v2-static-maps/</link>
<description><![CDATA[ <p>Below are several different types of google static maps.

The first is a map with a single marker on the Space Needle.
The second is one with 3 marks, one on the Space Needle, one on the Seattle Science Center, and One on the EMP Museum.
The last three have the same 3 markers but varios styles.

Generally markers are separated with "|" pipes, styles are a bit more complex and require multiple parts separated with pipes and for more advanced stuff multiple markers. I have a writeup at the url.</p> ]]></description>
<pubDate>Mon, 11 Jun 2012 08:23:37 GMT</pubDate>
<guid>http://snipplr.com/view/65523/google-maps-v2-static-maps/</guid>
</item>
<item>
<title>(PHP) Wordpress Redirects with wp_redirect()</title>
<link>http://snipplr.com/view/64365/wordpress-redirects-with-wpredirect/</link>
<description><![CDATA[ <p>This needs to be run on an action, or at least I wanted able to get it to run outside of an action, I suggest template_redirect. More information at the link.</p> ]]></description>
<pubDate>Thu, 05 Apr 2012 14:02:57 GMT</pubDate>
<guid>http://snipplr.com/view/64365/wordpress-redirects-with-wpredirect/</guid>
</item>
<item>
<title>(PHP) jQuery syle DOM navigation in PHP with phpQuery</title>
<link>http://snipplr.com/view/63292/jquery-syle-dom-navigation-in-php-with-phpquery/</link>
<description><![CDATA[ <p>Navigating the DOM in jQuery is incredibly simple and thats to phpQuery you can do the same in php. Below are some examples of how it's used, the key change bing that instead of $() you use pq(), and instead of a . you used ->. Theres alot more details information at the link if your interested. Post questions/comments here or there.

You can get the phpquery files, and well as read the manual at the google code page here: http://code.google.com/p/phpquery/</p> ]]></description>
<pubDate>Mon, 13 Feb 2012 09:55:58 GMT</pubDate>
<guid>http://snipplr.com/view/63292/jquery-syle-dom-navigation-in-php-with-phpquery/</guid>
</item>
<item>
<title>(JavaScript) get GET and POST variables in javascript</title>
<link>http://snipplr.com/view/62892/get-get-and-post-variables-in-javascript/</link>
<description><![CDATA[ <p>Usually when working with form you use a server to handle it, and if your doing it entirely in javascript no reload is required, but what if you wanted to take the information and use it in a javascript on another page, completely client side. I had that problem, and found this solution.

First is how to get GET variables in javascript, it works by breaking down the URL location with a regular expression giving you a variable that behaves like the PHP $_GET variable.

Second is for POST variables and, unfortunately requires a server side script to work since javascript has no way to acces the POSt on it's own. The code below is for PHP, but should work for any language, it is also untested as I was really aiming for GET at the time.

And questions, comments, or concerns let me know here or at the link, you'll find a bit more information this there as well.</p> ]]></description>
<pubDate>Mon, 30 Jan 2012 09:43:54 GMT</pubDate>
<guid>http://snipplr.com/view/62892/get-get-and-post-variables-in-javascript/</guid>
</item>
<item>
<title>(jQuery) Auto-Replace Broken Images</title>
<link>http://snipplr.com/view/62397/autoreplace-broken-images/</link>
<description><![CDATA[ <p>There are 2 jQuery snippets, both replace broken images with one of your choosing, the difference is that one is "safe" and the other is "persistent". The safe one will quick working, so if your doing something that dynamically changed images on a page it'll only work for the first broken image. The persistent one will keep working, but if your missing image image is missing it'll cause a overflow error.</p> ]]></description>
<pubDate>Sun, 08 Jan 2012 09:47:12 GMT</pubDate>
<guid>http://snipplr.com/view/62397/autoreplace-broken-images/</guid>
</item>
<item>
<title>(CSS) Fix Webkit CSS3 animation flickers</title>
<link>http://snipplr.com/view/61945/fix-webkit-css3-animation-flickers/</link>
<description><![CDATA[ <p>Ever notice a weird CS3 animation flicker? Annoying right? Add these CSS3 classes to the objects being animated and it should go away (at least it has in my testing). More details at the link, questions can be postsed either here or there.</p> ]]></description>
<pubDate>Sat, 17 Dec 2011 15:57:28 GMT</pubDate>
<guid>http://snipplr.com/view/61945/fix-webkit-css3-animation-flickers/</guid>
</item>
<item>
<title>(jQuery) Flexible Site Layout With Resize Detection, now improved!</title>
<link>http://snipplr.com/view/60562/flexible-site-layout-with-resize-detection-now-improved/</link>
<description><![CDATA[ <p>I've previously posted this here: http://snipplr.com/view/59044/flexible-site-layout-with-resize-detection/

This new version is short and more efficient, plus it no longer shows 1 (harmless) error on launch. Works the same as last time, the sizable object has the size to add the class too all the sizable elements, so for this example if the screen is less that 450px it'll add the class "phone" to the body (and the other elements), and if it's larger than 750px, but not 1000px, it'll give it the tablet layout. More information about the script is at the link, questions/comments/concerns can be sent to be from here or the comments section at the link.</p> ]]></description>
<pubDate>Sat, 05 Nov 2011 11:02:52 GMT</pubDate>
<guid>http://snipplr.com/view/60562/flexible-site-layout-with-resize-detection-now-improved/</guid>
</item>
<item>
<title>(JavaScript) Flexible Site Layout with Resize Detection</title>
<link>http://snipplr.com/view/59044/flexible-site-layout-with-resize-detection/</link>
<description><![CDATA[ <p>This bit of jquery will take whatever you give it in the selector (which should be a valid jquery selector of any kind) and add or remove additional classas as appropriate based on width. 

The width and style names are all determined by the last if statement and can easily be changes. The defaults are for sizes 320px or less, 321px to 768px, 768px to 1024px, and greater than 1024px to be given the styles tiny_screen, small_screen, medium_screen, and large_screen respectively.

More information plus some additional tips at the link, if you have any questions/comments/criticisms post them below, as well as if you use this in a project or improve upon it and I’ll update with that information included as well.</p> ]]></description>
<pubDate>Sat, 24 Sep 2011 07:01:17 GMT</pubDate>
<guid>http://snipplr.com/view/59044/flexible-site-layout-with-resize-detection/</guid>
</item>
<item>
<title>(PHP) CSS minifier and color replaces</title>
<link>http://snipplr.com/view/58764/css-minifier-and-color-replaces/</link>
<description><![CDATA[ <p>With this file you can load stylesheets and minify the code while changing colors. The stylesheets are loaded using file_get_contents and you can attach them one after another if you have multiple sheets. The colors are replaces based on a variable thats commented out of the css code, an example of the way thats formatted is below the cod block. The minification is done with a regular expression that removes all comments, line breaks, and un-needed spaces. The color replacement is done with a different regular expression and the colorize function that takes the variable and returns a color. You can use whatever method you want to get the color, but I personally am using variables from a Wordpress plugin (and stores using the Wordpress options function) to give users color customizability of their site.

If you have any questions or comments you can post a comment here or at the link, there is also a more in depth explanation at the link if your interested.

UPDATE: improved it's ability to find colors in the CSS declaration, also added the "transparent" keyword in as something it can find.</p> ]]></description>
<pubDate>Sun, 18 Sep 2011 06:40:30 GMT</pubDate>
<guid>http://snipplr.com/view/58764/css-minifier-and-color-replaces/</guid>
</item>
<item>
<title>(PHP) Simple MySQL to CSV</title>
<link>http://snipplr.com/view/58408/simple-mysql-to-csv/</link>
<description><![CDATA[ <p>Just a short little script that takes a mysql query and turns it into a csv file that downloads automatically. If your interested in the details you can hit up the link.</p> ]]></description>
<pubDate>Sat, 03 Sep 2011 11:34:22 GMT</pubDate>
<guid>http://snipplr.com/view/58408/simple-mysql-to-csv/</guid>
</item>
<item>
<title>(PHP) Simple single "loop.php" Word Press theme function</title>
<link>http://snipplr.com/view/58053/simple-single-loopphp-word-press-theme-function/</link>
<description><![CDATA[ <p>Instead of requiring the loop.php file in your custom themes you can use there two functions, placed in your functions.php file to not only automatically include it, but make a dead simple to filter sections out on a page by page basis negating the need for special loops for specific page types (like a search loop or a main index loop)

The first section is the code you put into your functions file.

The second is how you would call the new "the_loop()" function, simple but all the individual sections you want filtered out as variables, one after another.

The third sections is how you would go about filtering items out.

More information at the link, questions or comments can be posted here or there and I'll get back to you whenever I can.</p> ]]></description>
<pubDate>Sat, 20 Aug 2011 13:41:04 GMT</pubDate>
<guid>http://snipplr.com/view/58053/simple-single-loopphp-word-press-theme-function/</guid>
</item>
<item>
<title>(JavaScript) Local Storage in HTML5</title>
<link>http://snipplr.com/view/57821/local-storage-in-html5/</link>
<description><![CDATA[ <p>This is just a simple explanation of how to use the HTML5 local storage in javascript. The link has a more thorough explanation and an example for those interested. The examples to save, retrive, and clear are marked below.</p> ]]></description>
<pubDate>Sun, 14 Aug 2011 10:28:29 GMT</pubDate>
<guid>http://snipplr.com/view/57821/local-storage-in-html5/</guid>
</item>
<item>
<title>(HTML) Offline Sites in HTML5</title>
<link>http://snipplr.com/view/57820/offline-sites-in-html5/</link>
<description><![CDATA[ <p>The link has a full explanation with more detail about how this all works, as well as an example of it in action. This is just going to be the short-short version. If you have any questions check that out, if you still have questions then leave a comment and I'll help you as best I can.

First we need to define a cache manifest, to do that you simple need to add a cache manifest item to your initial HTML tag. The proper extensions is .appcache, check the first section of the source to see an example.

Then, if the server isn't set up to support the .appcache file we need to add a line to out .htaccess file, this is important because it must be servered with the proper header. See the second section for the line to add to the htaccess file.

The we need to add the files to be cached to the appcache, there is a more complete example at the link, this is just the basic format. It's in the third section below.

If you have any questions or problems implementing leave a comment and I'll help you if I can.</p> ]]></description>
<pubDate>Sun, 14 Aug 2011 10:17:44 GMT</pubDate>
<guid>http://snipplr.com/view/57820/offline-sites-in-html5/</guid>
</item>
<item>
<title>(JavaScript) Google Maps API3 made simple</title>
<link>http://snipplr.com/view/57428/google-maps-api3-made-simple/</link>
<description><![CDATA[ <p>This is a simple example of the google maps javascript API v3. If you want a map with a marker this is the minimum you need to do to get it done. Theres more talk about how it's all set up, and how to use the other static image map as well at the link. 

To implement this you'll need an Google Maps API key to replace the one I used (which is for me site and won't work elsewhere due to how google set up the API keys). You can get one of those here:
http://code.google.com/apis/maps/signup.html

To use you simple need to include the script in the header, the div where you want the map to be located (size that as we want) then fill in the address variable.

Again more documentation, a script breakdown, and an example at the link. If you have a question feel free to post a comment.</p> ]]></description>
<pubDate>Sun, 31 Jul 2011 05:21:31 GMT</pubDate>
<guid>http://snipplr.com/view/57428/google-maps-api3-made-simple/</guid>
</item>
<item>
<title>(jQuery) Simple jQuery Rotator</title>
<link>http://snipplr.com/view/57077/simple-jquery-rotator/</link>
<description><![CDATA[ <p>The code is in three parts, a HTML layout (with some requirements I'll go over below), some CSS code (again, requirements below) and the actual jQuery code. I go over all the code in detail at the link, but I'll give a quick rundown od the jQuery as well.

The HTML:
The button that control next and previous are given IDs of "rotator_next" and "rotator_prev" respectively. The content shows in the a div with the ID "rotator_box". Inside the "rotator_box" div there a other divs with the IDs "rotator_set_#" where # is a number, 1 through as many pages as you want.

The CSS:
The important part of the style is the width, height, and overflow property. The width and height allow you to control the way the items are display, be it column, grid, or standard horizontal orientation.

The jQuery:
The script runs on document load and sets up a click even for the next and previous buttons. This evens add or subtract the lastviwed accordingly and run the update function, which does the fading out and fading in. After the contents have faded in it sets the opacity to 1, this is just to prevent any overzealous user from clicking so fast it makes a page stop wanting to fade fully in.

Like I said, theres more info and an example at the link.</p> ]]></description>
<pubDate>Sun, 24 Jul 2011 05:02:20 GMT</pubDate>
<guid>http://snipplr.com/view/57077/simple-jquery-rotator/</guid>
</item>
<item>
<title>(PHP) Simple inline PHP alternating rows</title>
<link>http://snipplr.com/view/56219/simple-inline-php-alternating-rows/</link>
<description><![CDATA[ <p>Traditionally when you have lost lists of dat you want to alternate rows for usability. The first thing everybody makes to fix this is a simple if statement loop, but this adds a number of lines and is hardly a clean solution. Additionally it required you to have a “counter” or “switch” variable, usually placed at the bottom of the loop, overall very messy.

I had a boss who thought he was on the cutting edge by compressing the traditional if statement into a shorthand version (saving 2-3 lines of code), but the system was still using a $class variable and still requires a counting or switch variable. It was still a mess and added clutter to the code.

Earlier today I was working on outputting client records forafully customized application. Wanting to avoid such messy code as I looked for a better solution and with a little tweaking and playing I came up with this.

I've also included a simple example of how it's used in action. If you have any questions or concerns let me know either here or at the link (there's some more info about this method there too if your intreated).</p> ]]></description>
<pubDate>Thu, 07 Jul 2011 12:24:00 GMT</pubDate>
<guid>http://snipplr.com/view/56219/simple-inline-php-alternating-rows/</guid>
</item>
</channel>
</rss>