<?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>Sean Behan&#039;s Web Development Portfolio and Blog &#187; Programming</title>
	<atom:link href="http://seanbehan.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Development, Wordpress, Moodle, Ruby on Rails and Design in Burlington, Vermont</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:17:12 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Import/Export Your Wordpress Blogroll&#8230; er, Your Links</title>
		<link>http://seanbehan.com/programming/how-to-importexport-your-wordpress-blogroll-er-your-links/</link>
		<comments>http://seanbehan.com/programming/how-to-importexport-your-wordpress-blogroll-er-your-links/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 17:15:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[lynx]]></category>
		<category><![CDATA[opml]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1079</guid>
		<description><![CDATA[It&#8217;s not immediately apparent how to import/export the links in your Wordpress blogroll. One would expect that the import/export tool, used to backup/restore Wordpress posts and pages would handle this functionality as well. But the import/export tool has many options. You need to select the Blogroll import option (located near the top of the list) [...]


Related posts:<ol><li><a href='http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/' rel='bookmark' title='Permanent Link: How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page'>How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page</a></li>
<li><a href='http://seanbehan.com/programming/get-child-categories-of-parent-category-on-single-post-in-wordpress/' rel='bookmark' title='Permanent Link: Get Child Categories of Parent Category on Single Post in Wordpress'>Get Child Categories of Parent Category on Single Post in Wordpress</a></li>
<li><a href='http://seanbehan.com/programming/parse-for-links-with-prototype-js/' rel='bookmark' title='Permanent Link: Parse for Links with Prototype JS'>Parse for Links with Prototype JS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not immediately apparent how to import/export the links in your Wordpress blogroll. One would expect that the import/export tool, used to backup/restore Wordpress posts and pages would handle this functionality as well. But the import/export tool has many options. You need to select the Blogroll import option (located near the top of the list) and provide the tool with either the destination of a valid OPML XML url, or upload a valid OPML XML file. If you&#8217;re running on Wordpress, this can be found by appending a &#8220;/wp-links-opml.php&#8221; to the URL of your domain. For example, http://seanbehan.com/wp-links-opml.php will show you my blogroll in XML. If your running out of a subdirectory, don&#8217;t forget to include that path in the URL.</p>
<p>If for some reason you&#8217;re running a development website on your localhost, obviously the live, remote site will not be able to contact your localhost for the data. You will have to upload the XML file to the remote site. The Wordpress export tool does not provide the means to generate a the OPML XML file for you. You will have to visit the /wp-links-opml.php file and download the contents yourself, but this depends on how your browser handles XML files. Firefox will show you the raw XML, however, Safari will show you the contents of the XML nodes&#8230; which will most likely be only the name of your website. You&#8217;ll need to go to &#8220;View Source&#8221; option to see the actual XML code.Copy and past the XML to a file with the .xml file extension somewhere on your hard drive. Visit the import &gt; blogroll tool and upload the file!</p>
<p>A simple way to download the file contents is to use the command line web browser Lynx. <a href="http://en.wikipedia.org/wiki/Lynx_%28web_browser%29" target="_blank">http://en.wikipedia.org/wiki/Lynx_%28web_browser%29</a></p>
<p>Just give Lynx the destination URL and the file to write to (it doesn&#8217;t have to exist) and then you can upload this file</p>
<p>&lt;pre&gt;</p>
<p>lynx -source URL &gt; my-links.xml</p>
<p>&lt;/pre&gt;</p>
<p>More info on lynx available here: <a href="http://kb.iu.edu/data/aczi.html" target="_blank">http://kb.iu.edu/data/aczi.html</a></p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/' rel='bookmark' title='Permanent Link: How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page'>How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page</a></li>
<li><a href='http://seanbehan.com/programming/get-child-categories-of-parent-category-on-single-post-in-wordpress/' rel='bookmark' title='Permanent Link: Get Child Categories of Parent Category on Single Post in Wordpress'>Get Child Categories of Parent Category on Single Post in Wordpress</a></li>
<li><a href='http://seanbehan.com/programming/parse-for-links-with-prototype-js/' rel='bookmark' title='Permanent Link: Parse for Links with Prototype JS'>Parse for Links with Prototype JS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/how-to-importexport-your-wordpress-blogroll-er-your-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Check if the Current Logged In User can Edit a Course in MOODLE Using the Has_capability Function</title>
		<link>http://seanbehan.com/programming/how-to-check-if-the-current-logged-in-user-can-edit-a-course-in-moodle-using-the-has_capability-function/</link>
		<comments>http://seanbehan.com/programming/how-to-check-if-the-current-logged-in-user-can-edit-a-course-in-moodle-using-the-has_capability-function/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 02:36:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[course]]></category>
		<category><![CDATA[has_capbility]]></category>
		<category><![CDATA[teacher]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1072</guid>
		<description><![CDATA[After an hour of fruitless searching through the docs and forums, I finally found an answer to my simple question, of course buried in the depths of the shark infested, murky water that is the Moodle code base .
How do I check if a user is a course creator for a given course? I&#8217;m still [...]


Related posts:<ol><li><a href='http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/' rel='bookmark' title='Permanent Link: My Review of Moodle 1.9 Extension Development'>My Review of Moodle 1.9 Extension Development</a></li>
<li><a href='http://seanbehan.com/php/moodles-most-important-function-gets-no-attention/' rel='bookmark' title='Permanent Link: Moodle&#8217;s Most Important Function Gets No Attention'>Moodle&#8217;s Most Important Function Gets No Attention</a></li>
<li><a href='http://seanbehan.com/linux/add-user-directories-to-apache2-web-server/' rel='bookmark' title='Permanent Link: Add User Directories to Apache2 Web Server'>Add User Directories to Apache2 Web Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After an hour of fruitless searching through the docs and forums, I finally found an answer to my simple question, of course buried in the depths of the shark infested, murky water that is the Moodle code base .</p>
<p>How do I check if a user is a course creator for a given course? I&#8217;m still not 100% sure, the access control policy seems needlessly confusing on first glance and even after reading the heady and mostly pointless, expose on how roles/perms are calculated (Available Here: http://docs.moodle.org/en/How_permissions_are_calculated ) If you notice the section titled &#8220;Some Practical Examples&#8221; is 100% empty! (I&#8217;ve added my code to the wiki so not 100% empty any longer) The most useful part of the docs are completely empty! Instead boatloads of time went into a treatise on the internals and lovely graphs like this one <img class="alignnone" src="http://docs.moodle.org/en/images_en/9/9c/Role_calc_table2.png" alt="" width="756" height="256" /></p>
<p>But you could always hop into the forum dedicated just to this chunk of the code base (Available here: http://moodle.org/mod/forum/view.php?f=941&amp;page=0) and search through the 500 topics w/ 5000+(i didn&#8217;t actually count) nested discussions (including version 1.7 of moodle as well).</p>
<p>No, instead, ACK came to the rescue and I found a snippet that performed the task.</p>
<p>Without further ado</p>
<pre>$context = get_context_instance(CONTEXT_COURSE, $course-&gt;id);
if (has_capability('moodle/course:update', $coursecontext)) {
  /** do stuff here */
}
</pre>
<p>There it is. That could have saved me an hour if mentioned in the docs!</p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/' rel='bookmark' title='Permanent Link: My Review of Moodle 1.9 Extension Development'>My Review of Moodle 1.9 Extension Development</a></li>
<li><a href='http://seanbehan.com/php/moodles-most-important-function-gets-no-attention/' rel='bookmark' title='Permanent Link: Moodle&#8217;s Most Important Function Gets No Attention'>Moodle&#8217;s Most Important Function Gets No Attention</a></li>
<li><a href='http://seanbehan.com/linux/add-user-directories-to-apache2-web-server/' rel='bookmark' title='Permanent Link: Add User Directories to Apache2 Web Server'>Add User Directories to Apache2 Web Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/how-to-check-if-the-current-logged-in-user-can-edit-a-course-in-moodle-using-the-has_capability-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</title>
		<link>http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/</link>
		<comments>http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:42:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1064</guid>
		<description><![CDATA[In the example below, I&#8217;m going to zip up a directory that includes images in both PNG and PSD file formats. However, I want to exclude the PSDs because they are huge! 

zip -r my-compressed-dir-without-psd.zip directory-to-zip -x '*.psd'



Related posts:Recursively Zip a Directory and Files on Linux
My Review of Moodle 1.9 Extension Development
Reading, Writing, Removing Files [...]


Related posts:<ol><li><a href='http://seanbehan.com/linux/recursively-zip-a-directory-and-files-on-linux/' rel='bookmark' title='Permanent Link: Recursively Zip a Directory and Files on Linux'>Recursively Zip a Directory and Files on Linux</a></li>
<li><a href='http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/' rel='bookmark' title='Permanent Link: My Review of Moodle 1.9 Extension Development'>My Review of Moodle 1.9 Extension Development</a></li>
<li><a href='http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/' rel='bookmark' title='Permanent Link: Reading, Writing, Removing Files and Directories in Ruby'>Reading, Writing, Removing Files and Directories in Ruby</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In the example below, I&#8217;m going to zip up a directory that includes images in both PNG and PSD file formats. However, I want to exclude the PSDs because they are huge! </p>
<pre>
zip -r my-compressed-dir-without-psd.zip directory-to-zip -x '*.psd'
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/linux/recursively-zip-a-directory-and-files-on-linux/' rel='bookmark' title='Permanent Link: Recursively Zip a Directory and Files on Linux'>Recursively Zip a Directory and Files on Linux</a></li>
<li><a href='http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/' rel='bookmark' title='Permanent Link: My Review of Moodle 1.9 Extension Development'>My Review of Moodle 1.9 Extension Development</a></li>
<li><a href='http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/' rel='bookmark' title='Permanent Link: Reading, Writing, Removing Files and Directories in Ruby'>Reading, Writing, Removing Files and Directories in Ruby</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uncompress A Bz2 File Using Tar Command</title>
		<link>http://seanbehan.com/programming/uncompress-a-bz2-file-using-tar-command/</link>
		<comments>http://seanbehan.com/programming/uncompress-a-bz2-file-using-tar-command/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 21:18:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bzip2]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[uncompress]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1062</guid>
		<description><![CDATA[Uncompress a bz2 file using tar command

tar --use-compress-program bzip2 -xvf your-file-to-uncompress.tar.bz2

@source http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html


Related posts:Launch Photoshop (Or Any App) From The Command Line on Mac OS X
git checkout &#8212; file-in-question.oh-my
Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type



Related posts:<ol><li><a href='http://seanbehan.com/programming/launch-photoshop-or-any-app-from-the-command-line-on-mac-os-x/' rel='bookmark' title='Permanent Link: Launch Photoshop (Or Any App) From The Command Line on Mac OS X'>Launch Photoshop (Or Any App) From The Command Line on Mac OS X</a></li>
<li><a href='http://seanbehan.com/programming/git-checkout-file-in-questionoh-my/' rel='bookmark' title='Permanent Link: git checkout &#8212; file-in-question.oh-my'>git checkout &#8212; file-in-question.oh-my</a></li>
<li><a href='http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/' rel='bookmark' title='Permanent Link: Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type'>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Uncompress a bz2 file using tar command</p>
<pre>
tar --use-compress-program bzip2 -xvf your-file-to-uncompress.tar.bz2
</pre>
<p>@source <a href="http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html">http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html</a></p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/programming/launch-photoshop-or-any-app-from-the-command-line-on-mac-os-x/' rel='bookmark' title='Permanent Link: Launch Photoshop (Or Any App) From The Command Line on Mac OS X'>Launch Photoshop (Or Any App) From The Command Line on Mac OS X</a></li>
<li><a href='http://seanbehan.com/programming/git-checkout-file-in-questionoh-my/' rel='bookmark' title='Permanent Link: git checkout &#8212; file-in-question.oh-my'>git checkout &#8212; file-in-question.oh-my</a></li>
<li><a href='http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/' rel='bookmark' title='Permanent Link: Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type'>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/uncompress-a-bz2-file-using-tar-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Array to Object in PHP</title>
		<link>http://seanbehan.com/programming/convert-array-to-object-in-php/</link>
		<comments>http://seanbehan.com/programming/convert-array-to-object-in-php/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 17:58:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1060</guid>
		<description><![CDATA[
function array2obj($data) {
    return is_array($data) ? (object) array_map(__FUNCTION__,$data) : $data;
}

Source: http://www.serversidemagazine.com/php/how-to-convert-array-notation-to-object-notation


Related posts:Moodle&#8217;s Most Important Function Gets No Attention



Related posts:<ol><li><a href='http://seanbehan.com/php/moodles-most-important-function-gets-no-attention/' rel='bookmark' title='Permanent Link: Moodle&#8217;s Most Important Function Gets No Attention'>Moodle&#8217;s Most Important Function Gets No Attention</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<pre>
function array2obj($data) {
    return is_array($data) ? (object) array_map(__FUNCTION__,$data) : $data;
}
</pre>
<p>Source: <a href="http://www.serversidemagazine.com/php/how-to-convert-array-notation-to-object-notation">http://www.serversidemagazine.com/php/how-to-convert-array-notation-to-object-notation</a></p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/php/moodles-most-important-function-gets-no-attention/' rel='bookmark' title='Permanent Link: Moodle&#8217;s Most Important Function Gets No Attention'>Moodle&#8217;s Most Important Function Gets No Attention</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/convert-array-to-object-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Child Categories of Parent Category on Single Post in Wordpress</title>
		<link>http://seanbehan.com/programming/get-child-categories-of-parent-category-on-single-post-in-wordpress/</link>
		<comments>http://seanbehan.com/programming/get-child-categories-of-parent-category-on-single-post-in-wordpress/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 15:51:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[children]]></category>
		<category><![CDATA[functionality]]></category>
		<category><![CDATA[get_categories]]></category>
		<category><![CDATA[parent]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1056</guid>
		<description><![CDATA[I was hoping to find a function in the Wordpress API, that goes something like this&#8230; 

  the_child_categories("Vermont");
  // print Burlington, Brattleboro... etc if this post has any child categories of Vermont

But I could not. The result that I did find, from various forums goes something like this&#8230; 

$parentcat = get_category_by_slug('Vermont');
foreach((get_the_category()) as $childcat):
 [...]


Related posts:<ol><li><a href='http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/' rel='bookmark' title='Permanent Link: Programmatically Turn Off Comments in Wordpress with Filter'>Programmatically Turn Off Comments in Wordpress with Filter</a></li>
<li><a href='http://seanbehan.com/programming/intercepting-the-wordpress-loop/' rel='bookmark' title='Permanent Link: Intercepting the Wordpress Loop with Pre_get_posts'>Intercepting the Wordpress Loop with Pre_get_posts</a></li>
<li><a href='http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/' rel='bookmark' title='Permanent Link: How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page'>How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was hoping to find a function in the Wordpress API, that goes something like this&#8230; </p>
<pre>
  the_child_categories("Vermont");
  // print Burlington, Brattleboro... etc if this post has any child categories of Vermont
</pre>
<p>But I could not. The result that I did find, from various forums goes something like this&#8230; </p>
<pre>
$parentcat = get_category_by_slug('Vermont');
foreach((get_the_category()) as $childcat):
  if (cat_is_ancestor_of($parentcat, $childcat)):
    echo get_category_link($childcat->cat_ID);
    echo $childcat->cat_name;
  endif;
endforeach;
</pre>
<p>If you&#8217;re in the in the Loop, you can use the get_the_category() function to retrieve the category objects of the current post, without printing the results to the screen. You can loop over the contents from what is returned by the function. </p>
<p>This condition uses the API function &#8220;cat_is_ancestor_of&#8221; to check whether or not the category from the current post is a child of the parent which we fetched with the &#8220;get_category_by_slug&#8221; function. </p>
<p>Here is a little function that I threw into &#8220;functions.php&#8221; so that I can get the child categories easily in my theme. </p>
<pre>
/** Usage
_the_category_children("Vermont"); */
function _the_category_children($slug=""){
  if($categories       = get_the_category()):
    if($slug_category   = get_category_by_slug($slug)):
      foreach($categories as $category):
        echo (cat_is_ancestor_of($slug_category, $category)) ? $category->cat_name : '';
      endforeach;
    endif;
  endif;
}
</pre>
<p>More info/references on accomplishing this functionality are available<br />
<a href="http://codex.wordpress.org/Function_Reference/cat_is_ancestor_of">http://codex.wordpress.org/Function_Reference/cat_is_ancestor_of</a><br />
<a href="http://wordpress.org/support/topic/284057?replies=8#post-1120489">http://wordpress.org/support/topic/284057?replies=8#post-1120489</a><br />
<a href="http://wordpress.org/support/topic/297615">http://wordpress.org/support/topic/297615</a></p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/' rel='bookmark' title='Permanent Link: Programmatically Turn Off Comments in Wordpress with Filter'>Programmatically Turn Off Comments in Wordpress with Filter</a></li>
<li><a href='http://seanbehan.com/programming/intercepting-the-wordpress-loop/' rel='bookmark' title='Permanent Link: Intercepting the Wordpress Loop with Pre_get_posts'>Intercepting the Wordpress Loop with Pre_get_posts</a></li>
<li><a href='http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/' rel='bookmark' title='Permanent Link: How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page'>How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/get-child-categories-of-parent-category-on-single-post-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Flush Your Permalink Structure in Wordpress When Using Taxonomies &#8230;or Wordpress Taxonomies Not Working Instead I See A 404 Page</title>
		<link>http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/</link>
		<comments>http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 17:08:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[permalinks]]></category>
		<category><![CDATA[taxonomies]]></category>
		<category><![CDATA[taxonomy]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1051</guid>
		<description><![CDATA[I didn&#8217;t know this, but because of a linking problem using custom taxonomies in Wordpress, I was forced to find out. If you create a new taxonomy, it will not work immediately on the front facing end. Your users will be greeted by a 404, page not found instead. This isn&#8217;t ideal for obvious reasons. [...]


Related posts:<ol><li><a href='http://seanbehan.com/ruby-on-rails/rails-expiring-a-cached-page-with-namespaces-and-sweepers/' rel='bookmark' title='Permanent Link: Rails: Expiring a cached page with namespaces and sweepers'>Rails: Expiring a cached page with namespaces and sweepers</a></li>
<li><a href='http://seanbehan.com/programming/dot-htaccess-file-for-wordpress-installation-htaccess/' rel='bookmark' title='Permanent Link: Dot htaccess file for wordpress installation (.htaccess)'>Dot htaccess file for wordpress installation (.htaccess)</a></li>
<li><a href='http://seanbehan.com/git/working-with-branches-in-git/' rel='bookmark' title='Permanent Link: Working with Branches in Git'>Working with Branches in Git</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t know this, but because of a linking problem using custom taxonomies in Wordpress, I was forced to find out. If you create a new taxonomy, it will not work immediately on the front facing end. Your users will be greeted by a 404, page not found instead. This isn&#8217;t ideal for obvious reasons. </p>
<p>You create and/or register custom taxonomies like so. You may have multiple taxonomies. </p>
<pre>
add_action('init', 'create_my_taxonomy', 0);
function create_my_taxonomy(){
  register_taxonomy( 'musicians',
    'post',
    array(
      'hierarchical' => false,
      'label' => 'People who play lovely music that I like...',
      'query_var' => 'musicians',
      'rewrite' => array('slug'=>'musicians')
    )
  );
}
</pre>
<p>In your theme directory you need at &#8220;taxonomy.php&#8221; file. This will catch your custom taxonomy requests. You can get even more fancy and create a file like so &#8220;taxonomy-musicians.php&#8221; which you can use to differentiate your taxonomies look/feel. Nice and slick&#8230; however, you may be frustrated after following these two steps and be greeted with a friendly 404 page not found template instead. </p>
<p>Fear not, you need only visit the Admin >> Settings >> Permalinks page as a logged in admin to flush your rewrite rules and get linking and your correct custom taxonomy template file. Straight forward, unless if you didn&#8217;t know that merely visiting the Permalinks Settings page would correct the problem. But Alas, you do!</p>
<h1><em>Addendum</em></h1>
<p>You must also have posts using the taxonomy! Otherwise, you will still get the page 404 not found! I&#8217;m not sure if there is a work around for this at the moment. Anyone know? </p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/ruby-on-rails/rails-expiring-a-cached-page-with-namespaces-and-sweepers/' rel='bookmark' title='Permanent Link: Rails: Expiring a cached page with namespaces and sweepers'>Rails: Expiring a cached page with namespaces and sweepers</a></li>
<li><a href='http://seanbehan.com/programming/dot-htaccess-file-for-wordpress-installation-htaccess/' rel='bookmark' title='Permanent Link: Dot htaccess file for wordpress installation (.htaccess)'>Dot htaccess file for wordpress installation (.htaccess)</a></li>
<li><a href='http://seanbehan.com/git/working-with-branches-in-git/' rel='bookmark' title='Permanent Link: Working with Branches in Git'>Working with Branches in Git</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/how-to-flush-your-permalink-structure-in-wordpress-when-using-taxonomies-or-wordpress-taxonomies-not-working-instead-i-see-a-404-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Render Partial if File Exists</title>
		<link>http://seanbehan.com/programming/render-partial-if-file-exists/</link>
		<comments>http://seanbehan.com/programming/render-partial-if-file-exists/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 00:20:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[nil]]></category>
		<category><![CDATA[partial]]></category>
		<category><![CDATA[render]]></category>
		<category><![CDATA[rescue]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1044</guid>
		<description><![CDATA[If you ever want to render a partial but don&#8217;t want an error thrown you can either check for the existence of the file first 

&#60;%= render :partial =&#62; params[:controller]+"/sidebar" if File.exists?(RAILS_ROOT+"/app/views/"+params[:controller]+"/_sidebar.html.erb")%&#62;

or you can catch the error that Rails throws

 &#60;%= render :partial => params[:controller]+"/sidebar" rescue nil %&#62;



Related posts:Uncompress A Bz2 File Using Tar Command
git [...]


Related posts:<ol><li><a href='http://seanbehan.com/programming/uncompress-a-bz2-file-using-tar-command/' rel='bookmark' title='Permanent Link: Uncompress A Bz2 File Using Tar Command'>Uncompress A Bz2 File Using Tar Command</a></li>
<li><a href='http://seanbehan.com/programming/git-checkout-file-in-questionoh-my/' rel='bookmark' title='Permanent Link: git checkout &#8212; file-in-question.oh-my'>git checkout &#8212; file-in-question.oh-my</a></li>
<li><a href='http://seanbehan.com/programming/quick-syntax-to-pipe-an-sql-query-directly-to-a-file/' rel='bookmark' title='Permanent Link: Quick Syntax to Pipe an SQL Query Directly to a file'>Quick Syntax to Pipe an SQL Query Directly to a file</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you ever want to render a partial but don&#8217;t want an error thrown you can either check for the existence of the file first </p>
<pre>
&lt;%= render :partial =&gt; params[:controller]+"/sidebar" if File.exists?(RAILS_ROOT+"/app/views/"+params[:controller]+"/_sidebar.html.erb")%&gt;
</pre>
<p>or you can catch the error that Rails throws</p>
<pre>
 &lt;%= render :partial => params[:controller]+"/sidebar" rescue nil %&gt;
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/programming/uncompress-a-bz2-file-using-tar-command/' rel='bookmark' title='Permanent Link: Uncompress A Bz2 File Using Tar Command'>Uncompress A Bz2 File Using Tar Command</a></li>
<li><a href='http://seanbehan.com/programming/git-checkout-file-in-questionoh-my/' rel='bookmark' title='Permanent Link: git checkout &#8212; file-in-question.oh-my'>git checkout &#8212; file-in-question.oh-my</a></li>
<li><a href='http://seanbehan.com/programming/quick-syntax-to-pipe-an-sql-query-directly-to-a-file/' rel='bookmark' title='Permanent Link: Quick Syntax to Pipe an SQL Query Directly to a file'>Quick Syntax to Pipe an SQL Query Directly to a file</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/render-partial-if-file-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Review of Moodle 1.9 Extension Development</title>
		<link>http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/</link>
		<comments>http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 19:59:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1040</guid>
		<description><![CDATA[I wrote a review for Joseph Thibault&#8217;s Moodle News on extension development for Moodle. The book is quite good and I think an essential resource for anyone wanting to develop in Moodle. The book focuses on plugin development, but it will also give you an overview of the architecture, api and best practices.  
I [...]


Related posts:<ol><li><a href='http://seanbehan.com/programming/how-to-check-if-the-current-logged-in-user-can-edit-a-course-in-moodle-using-the-has_capability-function/' rel='bookmark' title='Permanent Link: How to Check if the Current Logged In User can Edit a Course in MOODLE Using the Has_capability Function'>How to Check if the Current Logged In User can Edit a Course in MOODLE Using the Has_capability Function</a></li>
<li><a href='http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/' rel='bookmark' title='Permanent Link: Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type'>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/output-logger-and-sql-to-the-rails-console-in-development-mode/' rel='bookmark' title='Permanent Link: Output Logger and SQL to the Rails Console in Development Mode'>Output Logger and SQL to the Rails Console in Development Mode</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I wrote a review for <a href="http://moodlenews.com">Joseph Thibault&#8217;s Moodle News</a> on extension development for Moodle. The book is quite good and I think an essential resource for anyone wanting to develop in Moodle. The book focuses on plugin development, but it will also give you an overview of the architecture, api and best practices.  </p>
<p>I wish I had this book about 3 years ago when I first started fooling around in the code base! At any rate, you can read the review on <a href="http://moodlenews.com">Moodle News</a> at <a href="http://www.moodlenews.com/2010/moodle-1-9-extension-development-review-by-bseanvt/">http://www.moodlenews.com/2010/moodle-1-9-extension-development-review-by-bseanvt/</a></p>
<p>There is also an interesting discussion underway about the &#8216;bloat&#8217; in the Moodle code at <a href="http://www.moodlenews.com/2010/opinion-1000000-lines-of-code/">http://www.moodlenews.com/2010/opinion-1000000-lines-of-code/</a></p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/programming/how-to-check-if-the-current-logged-in-user-can-edit-a-course-in-moodle-using-the-has_capability-function/' rel='bookmark' title='Permanent Link: How to Check if the Current Logged In User can Edit a Course in MOODLE Using the Has_capability Function'>How to Check if the Current Logged In User can Edit a Course in MOODLE Using the Has_capability Function</a></li>
<li><a href='http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/' rel='bookmark' title='Permanent Link: Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type'>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/output-logger-and-sql-to-the-rails-console-in-development-mode/' rel='bookmark' title='Permanent Link: Output Logger and SQL to the Rails Console in Development Mode'>Output Logger and SQL to the Rails Console in Development Mode</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/review-of-moodle-1-9-extension-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NO Table Cell Spacing Please</title>
		<link>http://seanbehan.com/programming/no-table-cell-spacing-please/</link>
		<comments>http://seanbehan.com/programming/no-table-cell-spacing-please/#comments</comments>
		<pubDate>Thu, 27 May 2010 15:32:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[spacing]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1035</guid>
		<description><![CDATA[Remove cell padding on a table you add the cellspacing attribute and set it to &#8220;0&#8243;. Is there a better way to do this with straight up CSS? Nothing seems to work&#8230; 

&#60;table id='my-favorite-table' cellspacing="0" &#62;
...



Related posts:Dump MySQL Database without Drop Table Syntax



Related posts:<ol><li><a href='http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/' rel='bookmark' title='Permanent Link: Dump MySQL Database without Drop Table Syntax'>Dump MySQL Database without Drop Table Syntax</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Remove cell padding on a table you add the cellspacing attribute and set it to &#8220;0&#8243;. Is there a better way to do this with straight up CSS? Nothing seems to work&#8230; </p>
<pre>
&lt;table id='my-favorite-table' cellspacing="0" &gt;
...
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/' rel='bookmark' title='Permanent Link: Dump MySQL Database without Drop Table Syntax'>Dump MySQL Database without Drop Table Syntax</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/no-table-cell-spacing-please/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
