<?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>trickeries! &#187; php</title>
	<atom:link href="http://trickeries.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://trickeries.com</link>
	<description>it's tricky to rock a style thats liked online</description>
	<lastBuildDate>Tue, 02 Mar 2010 06:01:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>trickyInc: a dynamic css / javascript php library</title>
		<link>http://trickeries.com/401/trickyinc-a-dynamic-css-javascript-php-library/</link>
		<comments>http://trickeries.com/401/trickyinc-a-dynamic-css-javascript-php-library/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 04:37:50 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[trickyInc]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=401</guid>
		<description><![CDATA[I am very pleased to introduce trickyInc, a flexible and extensible dynamic css / javascript library written in php.
Download
Documentation
I won&#8217;t go into detail here about what it does, because the google code project covers that pretty well.  If you have any interest in dynamic css and/or javascript, I urge you to check it out. [...]]]></description>
			<content:encoded><![CDATA[<p>I am very pleased to introduce trickyInc, a flexible and extensible dynamic css / javascript library written in php.</p>
<h2><a href="http://code.google.com/p/trickyinc/downloads/detail?name=trickyInc.zip">Download</a></h2>
<h2><a href="http://code.google.com/p/trickyinc/wiki/Documentation">Documentation</a></h2>
<p>I won&#8217;t go into detail here about what it does, because the google code project covers that pretty well.  If you have any interest in dynamic css and/or javascript, I urge you to check it out.  I have been using it on all of my projects lately, and I am enjoying the hell out of it.</p>
<p>I would love some developer feedback on this, so if anyone finds this interesting enough to use, please let me know about your experience, and open issues in the google code project as necessary.  I would also love any feedback regarding making it faster / safer / better / whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/401/trickyinc-a-dynamic-css-javascript-php-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GMFDYUI</title>
		<link>http://trickeries.com/175/gmfdyui/</link>
		<comments>http://trickeries.com/175/gmfdyui/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 07:23:40 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[downloads]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=175</guid>
		<description><![CDATA[
An attractive friend of mine pointed out that I hadn&#8217;t posted in a bit, so this is what you get.
This is a terribly simple drop in php script that basically just redirects people to Google with a query.
This is useful when someone ask you a stupid question, when it should be obvious that they just [...]]]></description>
			<content:encoded><![CDATA[<p class="image"><img title="gmfdyui" src="http://trickeries.com/wp-content/uploads/2008/07/gmfdyui.jpg" alt="google mother fucker, do you use it?" width="400" height="267" /></p>
<p>An attractive friend of mine pointed out that I hadn&#8217;t posted in a bit, so this is what you get.</p>
<p>This is a terribly simple drop in php script that basically just redirects people to Google with a query.</p>
<p>This is useful when someone ask you a stupid question, when it should be obvious that they just need to Google it.  You can give them a link that may appear to be useful, but will it only taunt them for being foolish.</p>
<h2><a href="http://hijx.us/gmfdyui/how%20do%20i%20fix%20my%20computer">example</a></h2>
<h2><a href="http://trickeries.com/wp-content/uploads/2008/07/gmfdyui.zip">download</a></h2>
<p><small>This was inspired by <a href="http://justfuckinggoogleit.com/">http://justfuckinggoogleit.com/</a> and of course whoever originally came up with the Samuel L macro.  A sarcastic apology to anyone offended by the language in this post.  Get off the internet, thank you.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/175/gmfdyui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript measurements, window.onload, and getimagesize</title>
		<link>http://trickeries.com/132/javascript-measurements-windowonload-and-getimagesize/</link>
		<comments>http://trickeries.com/132/javascript-measurements-windowonload-and-getimagesize/#comments</comments>
		<pubDate>Wed, 28 May 2008 08:58:09 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quick]]></category>
		<category><![CDATA[trickeries]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=132</guid>
		<description><![CDATA[If you use a lot of javascript for animations / measurements (like I do), it can be very useful to include the width and the height of any images you use in your &#60;img/&#62; tags.  This will make sure that width / height measurements taken by your javascript are accurate before waiting for all [...]]]></description>
			<content:encoded><![CDATA[<p>If you use a lot of javascript for animations / measurements (like I do), it can be very useful to include the width and the height of any images you use in your &lt;img/&gt; tags.  This will make sure that width / height measurements taken by your javascript are accurate before waiting for all of the images to load.  This leaves you free to run your code as soon as the dom is ready, without worrying about remeasuring once window.onload fires.</p>
<p>A teensy bit of php will take care of this for you if you do not already know the image size, or don&#8217;t care to look into it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;img alt=&quot;i am lazy&quot; src=&quot;/images/myImage.jpg&quot; <span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #0066FF;">list</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$w</span><span style="color: #339933;">,</span><span style="color: #00FF00;">$h</span><span style="color: #FF6600;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0066FF;">getimagesize</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$path_to_image</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #00FF00;">echo</span> <span style="color: #FF0000;">&quot;width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$w</span><span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$h</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/132/javascript-measurements-windowonload-and-getimagesize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mlurl (my little url): a personal url shortener</title>
		<link>http://trickeries.com/121/mlurl-my-little-url-a-personal-url-shortener/</link>
		<comments>http://trickeries.com/121/mlurl-my-little-url-a-personal-url-shortener/#comments</comments>
		<pubDate>Tue, 27 May 2008 09:07:54 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[mlurl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[redirector]]></category>
		<category><![CDATA[shortener]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=121</guid>
		<description><![CDATA[
A friend (and boss) of mine thought that this would be a good idea, and not being foolish/strange enough to be a coder himself, I decided to make it because it could be useful.
It is a drop in php script that allows you to host your own url shortener / redirector like snurl or tinyurl. [...]]]></description>
			<content:encoded><![CDATA[<p class="image"><a href="http://trickeries.com/wp-content/uploads/2008/05/mlurl.zip"><img title="mlurl - my little url" src="http://trickeries.com/wp-content/uploads/2008/05/mlurl.png" alt="mlurl - my little url" width="434" height="250" /></a></p>
<p>A <a title="williac.com" href="http://williac.com">friend</a> (and boss) of mine thought that this would be a good idea, and not being foolish/strange enough to be a coder himself, I decided to make it because it could be useful.</p>
<p>It is a drop in php script that allows you to host your own url shortener / redirector like <a title="Snipurl / Snurl / Snipr - Snippetty snip snip with your looong URLs!" href="http://snurl.com/">snurl</a> or <a title="TinyURL.com - shorten that long URL into a Tiny URL" href="http://tinyurl.com/">tinyurl</a>.  Only you will be able to add / remove url&#8217;s from it.  This would allow you to essentially brand the url&#8217;s you send, or just simplify the linking process on your site or elsewhere.</p>
<p>If you have any trouble, check out the README.txt included, or leave a comment here.</p>
<h2><a title="download mlurl" href="http://trickeries.com/wp-content/uploads/2008/05/mlurl.zip">download</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/121/mlurl-my-little-url-a-personal-url-shortener/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>mootools rainbow toy: the trickeries! technicolor dream machine</title>
		<link>http://trickeries.com/112/mootools-rainbow-toy-the-trickeries-technicolor-dream-machine/</link>
		<comments>http://trickeries.com/112/mootools-rainbow-toy-the-trickeries-technicolor-dream-machine/#comments</comments>
		<pubDate>Tue, 20 May 2008 05:47:09 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rainbow]]></category>
		<category><![CDATA[toy]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=112</guid>
		<description><![CDATA[
I got a little bored this weekend, and decided to make myself a toy to play with rainbows, and give it a stupid name.
There is actually some pretty cool stuff going on, it is written in javascript(w/some sweet sweet mootools), and a little bit of php for automagic.
I wrote a class to make the rainbow, [...]]]></description>
			<content:encoded><![CDATA[<p class="image"><a title="the trickeries! technicolor dream machine" href="http://trickeries.com/demo/technicolorDreamMachine/"><img title="the trickeries! technicolor dream machine" src="http://trickeries.com/wp-content/uploads/2008/05/technicolordreammachine.png" alt="the treickeries! technicolor dream machine" width="434" height="315" /></a></p>
<p>I got a little bored this weekend, and decided to make myself a toy to play with rainbows, and give it a stupid name.</p>
<p>There is actually some pretty cool stuff going on, it is written in javascript(w/some sweet sweet mootools), and a little bit of php for automagic.</p>
<p>I wrote a class to make the rainbow, and one for the sliders you see.  If you think either would be useful, they are included in the head.</p>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/112/mootools-rainbow-toy-the-trickeries-technicolor-dream-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sxsw day two</title>
		<link>http://trickeries.com/42/sxsw-day-two/</link>
		<comments>http://trickeries.com/42/sxsw-day-two/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 10:32:31 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[MU]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sxsw]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://trickeries.com/42/sxsw-day-two/</guid>
		<description><![CDATA[The second day was difficult to start, we had quite a first night. Did not manage to make it to anything before noon.  Anywho&#8230;
attended  the contextual web
This was not quite what I expected, I was hoping that this would be more about data portability, but it ended up just being an iPhone orgy. [...]]]></description>
			<content:encoded><![CDATA[<p>The second day was difficult to start, we had quite a first night. Did not manage to make it to anything before noon.  Anywho&#8230;</p>
<h2>attended  <a title="SXSW panel - the contextual web" href="http://2008.sxsw.com/interactive/programming/panels_schedule/?action=show&amp;id=IAP060494">the contextual web</a></h2>
<p>This was not quite what I expected, I was hoping that this would be more about data portability, but it ended up just being an iPhone orgy.  I did however realize that I was in the non-iPhone possessing sxsw minority.</p>
<h2>attended <a title="ExpressionEngine 2.0 Sneak Peak" href="http://2008.sxsw.com/interactive/programming/panels_schedule/?action=show&amp;id=IAP060590">ExpressionEngine 2.0 Sneak Peak</a></h2>
<p>This was awesome.  I am and have been a big fan of <a title="Ellis Lab" href="http://ellislab.com/">Ellislab</a>, not because of <a title="Expression Engine" href="http://expressionengine.com/">ExpressionEngine</a>, but because of <a title="CodeIgniter - Open source PHP web application framework" href="http://codeigniter.com/">CodeIgniter</a>.  Learning about ExpressionEngine was very interesting, especially when they announced that <a title="ExpressionEngine 2.0: fully CodeIgnited!" href="http://codeigniter.com/news/expressionengine_20_fully_codeignited/">ExpressionEngine 2.0 has been rewritten to run on top of CodeIgniter</a>.  This is very pleasant news.  This has gotten me all atwitter about the possibilities of a cms running on-top of my most favoritest PHP framework.  Also everyone was very nice, and I desired to be friends with them.  This panel was something I talked about throughout the rest of my trip.</p>
<h2>attended <a title="10 Things We've Learned at 37signals" href="http://2008.sxsw.com/interactive/programming/panels_schedule/?action=show&amp;id=IAP060547">10 Things We&#8217;ve Learned at 37signals</a></h2>
<p>This was another highpoint.  CEO Jason Fried is an excellent speaker.  Everything he said made sense, and he answered all questions asked were answered very well.  At one point <a title="Anil Dash" href="http://www.dashes.com/anil/">Anil Dash</a> of <a title="six apart" href="http://www.sixapart.com/">six apart</a> asked a question that seemed like more of an insult than anything.</p>
<h2>attended <a title="SXSW panel - Behind the Scenes at the Onion News Network" href="http://2008.sxsw.com/interactive/programming/panels_schedule/?action=show&amp;id=IAP060306">Behind the Scenes at the Onion News Network</a></h2>
<p>This was pretty fun, it being the Onion and all (which had quite a presence in Austin).  I was hoping that it was going to be more about the site backend, and not the actual production of the show / a bunch of clips I have already seen.</p>
<h2>went to the <a title="SXSX evening - google party" href="http://2008.sxsw.com/interactive/evening_events/">Google Party</a></h2>
<p><img title="The SXSWi Google Party" src="http://trickeries.com/wp-content/uploads/2008/03/google_party.png" alt="The SXSWi Google Party" width="434" height="326" /></p>
<p>Wacky google action, got lots of saucy google swag, including pens, flashing plastic pins, and the best thing I have to keep a secret, because it is a present for my buddy Wes.  The bar was kinda downtowny and lame, but I also got to meet <a title="Dustin Diaz - ./ with imagination" href="http://www.dustindiaz.com/">Dustin Diaz</a>, and tell him that I love him.  His girlfriend liked my hair, and took a picture of us.</p>
<h2>went to the <a title="EllisLab party at Moonshine Grill" href="http://codeigniter.com/news/join_us_at_sxsw/">EllisLab party at Moonshine Grill</a></h2>
<p><img title="ExpressionEngine Party" src="http://trickeries.com/wp-content/uploads/2008/03/expression_engine_party.png" alt="This is the CodeIgniter / Expression engine core team trying to eat while I stalk them." width="434" height="326" /><br />
This was a wonderful event.  Tons of bad ass food, free shirts (I nabbed a bunch and wear them all the time).  The highlight of this was definitely hanging out with and talking to <a title="CodeIgniter, ExpressionEngine, and the World of Web Desgin" href="http://www.derekallard.com/">Derek Allard</a>.  Derek is a development beast, and is responsible for alot of the awesomeness in and around <a title="Expression Engine" href="http://expressionengine.com/">ExpressionEngine</a> and <a title="CodeIgniter - Open source PHP web application framework" href="http://codeigniter.com/">CodeIgniter</a>.  You should go to his site, it is awesome.</p>
<h2>went to the <a title="http://2008.sxsw.com/interactive/evening_events/" href="http://2008.sxsw.com/interactive/evening_events/"><strong><span class="summary">frog design / SXSW Interactive Opening Party</span></strong></a></h2>
<p>This was a hell of a thing.  There seemed to be thousands of people spread throughout a very large area, lots of loud techno music and so forth.  The beer line was long, and the beer was green.  I think we only managed to stay there for about an hour.</p>
<h2>went to the <a title="http://2008.sxsw.com/interactive/evening_events/" href="http://2008.sxsw.com/interactive/evening_events/"><strong><span class="summary">16 Bit: SXSWi&#8217;s Opening Night Afterparty</span></strong></a></h2>
<p><img title="16 bit: SXSWi Opening Night Afterparty" src="http://trickeries.com/wp-content/uploads/2008/03/16bit.png" alt="16 bit: SXSWi Opening Night Afterparty" width="434" height="326" /></p>
<p>This was an amazing party, with an equally amazing line to get in.  There was a <a title="999 eyes - authentic freakshow" href="http://www.999eyes.com/">band / freakshow</a>, which eventually turned into silly 80&#8217;s music that made me feel like I was playing Vice City.  It was good stuff all around, lots of cool excited people and lots of free drinks.</p>
<p><img title="999 eyes: band / freakshow playing at 16bit" src="http://trickeries.com/wp-content/uploads/2008/03/999_eyes.png" alt="999 eyes: band / freakshow playing at 16bit" width="434" height="326" /></p>
<p>Towards the end of the party, I met <a title="Photo Matt » Unlucky In Cards" href="http://ma.tt/">Matt Mullenweg</a>.   I have always been amazed by <a title="Wordpress &gt; Blog Tool and Weblog Platform" href="http://wordpress.org/">Wordpress</a>, and generally the stuff he gets into.  I got to spend some time talking to him about the future of Wordpress, and vented a little bit about the <a title="My profile on the WordpressMU support forums." href="http://mu.wordpress.org/forums/profile.php?id=155796">problems</a> I have had with <a title="Wordpress Multiuser" href="http://mu.wordpress.org/">WordpressMU</a>, chiefly the <em><strong>forced</strong></em> support of the no-www.org agenda.  I am not even going to link to it because of how much arrogant bullshit I think it is.  It should be noted that <em>normal</em> Wordpress does not enforce this.  When I was done going off about that, I launched into a drunken rant about how awesome CodeIgniter and ExpressionEngine were going to get. We were talking until the bar closed, and were yelled at to leave by a scruffy bouncer, and then continued to talk outside until his girlfriend got pissed.  Anyhow, Matt was awesome, and much funnier than I expected.</p>
<h2>ended up at <a title="Kerbey Lane Cafe" href="http://austin.citysearch.com/review/10241780/1909601">Kerbey Lane Cafe</a></h2>
<p>We stood outside of Scoot Inn (where the last party was) bullshitting with people for about an hour and suddenly found ourselves among the last few there.  Me and Cliff (big bad boss) ended up going to breakfast with two complete strangers.  One was a local Austin lady who was recently single (which she repeatedly and proudly exclaimed) and a gentleman who, to me, was the epitome of the apple fanboy.  I was later informed that I may have been too rough on him regarding this, but I was drunk and he was a friendly stranger.</p>
<p>I don&#8217;t remember what I ate (aside from sweet potato fries), and I don&#8217;t remember the stranger&#8217;s names.  If you are one of the strangers: please excuse me, and leave a comment to say hi.</p>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/42/sxsw-day-two/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>COMPLETED: current project: recursive mootools accordion</title>
		<link>http://trickeries.com/19/project-recursive-mootools-accordion/</link>
		<comments>http://trickeries.com/19/project-recursive-mootools-accordion/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 07:54:03 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://trickeries.com/19/project-recursive-mootools-accordion/</guid>
		<description><![CDATA[All done, go here
For some time I have wanted to create a truly recursive mootools accordion class that could, with properly formatted xhtml, be limitlessly recursive.  I have attempted this on several occasions, however have yet to be successful.
I am looking forward to trying again with the advent of mootools 1.2, it will most [...]]]></description>
			<content:encoded><![CDATA[<h2>All done, <a href="http://trickeries.com/192/raccordion-a-mootools-12-recursive-accordion/">go here</a></h2>
<p>For some time I have wanted to create a truly recursive <a href="http://mootools.net/" title="mootools - my object oriented tools, javascript library / framework">mootools </a>accordion class that could, with properly formatted xhtml, be limitlessly recursive.  I have attempted this on several occasions, however have yet to be successful.</p>
<p>I am looking forward to trying again with the advent of mootools <a href="http://blog.mootools.net/2008/1/16/mootools-1-2-beta-2" title="mootools 1.2b">1.2</a>, it will most likely be much easier to complete.  Most of the problems that have been encountered have been with how flexible I have tried to make it.  I have achieved the desired, however it would only apply to one parent and it&#8217;s descendents, however I would still like it to be able to apply to all of the said parents siblings.</p>
<p>Updates will follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/19/project-recursive-mootools-accordion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress database resetter.</title>
		<link>http://trickeries.com/16/wordpress-database-resetter/</link>
		<comments>http://trickeries.com/16/wordpress-database-resetter/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 06:16:57 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[downloads]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://trickeries.com/16/wordpress-database-resetter/</guid>
		<description><![CDATA[I have found that while developing  for wordpress it is often very useful to be able to quickly and easily drop all the working tables and start from scratch, so i whipped up a plugin to do just that.  It will drop every table from the database defined in your wp-config.php that starts [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://trickeries.com/wp-content/uploads/2008/02/db_reset.zip" title="DB Reset plugin"></a>I have found that while developing  for wordpress it is often very useful to be able to quickly and easily drop all the working tables and start from scratch, so i whipped up a plugin to do just that.  It will drop every table from the database defined in your wp-config.php that starts with the defined prefix, when you tell it to of course.  It will then direct you to the last step of the install, where you will need to define your blog title, and your admin email address.</p>
<h2><a href="http://trickeries.com/wp-content/uploads/2008/02/db_reset.zip" title="download the wordpress DB Reset plugin">download DB Reset</a></h2>
<p>here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #FF00FF; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: DB Reset
Plugin URI: http://trickeries.com/16/wordpress-database-resetter/
Description: terribly simple plugin to basically drop all of your wordpress tables.
Author: atom smith
Version: 1.0
Author URI: http://trickeries.com/
*/</span>
&nbsp;
&nbsp;
add_action<span style="color: #FF6600;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'db_reset_delete_tables'</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #FF6600;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'add_db_reset_sub_menu'</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #FF00FF; font-weight: bold;">function</span> add_db_reset_sub_menu<span style="color: #FF6600;">&#40;</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span>
	add_submenu_page<span style="color: #FF6600;">&#40;</span><span style="color: #0000ff;">'plugins.php'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'DB Reset'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'DB Reset'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">,</span> <span style="color: #FF6600; font-weight: bold;">__FILE__</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'db_reset_output'</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #FF6600;">&#125;</span>
&nbsp;
<span style="color: #FF00FF; font-weight: bold;">function</span> db_reset_output<span style="color: #FF6600;">&#40;</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;div class=&quot;wrap&quot;&gt;
		&lt;h2&gt;DB Reset&lt;/h2&gt;
		<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">if</span><span style="color: #FF6600;">&#40;</span><span style="color: #339933;">!</span><span style="color: #0066FF;">isSet</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$_POST</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'db_reset'</span><span style="color: #FF6600;">&#93;</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> db_reset_get_tables<span style="color: #FF6600;">&#40;</span><span style="color: #FF6600;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/div&gt;
&nbsp;
<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #FF6600;">&#125;</span>
&nbsp;
<span style="color: #FF00FF; font-weight: bold;">function</span> db_reset_get_tables<span style="color: #FF6600;">&#40;</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span>
	<span style="color: #FF00FF; font-weight: bold;">global</span> <span style="color: #00FF00;">$wpdb</span><span style="color: #339933;">;</span>
	<span style="color: #00FF00;">$prefixed_tables</span> <span style="color: #339933;">=</span> <span style="color: #00FF00;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #FF0000;">prefix</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'%'</span><span style="color: #339933;">;</span>
	<span style="color: #00FF00;">$tables</span> <span style="color: #339933;">=</span> <span style="color: #00FF00;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #FF0000;">get_results</span><span style="color: #FF6600;">&#40;</span><span style="color: #FF0000;">&quot;show tables LIKE '<span style="color: #006699; font-weight: bold;">$prefixed_tables</span>'&quot;</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;div class=&quot;updated&quot;&gt;&lt;strong&gt;Please make sure that you understand what you are doing before using this.  The following tables will be deleted and replaced:&lt;/strong&gt;
		&lt;ul&gt;
		<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">foreach</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$tables</span> <span style="color: #00FF00;">as</span> <span style="color: #00FF00;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #00FF00;">$v</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;li&gt;
				<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">echo</span> <span style="color: #00FF00;">$tables_to_delete</span><span style="color: #FF6600;">&#91;</span><span style="color: #FF6600;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0066FF;">pos</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$v</span><span style="color: #FF6600;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;/li&gt;
		<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;form action=&quot;#&quot; method=&quot;post&quot;&gt;
		<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">foreach</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$tables_to_delete</span> <span style="color: #00FF00;">as</span> <span style="color: #00FF00;">$table</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;input type=&quot;hidden&quot; name=&quot;delete[]&quot; value=&quot;<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">echo</span> <span style="color: #00FF00;">$table</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
		<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #00FF00;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;input style=&quot;font-size:100px; width:100%; padding: 20px;&quot; type=&quot;submit&quot; name=&quot;db_reset&quot; value=&quot;Reset DB&quot; /&gt;
	&lt;/form&gt;
<span style="color: #FF00FF; font-weight: bold;">&lt;?php</span>
<span style="color: #FF6600;">&#125;</span>
&nbsp;
<span style="color: #FF00FF; font-weight: bold;">function</span> db_reset_delete_tables<span style="color: #FF6600;">&#40;</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span>
	<span style="color: #00FF00;">if</span><span style="color: #FF6600;">&#40;</span><span style="color: #0066FF;">isSet</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$_POST</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'db_reset'</span><span style="color: #FF6600;">&#93;</span><span style="color: #FF6600;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #00FF00;">$_POST</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'db_reset'</span><span style="color: #FF6600;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'Reset DB'</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span>
		<span style="color: #FF00FF; font-weight: bold;">global</span> <span style="color: #00FF00;">$wpdb</span><span style="color: #339933;">;</span>
		<span style="color: #00FF00;">if</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #FF0000;">prefix</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span>
			<span style="color: #00FF00;">foreach</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$_POST</span><span style="color: #FF6600;">&#91;</span><span style="color: #0000ff;">'delete'</span><span style="color: #FF6600;">&#93;</span> <span style="color: #00FF00;">as</span> <span style="color: #00FF00;">$table</span><span style="color: #FF6600;">&#41;</span><span style="color: #FF6600;">&#123;</span>
				<span style="color: #00FF00;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #FF0000;">query</span><span style="color: #FF6600;">&#40;</span><span style="color: #FF0000;">&quot;DROP TABLE <span style="color: #006699; font-weight: bold;">$table</span>&quot;</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #FF6600;">&#125;</span>
			<span style="color: #00FF00;">$location</span> <span style="color: #339933;">=</span> <span style="color: #FF0000;">&quot;..&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #FF6600;">&#125;</span>
		<span style="color: #0066FF;">header</span><span style="color: #FF6600;">&#40;</span><span style="color: #FF0000;">&quot;Location: <span style="color: #006699; font-weight: bold;">$location</span>&quot;</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #FF6600;">&#125;</span>
<span style="color: #FF6600;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/16/wordpress-database-resetter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
