<?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>Dammit Jim! &#187; how to</title>
	<atom:link href="http://scott.sherrillmix.com/blog/tag/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://scott.sherrillmix.com/blog</link>
	<description>I'm a biologist not a...</description>
	<lastBuildDate>Tue, 12 Jan 2010 05:09:51 +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>Creating a (Better) Fake Post with a Wordpress Plugin</title>
		<link>http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/</link>
		<comments>http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 20 May 2007 14:58:18 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Blogger]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[fake]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/</guid>
		<description><![CDATA[I was looking to create a fake page in a Wordpress plugin I'm working on in my (all too limited) spare time. It may seem a little silly to try to create a fake page with a plugin but this could be useful for any plugin that will display information to the readers of the [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking to create a fake page in a Wordpress plugin I'm working on in my (all too limited) spare time. It may seem a little silly to try to create a fake page with a plugin but this could be useful for any plugin that will display information to the readers of the blog (outside the admin panel), like statistics, contact pages or about pages.  Luckily there is a <a href="http://headzoo.com/tutorials/wordpress-creating-a-fake-post-with-a-plugin">handy tutorial for creating a fake posts</a>. But although the plugin cleverly tricks Wordpress into displaying a post created dynamically by the plugin itself, Wordpress is clever enough to know something is wrong and sends a 404 error before sending the plugin-created content. Although many browsers will still display the page, this is a problem for any text-based browser or if you want the page to be indexed by search engines and (for me at least) just kind of grates to know my magnificent new plugin isn't actually performing correctly. Anyway, this happens because <code>WP-&gt;handle_404()</code> called by <code>WP-&gt;main()</code> in <code>classes.php</code> checks how many posts were found which, in this case, is 0 since there is no <em>real</em> post for the requested URL. To get around this problem, we need to make sure we trick Wordpress before this function is called. Luckily we can catch Wordpress immediately after it (unsuccessfully) looks for posts before any other function can figure out anything is wrong by using the <code>the_posts</code> filter.</p>

<p>So here is the new working code or just download it <a href="/res/fakepage.zip">here</a>. I'm not sure how many people will actually be interested in it but if you are feel free to leave a comment with any suggestions or questions.</p>
<div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-2">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Plugin Name: Fake Page Plugin 2</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Plugin URI: http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Description: Creates a fake page without a 404 error (based on &lt;a href=&quot;http://headzoo.com/tutorials/wordpress-creating-a-fake-post-with-a-plugin&quot;&gt;Sean Hickey's Fake Plugin Page&lt;/a&gt;)</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Author: Scott Sherrill-Mix</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Author URI: http://scott.sherrillmix.com/blog/</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Version: 1.1</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> FakePage</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * The slug for the fake post.&nbsp; This is the URL for your plugin, like:</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * http://site.com/about-me or http://site.com/?page_id=about-me</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * @var string</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$page_slug</span> = <span style="color:#FF0000;">'about-me'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * The title for your fake post.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * @var string</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$page_title</span> = <span style="color:#FF0000;">'About Me'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * Allow pings?</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * @var string</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$ping_status</span> = <span style="color:#FF0000;">'open'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * Class constructor</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> FakePage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * We'll wait til WordPress has looked for posts, and then</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * check to see if the requested url matches our target.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'the_posts'</span>,<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>&amp;<span style="color:#0000FF;">$this</span>,<span style="color:#FF0000;">'detectPost'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; * Called by the 'detectPost' action</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> createPost<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * What we are going to do here, is create a fake post.&nbsp; A post</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * that doesn't actually exist. We're gonna fill it up with</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * whatever values you want.&nbsp; The content of the post will be</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * the output from your plugin.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span>&nbsp;&nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Create a fake post.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span> = <span style="color:#000000; font-weight:bold;">new</span> stdClass;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * The author ID for the post.&nbsp; Usually 1 is the sys admin.&nbsp; Your</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * plugin can find out the real author ID without any trouble.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_author</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * The safe name for the post.&nbsp; This is the post slug.</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_name</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">page_slug</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Not sure if this is even important.&nbsp; But gonna fill it up anyway.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">guid</span> = get_bloginfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wpurl'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'/'</span> . <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">page_slug</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * The title of the page.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_title</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">page_title</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * This is the content of the post.&nbsp; This is where the output of</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * your plugin should go.&nbsp; Just store the output from all your</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * plugin function calls, and put the output into this var.</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_content</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getContent</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Fake post ID to prevent WP from trying to show comments for</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * a post that doesn't really exist.</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ID</span> = -<span style="color:#CC66CC;color:#800000;">1</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Static means a page, not a post.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_status</span> = <span style="color:#FF0000;">'static'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Turning off comments for the post.</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">comment_status</span> = <span style="color:#FF0000;">'closed'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Let people ping the post?&nbsp; Probably doesn't matter since</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * comments are turned off, so not sure if WP would even</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * show the pings.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ping_status</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">ping_status</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">comment_count</span> = <span style="color:#CC66CC;color:#800000;">0</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * You can pretty much fill these up with anything you want.&nbsp; The</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * current date is fine.&nbsp; It's a fake post right?&nbsp; Maybe the date</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * the plugin was activated?</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_date</span> = current_time<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'mysql'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_date_gmt</span> = current_time<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'mysql'</span>, <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> getContent<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#FF0000;">'&lt;p&gt;Hi there!&nbsp; You are viewing my fake post!&lt;/p&gt;'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> detectPost<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$posts</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$wp</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$wp_query</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Check if the requested page matches our target </span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strtolower"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$wp</span>-&gt;<span style="color:#006600;">request</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <a href="http://www.php.net/strtolower"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">page_slug</span><span style="color:#006600; font-weight:bold;">&#41;</span> || <span style="color:#0000FF;">$wp</span>-&gt;<span style="color:#006600;">query_vars</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'page_id'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">page_slug</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//Add the fake post</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$posts</span>=<span style="color:#000000; font-weight:bold;">NULL</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$posts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">createPost</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/**</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Trick wp_query into thinking this is a page (necessary for wp_title() at least)</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Not sure if it's cheating or not to modify global variables in a filter </span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * but it appears to work and the codex doesn't directly say not to.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">is_page</span> = <span style="color:#000000; font-weight:bold;">true</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//Not sure if this one is necessary but might as well set it like a true page</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">is_singular</span> = <span style="color:#000000; font-weight:bold;">true</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">is_home</span> = <span style="color:#000000; font-weight:bold;">false</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">is_archive</span> = <span style="color:#000000; font-weight:bold;">false</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">is_category</span> = <span style="color:#000000; font-weight:bold;">false</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color:#000066;">unset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">query</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"error"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">query_vars</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"error"</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#FF0000;">""</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">is_404</span>=<span style="color:#000000; font-weight:bold;">false</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$posts</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Create an instance of our class.</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">new</span> FakePage; </div></li></ol></div>
</div></div><br />

This is just an example to get you started creating a fake page with a plugin. After loading this plugin, you will be able to visit your fake page at <code>http://site.com/about-me/</code> or for the non-pretty link people <code>http://site.com/?page_id=about-me</code>. Hope it helps someone out and good luck with your plugin.

<h3>Change Log:</h3>
<ul>
<li><a href="/res/fakepage_v1.1.zip">v1.1</a> 6-5-2007
<ul><li>Fixed 404 error on more complicated permalink structures</li></ul>
</li>
<li><a href="/res/fakepage_v1.0.zip">v1.0</a> 5-20-2007</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Toshiba Satellite A70 Power Problems (Again)</title>
		<link>http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems-again/</link>
		<comments>http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems-again/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 15:44:00 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Electrical Engineer]]></category>
		<category><![CDATA[a70]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[desolder]]></category>
		<category><![CDATA[faulty]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[power jack]]></category>
		<category><![CDATA[repair]]></category>
		<category><![CDATA[satellite]]></category>
		<category><![CDATA[toshiba]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems-again/</guid>
		<description><![CDATA[Laptop Repair Guy points out that Toshiba has issued a warranty extension resulting from a class action lawsuit. As far as I can tell (I'm not a lawyer so better check for yourself) I'm out of luck since I'm in Canada but definitely better to have Toshiba fix it for free than try yourself.

After I [...]]]></description>
			<content:encoded><![CDATA[<p><span class="highlight"><a href="http://www.laptoprepair101.com/">Laptop Repair Guy</a> points out that Toshiba has issued a <strong>warranty extension</strong> resulting from a <a href="http://www.mommamuse.com/2006/11/14/class-action-lawsuit-against-toshiba/">class action lawsuit</a>. As far as I can tell (I'm not a lawyer so better check for yourself) I'm out of luck since I'm in Canada but definitely better to have Toshiba fix it for free than try yourself.</span></p>

<p>After I put up a post about <a href="http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems/">repairing my laptop power connector</a>, <a href="http://www.asklaptopfreak.com/">Laptop Freak</a> left a informative comment:</p>
<blockquote><p>As you see on the photo above, the positive connector oxidized and almost black. If you put a fresh solder on the connector like this, the power jack problem will reappear very soon. I usually remove the power jack from the system board (with iron gun and solder sucker), clean oxidized pins on the power jack and pads on the motherboard and only after that resolder the power jack.</p></blockquote>
<p>It turns out, unsurprisingly, that he was right. The power jack started coming loose again after about a month and a half. I was in the middle of a bunch of things so I didn't really feel like messing with it so I just opened up the computer and threw some more solder on it. When the power jack started jiggling <em>again</em> a few weeks later, I knew I had to do something better to fix it. So I picked up a desoldering sucker and some desoldering wick.</p>

<img class="center" src="/res/images/desoldering_tools.jpg" alt="Tools for desoldering" />
<p>It was kind of fun to melt the solder and suck it up until I started thinking about how much money I was messing with. Anyway I had pretty good luck heating up the solder with the soldering iron, sucking with the sucker (it appears the technical term is desoldering pump), and then getting the remainder with the copper desoldering braid. This left only tiny bit of solder so I pulled on each joint separately while heating them with the soldering iron. MAKE just put up a nice <a href="http://www.makezine.com/blog/archive/2007/01/soldering_tutor_1.html">soldering and desoldering video tutorial</a>. Would have been handy to have watched that <em>before</em> doing all this.</p>
<img class="center" src="/res/images/Toshiba_A70_dirty_power_jack.jpg" alt="Dirty Toshiba Satellite A70 power jack" />
<p>After all that, I was left with the separated power jack. Laptop Freak wasn't kidding about oxidation. It looks like someone left the connectors in the Dead Sea. I'm no electrician but I'm guessing black crud covering electrical contacts can not be a good thing. So I scraped off all the gunk with a screwdriver and polished them until they were nice and shiny.</p>
<img class="center" src="/res/images/Toshiba_A70_clean_power_jack.jpg" alt="Clean Toshiba Satellite A70 power jack" />

<p>Then I tried to clean the contacts on the board with an eraser to remove any oxidation on the copper, stuck the jack back in its holes and soldered it back on. So far I haven't had any problems, we'll see if it last this time.  If it breaks <em>again</em> (knock on wood), I'm definitely trying the <a href="http://www.laptoprepair101.com/laptop/2006/05/27/failed-laptop-power-jack-workaround/">external power jack workaround</a>. </p>
<img class="center" src="/res/images/Toshiba_A70_fixed_power_jack.jpg" alt="Fixed Toshiba Satellite A70 power jack" />
<p>In case you didn't read <a href="http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems/">my old post about fixing this</a>, here's links for <a href="http://www.irisvista.com/tech/laptops/ToshibaA75/satA75_1.htm">how to dismantle a Toshiba Satellite A70</a> (and tons of other laptops) and the <a href="http://www.laptoprepair101.com/laptop/2006/01/28/toshiba-satellite-m35x-a75-power-jack-problem/">common Toshiba power jack problems</a>.</p>
<p><em>Update</em>:<ins datetime="2007-12-12T05:06:40+00:00"><a href="http://www.laptoprepair101.com/">Laptop Repair Guy</a> now has a great <a href="http://www.laptoprepair101.com/laptop/2007/12/06/dc-power-jack-repair-guide/">step by step guide</a> (complete with <em>many</em> pictures) to repairing the power jack.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems-again/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Windows&#8217; Hidden Font Improvement</title>
		<link>http://scott.sherrillmix.com/blog/programmer/windows-hidden-font-improvement/</link>
		<comments>http://scott.sherrillmix.com/blog/programmer/windows-hidden-font-improvement/#comments</comments>
		<pubDate>Mon, 27 Nov 2006 16:03:34 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Programmer]]></category>
		<category><![CDATA[cleartype]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[improvement]]></category>
		<category><![CDATA[ishara]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/windows-hidden-font-improvement/</guid>
		<description><![CDATA[I just found out about ClearType fonts thanks to Download Squad. I'm still debating whether I like them or not. They took me a few hours to get used to. Every time I looked away from my computer, I would come back and feel like my eyes were unfocused. But that blurry effect seems to [...]]]></description>
			<content:encoded><![CDATA[<p>I just found out about ClearType fonts thanks to <a href="http://www.downloadsquad.com/2006/11/27/quicktype-cleartype-toggle/">Download Squad</a>. <del datetime="2007-11-27T01:13:08+00:00">I'm still debating whether I like them or not.</del> They took me a few hours to get used to. Every time I looked away from my computer, I would come back and feel like my eyes were unfocused. But that blurry effect seems to have gone away and the fonts do look pretty and somehow thicker so I'm thinking I'll stay with them. I guess they're not all that hidden but funny how you can go years on a operating system and not know something so basic. Anyway, if you want to try on your computer go to the Display Control Panel. Click on the Appearance tab and click the Effects... button. Then select ClearType from the drop down under "Use the following method to smooth edges of screen fonts:". You can also find out more about it and see examples at <a href="http://www.microsoft.com/typography/cleartype/tuner/Step1.aspx">Microsoft's ClearType Tuner</a>.</p>


<img class="center" src="/res/images/cleartype.jpg" alt="How to turn on ClearType fonts in XP" />]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/programmer/windows-hidden-font-improvement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using quotation marks effectively in Unix</title>
		<link>http://scott.sherrillmix.com/blog/programmer/using-quotation-marks-effectively-in-unix/</link>
		<comments>http://scott.sherrillmix.com/blog/programmer/using-quotation-marks-effectively-in-unix/#comments</comments>
		<pubDate>Sun, 26 Nov 2006 19:00:39 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Bash/UNIX]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[backtick]]></category>
		<category><![CDATA[double]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[quotation marks]]></category>
		<category><![CDATA[quote]]></category>
		<category><![CDATA[single]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/using-quotation-marks-effectively-in-unix/</guid>
		<description><![CDATA[This is pretty basic knowledge but I've helped a few people out recently that had been using Unix/Linux for a while and didn't know and it sure helped me out when I figured it out. If you had asked me how many quotation marks were on a keyboard before I started doing Bash stuff I [...]]]></description>
			<content:encoded><![CDATA[<p>This is pretty basic knowledge but I've helped a few people out recently that had been using Unix/Linux for a while and didn't know and it sure helped me out when I figured it out. If you had asked me how many quotation marks were on a keyboard before I started doing Bash stuff I would have said two. But I, and it seems most non-programmers, often forget the little <code>`</code> on the same key as the tilde ~ (to the left of the numbers on standard keyboards). So there are actually three types of quotation marks and each one means something different to Unix:</p>

<dl>
<dt>Single quote/forward quote <code style="font-size:150%;font-weight: bold;">'</code></dt><dd>Just for clarity this is the key next to the Enter key on most keyboards. A pair of single quotes tells Unix that the contents are a string and that it should not mess around inside. For example: <code>x=17;echo 'This is $x';</code> will return <code>This is $x</code>. Unix did not replace the variable <code>$x</code> with 17.
</dd>
<dt>Double quote <code style="font-size:150%;font-weight: bold;">"</code></dt><dd>Double quotes again tell Unix that the contents are a string. Double quotes and the above single quotes useful for keeping Unix from messing up spaces. For example: <code>grep "To be or not to be" hamlet.txt</code> will search hamlet.txt for the famous line. In contrast, <code>grep To be or not to be hamlet.txt</code> searches for <code>To</code> in the files <code>be, or, not, to, be, hamlet.txt</code> (not what was intended). Double quotes are different from single quotes in that they allow Unix to replace variables inside them. For example: <code>x=17;echo "This is $x";</code> will return <code>This is 17</code>.</dd>
<dt>Backtick/back quote <code style="font-size:150%;font-weight: bold;">`</code></dt><dd>Just for clarity this is the key shared with ~ on most keyboards. These are really different than the other two. They tell Unix to run whatever command is inside and paste in the output. These are equivalent to using <code>$()</code>. For example: <code>echo "You are in `pwd`"</code> will return <code>You are in /usr/bin/</code> or whatever directory you are in. These can come in really handy. One common use is looping through files. Here's a slightly more complex example that uses both double and back quotes to add the filename to every row in all text files in a directory: <code>for i in `ls *.txt`;do sed "s/^/$i /" $i >$i.new;done</code></dd>
</dl> 
<p>Knowing how these are used can really help with using Unix. The difference between <code>'commands'</code> and <code>"commands"</code> is pretty subtle but can make a big difference in the results. I learned this the hard way but hopefully now you won't have to.</p>.]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/programmer/using-quotation-marks-effectively-in-unix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Toshiba Satellite A70 Power Problems</title>
		<link>http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems/</link>
		<comments>http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems/#comments</comments>
		<pubDate>Wed, 11 Oct 2006 22:37:06 +0000</pubDate>
		<dc:creator>ScottS-M</dc:creator>
				<category><![CDATA[Electrical Engineer]]></category>
		<category><![CDATA[a70]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[faulty]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[power jack]]></category>
		<category><![CDATA[repair]]></category>
		<category><![CDATA[satellite]]></category>
		<category><![CDATA[toshiba]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems/</guid>
		<description><![CDATA[Laptop Repair Guy points out that Toshiba has issued a warranty extension resulting from a class action lawsuit. As far as I can tell (I'm not a lawyer so better check for yourself) I'm out of luck since I'm in Canada but definitely better to have Toshiba fix it for free than try yourself.
My Toshiba [...]]]></description>
			<content:encoded><![CDATA[<p><span class="highlight"><a href="http://www.laptoprepair101.com/">Laptop Repair Guy</a> points out that Toshiba has issued a <strong>warranty extension</strong> resulting from a <a href="http://www.mommamuse.com/2006/11/14/class-action-lawsuit-against-toshiba/">class action lawsuit</a>. As far as I can tell (I'm not a lawyer so better check for yourself) I'm out of luck since I'm in Canada but definitely better to have Toshiba fix it for free than try yourself.</span></p>
<p>My Toshiba Satellite A70 started having power problems several weeks ago. Although the power cord was plugged in, the computer was not charging and was draining the battery. The little 'plugged-in' LED would come up but the battery status LED would still show power coming from the battery. I could jiggle the power cord and it would come back up so I ignored it and got used to jiggling. Unfortunately, the power got more and more touchy and I spent more and more time jiggling the stupid power cord. I first guessed it must be something with my power adaptor but (after cutting open the outer wrap of the cord), I finally put it together that the 'plugged-in' LED was coming on but not the battery charging light. This seemed pretty odd. So I finally went out and bought a multimeter. For $20 it was a really good investment and I wish I would have bought one several hours of jiggling frustration earlier. Anyway after the multimeter showed the cord was giving the appropriate 19V without any interruptions, I finally got the bright idea to google the problem and found out that this is a <a href="http://www.laptoprepair101.com/laptop/2006/01/28/toshiba-satellite-m35x-a75-power-jack-problem/">common problem</a> for the A70. Although I have soldered maybe once in my life, the repair didn't look all that difficult so I thought I'd give it a shot. I ran out and grabbed a crappy Radio Shack iron for $15 and a pack of resistors and circuit board to practice on for $10. You could skip the practice if you were already confident in soldering.</p>

<p>The website <a href="http://www.irisvista.com/tech/laptops/ToshibaA75/satA75_1.htm">How to dismantle a Toshiba A70</a> is invaluable for this task. I just thought I'd add a few notes to their steps:</p>
<ul>	
<li>Step 2 includes "Remove the metal brace and the wireless card." I think this could have been a bit more descriptive. There are two wires running fromt the card up through a hole in the motherboard. I'm pretty paranoid and I couldn't quite work up the guts to disconnect these until I already had the screen off. But you really don't have to worry. The wires end in little connectors that pop on and off easily enough. Also when you disconnect the wires, make sure to note which one goes where. I forgot to and took a guess. Since my internet, isn't reversed I'm assuming I was correct.</li>
<li>Steps 6 and 7, "Remove the securing strip," are a real pain. I took the little strip above the keyboard off three or four times and every time it gave me a hassle. It seems to help if you get the bottom keyboard side off first and then work on the top. It's amazing how well it holds on for just being little plastic tabs.</li>
<li>When following step 10, "Disconnect the keyboard cable from the system board," there are little lock things on each side of the keyboard ribbon. Don't forget to unlock these when taking it out and relock them when putting it back. I forgot to relock them and spent a few anxious moments trying to figure out why only half my keyboard was working.</li>
<li>Step 20, "Carefully remove the system board from the base," is even more of a pain than removing the securing strip. It's sort of the same idea only with a $1000 dollar motherboard instead of a $5 piece of plastic. The motherboard is really wedged in there. I found it easiest to start by getting the PC slot side out first. If you push in the little PC ejector button and sort of lever it and the i.LINK port with a screwdriver, you should be able to get it above the plastic. After that, a little lever action on the volume and headphone jacks on the other side and it should come out fairly easily. This took me about half an hour to figure out. An important note is that if you are certain the DC input jack is the problem you don't even need to take out the motherboard. You could just solder the end of it with it in place. A good way to check this would be to wiggle the power connector from the outside and watch the pins of jack on the inside.</li>
<li>One general point is that there are more than two types of screws. I saw long ones and short ones and assumed that there were only two types. But somewhere in there there is also a medium length screw. You would probably want to pay better attention to this than I did. My last hole didn't fit my last screw. Luckily, it was only the hard drive cover and it already had one screw holding it in so I guess it will hold until something else breaks...</li>
</ul>

<p>So once I finally got into the motherboard, I could see the rear pin of the power input jack moving freely in and out it's hole on the motherboard. I'm not electrician but I assumed this was a bad thing. </p>
<img class="center" src="/res/images/A70_powerjack_before.jpg" alt="A faulty Toshiba Satellite A70 power jack" />

<p>So I fired up my fresh new soldering iron and after practicing with a few resistors, I finally worked up the guts to solder the loose jack. I ended up with a decent sized blob so I cut off some of the extra with some wire clippers. It's worked for a week now so I guess it turned out ok. So in summary it took me, a complete novice at electronics, several hours to fix and cost $45 but I can use the tools again and I learned a lot about the inner working of my computer so I guess the only real cost was a bit of solder. If it breaks again (knock on wood), I might have to try <a href="http://www.laptoprepair101.com/laptop/2006/05/27/failed-laptop-power-jack-workaround/">this workaround</a>.</p>
<img class="center" src="/res/images/A70_powerjack_after.jpg" alt="A resoldered Toshiba Satellite A70 power jack" />
<p><em>Edit:</em> <a href="http://www.asklaptopfreak.com/">Laptop Freak</a> left a informative comment:</p>
<blockquote><p>As you see on the photo above, the positive connector oxidized and almost black. If you put a fresh solder on the connector like this, the power jack problem will reappear very soon. I usually remove the power jack from the system board (with iron gun and solder sucker), clean oxidized pins on the power jack and pads on the motherboard and only after that resolder the power jack.</p></blockquote>
<p>So I may be getting the chance to replace my missing screw sooner than I had hoped.</p>
<p><em>Update</em>:<ins datetime="2007-12-12T05:06:40+00:00"><a href="http://www.laptoprepair101.com/">Laptop Repair Guy</a> now has a great <a href="http://www.laptoprepair101.com/laptop/2007/12/06/dc-power-jack-repair-guide/">step by step guide</a> (complete with <em>many</em> pictures) to repairing the power jack.</ins></p>]]></content:encoded>
			<wfw:commentRss>http://scott.sherrillmix.com/blog/electrical-engineer/toshiba-satellite-a70-power-problems/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
	</channel>
</rss>
