<?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>Lacquer Head &#187; Wordpress</title>
	<atom:link href="http://lacquerhead.ca/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://lacquerhead.ca</link>
	<description>Meat and Computers</description>
	<lastBuildDate>Sun, 19 Dec 2010 19:03:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>No Comments: WordPress Plugin</title>
		<link>http://lacquerhead.ca/2010/12/no-comments/</link>
		<comments>http://lacquerhead.ca/2010/12/no-comments/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 19:42:42 +0000</pubDate>
		<dc:creator>laqrhead</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://lacquerhead.ca/?p=412</guid>
		<description><![CDATA[This is a simple WordPress plugin that removes all comments from the site. It works by preventing the comments template from being loaded. You might find it useful if you are using WordPress as a CMS on a regular site and don&#8217;t want to have to worry about comments. Download no-comments.zip]]></description>
			<content:encoded><![CDATA[<p>This is a simple WordPress plugin that removes all comments from the site. It works by preventing the comments template from being loaded. You might find it useful if you are using WordPress as a CMS on a regular site and don&#8217;t want to have to worry about comments.</p>
<p><a href="http://lacquerhead.ca/wp-content/uploads/2010/12/no-comments.zip">Download no-comments.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lacquerhead.ca/2010/12/no-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook/Twitter Status Updater Plugin Does Everything at Once</title>
		<link>http://lacquerhead.ca/2009/09/facebooktwitter-status-updater-plugin-does-everything-at-once/</link>
		<comments>http://lacquerhead.ca/2009/09/facebooktwitter-status-updater-plugin-does-everything-at-once/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 03:46:06 +0000</pubDate>
		<dc:creator>laqrhead</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://lacquerhead.ca/?p=207</guid>
		<description><![CDATA[I&#8217;ve been using Twitter Tools for some time now and found it quite useful, however, a much simpler plugin is &#8220;Facebook/Twitter Status Updater.&#8221; It updates both twitter and Facebook, and it allows you to specify a different headline for the update, instead of just using the post title. Twitter tools also requires something to be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://wordpress.org/extend/plugins/twitter-tools/">Twitter Tools</a> for some time now and found it quite useful, however, a much simpler plugin is &#8220;<a href="http://wordpress.org/extend/plugins/fb-status-updater/">Facebook/Twitter Status Updater</a>.&#8221; It updates both twitter and Facebook, and it allows you to specify a different headline for the update, instead of just using the post title. Twitter tools also requires something to be appended to the beginning like &#8220;Blog Update:&#8221; and this plugin doesn&#8217;t.</p>
<p>Twitter Tools has many more advanced features for Twitter, but lacks the Facebook update. If all you want to do is update your blog, Twitter, and Facebook from one place, this is the plugin for.</p>
<p>The only drawback I can see is that if you&#8217;re logged into Facebook when you publish a post, you will be automatically logged out.</p>
<p><a href="http://www.francesco-castaldo.com/plugins-and-widgets/fb-status-updater/">Thanks Francesco Castaldo for a great plugin. </a></p>
]]></content:encoded>
			<wfw:commentRss>http://lacquerhead.ca/2009/09/facebooktwitter-status-updater-plugin-does-everything-at-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Media Attachment Parent: WordPress Plugin</title>
		<link>http://lacquerhead.ca/2009/07/change-attachment-parent/</link>
		<comments>http://lacquerhead.ca/2009/07/change-attachment-parent/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 21:33:51 +0000</pubDate>
		<dc:creator>laqrhead</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://lacquerhead.ca/?p=186</guid>
		<description><![CDATA[Change Attachment Parent allows you to edit the parent value of anything in the media library. This becomes useful if you have uploaded images you&#8217;d like to place in a post&#8217;s gallery that are not currently children of that post. I&#8217;ve also found that sometimes you add a new post with photos and they are [...]]]></description>
			<content:encoded><![CDATA[<p>Change Attachment Parent allows you to edit the parent value of anything in the media library.<span id="more-186"></span></p>
<p>This becomes useful if you have uploaded images you&#8217;d like to place in a post&#8217;s gallery that are not currently children of that post.</p>
<p>I&#8217;ve also found that sometimes you add a new post with photos and they are not added to the gallery because you hadn&#8217;t saved the post when you uploaded them. This allows you to associate those photos with the post.</p>
<p>The interface isn&#8217;t that user friendly, you must enter the post ID, and I&#8217;d appreciate feedback on how to improve this.</p>
<h2>Installation</h2>
<p>1. Extract change-post-attachment.zip and place change-post-attachment.php `/wp-content/plugins/` directory<br />
2. Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress</p>
<h2>Download</h2>
<p><a href="http://wordpress.org/extend/plugins/change-attachment-parent/">Download the plugin from the wordpress plugins page.</a></p>
<h2>Donate</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7934153">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://lacquerhead.ca/2009/07/change-attachment-parent/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Getting Other Applications to Work with WordPress Users</title>
		<link>http://lacquerhead.ca/2009/07/getting-other-applications-to-work-with-wordpress-users/</link>
		<comments>http://lacquerhead.ca/2009/07/getting-other-applications-to-work-with-wordpress-users/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 19:59:46 +0000</pubDate>
		<dc:creator>laqrhead</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://lacquerhead.ca/?p=175</guid>
		<description><![CDATA[Sometimes a wordpress plugin is not the proper solution for an complex application. You might want something to work alongside wordpress instead. One of the nice features of Worpress is the user managament. The WordPress documentation for this is non-existant as far as I ca tell, so here&#8217;s how you can quickly have your software [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes a wordpress plugin is not the proper solution for an complex application. You might want something to work alongside wordpress instead. One of the nice features of Worpress is the user managament. The WordPress documentation for this is non-existant as far as I ca tell, so here&#8217;s how you can quickly have your software find out if a user is logged in outside of WordPress.<span id="more-175"></span></p>
<p>WordPress stores the user&#8217;s login status in a cookie named &#8220;wordpress_logged_in_COOKIEHASH,&#8221; Where COOKIEHASH there is  an MD5 hash of the &#8216;Site URL&#8217; option. Line 421 of wp-settings.php:</p>
<p><code><br />
define('COOKIEHASH', md5(get_option('siteurl')));<br />
</code></p>
<p>So you can use that to check the cookie, or  you can copy it from an existing cookie on your machine, or generate it in your own cookie name. First, log yourself out of WordPress, because we are going to be changing the logged in cookie name, and you won&#8217;t be able to log in or out with the old cookie name. Now we can define a new cookie name in the wp-config.php file by adding the following line somewhere in the file:</p>
<p><code>define('LOGGED_IN_COOKIE', 'my_cookie_name');</code></p>
<p>For Reference The default is defined in wp-settings.php on line 392 as:</p>
<p><code>define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);</code></p>
<p>So now I&#8217;ll always know what the cookie name is, so I can extract the username from the cookie value.</p>
<p>The value contains the following info:</p>
<p>username|doubleHashedPassword</p>
<p>Now that we have a username, we can fetch user data, such as a user_id. Something like this should do the trick assuming that you have established your DB connection:</p>
<p><code><?php<br />
if (!empty($_COOKIE[my_cookie_name])) {</p>
<p>    // The user is logged in, so retrieve user data<br />
    $userArr=explode('|',$_COOKIE[my_cookie_name]);<br />
    $user_login=$userArr[0];</p>
<p>    $sql="SELECT ID FROM wp_users WHERE user_login LIKE '$user_login'";<br />
    $query=mysql_query($sql);<br />
    $resultArray=mysql_fetch_array($query);<br />
    $user_id=$resultArray[ID];</p>
<p>} else {</p>
<p>    // The user is not logged in so do something else</p>
<p>}<br />
?></code></p>
<p>That should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://lacquerhead.ca/2009/07/getting-other-applications-to-work-with-wordpress-users/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress RSS Feed Error</title>
		<link>http://lacquerhead.ca/2009/06/wordpress-rss-feed-error/</link>
		<comments>http://lacquerhead.ca/2009/06/wordpress-rss-feed-error/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 15:38:11 +0000</pubDate>
		<dc:creator>laqrhead</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://lacquerhead.ca/?p=143</guid>
		<description><![CDATA[You ever get an error like this from your feeds generated by WordPress? XML Parsing Error: XML or text declaration not at start of entity Location: http://www.yoursite.tld/utils/test.xml Line Number 2, Column 1:&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&#62; Somewhere along the line a new line was being placed before the XML declaration in the feeds. This caused an error [...]]]></description>
			<content:encoded><![CDATA[<p>You ever get an error like this from your feeds generated by WordPress?</p>
<blockquote><p>XML Parsing Error: XML or text declaration not at start of entity<br />
Location: http://www.yoursite.tld/utils/test.xml<br />
Line Number 2, Column 1:&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</p></blockquote>
<p>Somewhere along the line a new line was being placed before the XML declaration in the feeds. This caused an error to display in Firefox and other browsers instead of the feed.<span id="more-143"></span></p>
<p>I searched high and low to find where it was coming from. Disabled all me plugins, removed blank lines from code etc. To no avail. Then I noticed that the error was happening on a Mac but not in Windows. So it had to do with something about how Windows, Mac, and Linux/Unix deal with carriage returns and new line characters. I didn&#8217;t think I&#8217;d ever find the ghost new line (or return) so I tried to find a way to delete it.</p>
<p>Here is the hack/fix. What I&#8217;ve done is start an output buffer, and then clear it before the XML/RSS template is loaded.</p>
<p>In the index.php file put ob_start() like this:</p>
<blockquote><p><code>&lt;?php<br />
ob_start();</code></p></blockquote>
<p>In wp-includes/functions.php add ob_end_clean() to the beginning functions that load the feed templates.</p>
<blockquote><p><code><br />
/**<br />
* Load the RDF RSS 0.91 Feed template.<br />
*<br />
* @since 2.1.0<br />
*/<br />
function do_feed_rdf() {<br />
ob_end_clean();<br />
load_template( ABSPATH . WPINC . '/feed-rdf.php' );<br />
}</code></p>
<p>/**<br />
* Load the RSS 1.0 Feed Template<br />
*<br />
* @since 2.1.0<br />
*/<br />
function do_feed_rss() {<br />
ob_end_clean();<br />
load_template( ABSPATH . WPINC . &#8216;/feed-rss.php&#8217; );<br />
}</p>
<p>/**<br />
* Load either the RSS2 comment feed or the RSS2 posts feed.<br />
*<br />
* @since 2.1.0<br />
*<br />
* @param bool $for_comments True for the comment feed, false for normal feed.<br />
*/<br />
function do_feed_rss2( $for_comments ) {<br />
ob_end_clean();<br />
if ( $for_comments )<br />
load_template( ABSPATH . WPINC . &#8216;/feed-rss2-comments.php&#8217; );<br />
else<br />
load_template( ABSPATH . WPINC . &#8216;/feed-rss2.php&#8217; );<br />
}</p>
<p>/**<br />
* Load either Atom comment feed or Atom posts feed.<br />
*<br />
* @since 2.1.0<br />
*<br />
* @param bool $for_comments True for the comment feed, false for normal feed.<br />
*/<br />
function do_feed_atom( $for_comments ) {<br />
ob_end_clean();<br />
if ($for_comments)<br />
load_template( ABSPATH . WPINC . &#8216;/feed-atom-comments.php&#8217;);<br />
else<br />
load_template( ABSPATH . WPINC . &#8216;/feed-atom.php&#8217; );<br />
}</p></blockquote>
<p>This worked without the change to the index.php file, but I don&#8217;t think it should have.</p>
<p>I tried to accomplish this with a plugin, but it wouldn&#8217;t work. since this is editing WordPress core files, these changes will need to be made again after an upgrade if the problem persists with the new version.</p>
]]></content:encoded>
			<wfw:commentRss>http://lacquerhead.ca/2009/06/wordpress-rss-feed-error/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Duplicate Category Names in WordPress</title>
		<link>http://lacquerhead.ca/2009/06/duplicate-category-names-in-wordpress/</link>
		<comments>http://lacquerhead.ca/2009/06/duplicate-category-names-in-wordpress/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 20:18:09 +0000</pubDate>
		<dc:creator>laqrhead</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[slug]]></category>

		<guid isPermaLink="false">http://lacquerhead.ca/?p=62</guid>
		<description><![CDATA[I was having some issues adding sub-categories that had duplicate names, but unique slugs. I don&#8217;t know if this is a bug or a feature, but since the slug is the unique key, it doesn&#8217;t make sense to me why you couldn&#8217;t be able to have duplicate names if the slug is unique. Anyways, here [...]]]></description>
			<content:encoded><![CDATA[<p>I was having some issues adding sub-categories that had duplicate names, but unique slugs. I don&#8217;t know if this is a bug or a feature, but since the slug is the unique key, it doesn&#8217;t make sense to me why you couldn&#8217;t be able to have duplicate names if the slug is unique. Anyways, here is a hack, not a plugin, <em>so you&#8217;ll need to fix it again if you update WordPress.</em><span id="more-62"></span></p>
<p>To allow duplicate names, but keep unique slugs, find the following code (lines 312-318) in wp-admin/admin-ajax.php:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span> category_exists<span class="br0">&#40;</span> <a href="http://www.php.net/trim"><span class="kw3">trim</span></a><span class="br0">&#40;</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;cat_name&#8217;</span><span class="br0">&#93;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$x</span> = <span class="kw2">new</span> WP_Ajax_Response<span class="br0">&#40;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;what&#8217;</span> =&gt; <span class="st0">&#8216;cat&#8217;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;id&#8217;</span> =&gt; <span class="kw2">new</span> WP_Error<span class="br0">&#40;</span> <span class="st0">&#8216;cat_exists&#8217;</span>, __<span class="br0">&#40;</span><span class="st0">&#8216;The category you are trying to create already exists.&#8217;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span> <span class="st0">&#8216;form-field&#8217;</span> =&gt; <span class="st0">&#8216;cat_name&#8217;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span> <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$x</span>-&gt;<span class="me1">send</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Replace with this code:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span> category_exists<span class="br0">&#40;</span> <a href="http://www.php.net/trim"><span class="kw3">trim</span></a><span class="br0">&#40;</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;category_nicename&#8217;</span><span class="br0">&#93;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$x</span> = <span class="kw2">new</span> WP_Ajax_Response<span class="br0">&#40;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;what&#8217;</span> =&gt; <span class="st0">&#8216;cat&#8217;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;id&#8217;</span> =&gt; <span class="kw2">new</span> WP_Error<span class="br0">&#40;</span> <span class="st0">&#8216;cat_exists&#8217;</span>, __<span class="br0">&#40;</span><span class="st0">&#8216;The category you are trying to create already exists.&#8217;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span> <span class="st0">&#8216;form-field&#8217;</span> =&gt; <span class="st0">&#8216;category_nicename&#8217;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span> <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$x</span>-&gt;<span class="me1">send</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>What you are doing is changing the instances of &#8220;cat_name&#8221; with &#8220;category_nicename&#8221;, This has it check the slug for uniqueness, and not the name.</p>
<p>I tested briefly for myself and it seems to be working.</p>
]]></content:encoded>
			<wfw:commentRss>http://lacquerhead.ca/2009/06/duplicate-category-names-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

