<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 19:22:26 +0000</lastBuildDate>
    <item>
      <title>(PHP) Intergrating the wordpress media uploader into your plugin - FatFolderDesigner</title>
      <link>https://snipplr.com/view/67849/intergrating-the-wordpress-media-uploader-into-your-plugin</link>
      <description>&lt;p&gt;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).&#13;
&#13;
There more information on implementation at the URL.&lt;/p&gt;</description>
      <pubDate>Sun, 21 Oct 2012 08:29:36 UTC</pubDate>
      <guid>https://snipplr.com/view/67849/intergrating-the-wordpress-media-uploader-into-your-plugin</guid>
    </item>
    <item>
      <title>(PHP) Perfect PHP .htaccess rewrites - FatFolderDesigner</title>
      <link>https://snipplr.com/view/66655/perfect-php-htaccess-rewrites</link>
      <description>&lt;p&gt;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.&#13;
&#13;
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.&lt;/p&gt;</description>
      <pubDate>Sat, 11 Aug 2012 17:02:37 UTC</pubDate>
      <guid>https://snipplr.com/view/66655/perfect-php-htaccess-rewrites</guid>
    </item>
    <item>
      <title>(PHP) Wordpress Redirects with wp_redirect() - FatFolderDesigner</title>
      <link>https://snipplr.com/view/64365/wordpress-redirects-with-wpredirect</link>
      <description>&lt;p&gt;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.&lt;/p&gt;</description>
      <pubDate>Thu, 05 Apr 2012 14:02:57 UTC</pubDate>
      <guid>https://snipplr.com/view/64365/wordpress-redirects-with-wpredirect</guid>
    </item>
    <item>
      <title>(PHP) jQuery syle DOM navigation in PHP with phpQuery - FatFolderDesigner</title>
      <link>https://snipplr.com/view/63292/jquery-syle-dom-navigation-in-php-with-phpquery</link>
      <description>&lt;p&gt;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 -&gt;. Theres alot more details information at the link if your interested. Post questions/comments here or there.&#13;
&#13;
You can get the phpquery files, and well as read the manual at the google code page here: http://code.google.com/p/phpquery/&lt;/p&gt;</description>
      <pubDate>Mon, 13 Feb 2012 09:55:58 UTC</pubDate>
      <guid>https://snipplr.com/view/63292/jquery-syle-dom-navigation-in-php-with-phpquery</guid>
    </item>
    <item>
      <title>(PHP) CSS minifier and color replaces - FatFolderDesigner</title>
      <link>https://snipplr.com/view/58764/css-minifier-and-color-replaces</link>
      <description>&lt;p&gt;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.&#13;
&#13;
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.&#13;
&#13;
UPDATE: improved it's ability to find colors in the CSS declaration, also added the "transparent" keyword in as something it can find.&lt;/p&gt;</description>
      <pubDate>Sun, 18 Sep 2011 06:40:30 UTC</pubDate>
      <guid>https://snipplr.com/view/58764/css-minifier-and-color-replaces</guid>
    </item>
    <item>
      <title>(PHP) Simple MySQL to CSV - FatFolderDesigner</title>
      <link>https://snipplr.com/view/58408/simple-mysql-to-csv</link>
      <description>&lt;p&gt;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.&lt;/p&gt;</description>
      <pubDate>Sat, 03 Sep 2011 11:34:22 UTC</pubDate>
      <guid>https://snipplr.com/view/58408/simple-mysql-to-csv</guid>
    </item>
    <item>
      <title>(PHP) Simple single "loop.php" Word Press theme function - FatFolderDesigner</title>
      <link>https://snipplr.com/view/58053/simple-single-loopphp-word-press-theme-function</link>
      <description>&lt;p&gt;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)&#13;
&#13;
The first section is the code you put into your functions file.&#13;
&#13;
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.&#13;
&#13;
The third sections is how you would go about filtering items out.&#13;
&#13;
More information at the link, questions or comments can be posted here or there and I'll get back to you whenever I can.&lt;/p&gt;</description>
      <pubDate>Sat, 20 Aug 2011 13:41:04 UTC</pubDate>
      <guid>https://snipplr.com/view/58053/simple-single-loopphp-word-press-theme-function</guid>
    </item>
    <item>
      <title>(PHP) Simple inline PHP alternating rows - FatFolderDesigner</title>
      <link>https://snipplr.com/view/56219/simple-inline-php-alternating-rows</link>
      <description>&lt;p&gt;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.&#13;
&#13;
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.&#13;
&#13;
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.&#13;
&#13;
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).&lt;/p&gt;</description>
      <pubDate>Thu, 07 Jul 2011 12:24:00 UTC</pubDate>
      <guid>https://snipplr.com/view/56219/simple-inline-php-alternating-rows</guid>
    </item>
    <item>
      <title>(PHP) PHP HTML5 multi-file upload - FatFolderDesigner</title>
      <link>https://snipplr.com/view/47210/php-html5-multifile-upload</link>
      <description>&lt;p&gt;Uploading multiple files at once used to be strictly in the realm of flash or required javascript to crate multiple upload forms as needed. The first method has the problems with the general incompatibility of flash. The second, well, it's a very low tech method and limits you to selecting only one file per upload form, real pain.&#13;
&#13;
First is the HTML form. Pretty standard all you gotta do is add the multiple tag and add brakets to the variable name. Those brakets are the key to the next set, they tell PHP to make the variable an array.&#13;
&#13;
Then is the PHP code. First thing you have to do is get the number of files, I used the count() on an variable then run through till you hit the count, using the variable in each $_FIES call. It's easy to retrofit an older system this way.&#13;
&#13;
An example of the above code can be found at the link.&lt;/p&gt;</description>
      <pubDate>Sun, 16 Jan 2011 08:49:24 UTC</pubDate>
      <guid>https://snipplr.com/view/47210/php-html5-multifile-upload</guid>
    </item>
    <item>
      <title>(PHP) PHP absolutely relative root - FatFolderDesigner</title>
      <link>https://snipplr.com/view/44647/php-absolutely-relative-root</link>
      <description>&lt;p&gt;After an attempt to more a live site to a personal server for further work I ran across the problem of a mix of absolut and relative links making the local copy not work. Not wanting to manually have to change every single absolute to a relative (because some files are called from multiple sources leading to time consuming  complicated conditional relative link) I looked for ways to simple "convert" my original absolutes to relatives and come up with this.&#13;
&#13;
Basically, this adds the appropriate number of back links (../'s) so that it starts at your server root. This makes relative linking easier because they will always start from the same place no matter where you are or what file may be making the link.&#13;
&#13;
This is just a first run of it, I know of some improvements that could be made (primarily, making it a class instead of a definition because once this is set it's stuck, causing it to work incorrectly at times) but this version works for basic sites.&lt;/p&gt;</description>
      <pubDate>Mon, 22 Nov 2010 10:09:07 UTC</pubDate>
      <guid>https://snipplr.com/view/44647/php-absolutely-relative-root</guid>
    </item>
  </channel>
</rss>
