<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Link organisation with the Category Overload plugin</title>
	<atom:link href="http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13/feed" rel="self" type="application/rss+xml" />
	<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13</link>
	<description>Underwater photography by Andy Kirkland</description>
	<pubDate>Thu, 11 Mar 2010 16:00:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: muttznutz</title>
		<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-201</link>
		<dc:creator>muttznutz</dc:creator>
		<pubDate>Sat, 04 Oct 2008 17:25:04 +0000</pubDate>
		<guid isPermaLink="false">http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-201</guid>
		<description>&lt;h3&gt;Back to basics&lt;/h3&gt;
Rather worryingly, this is getting quite high on the Google list for "Category Overload". That's very flattering, but I wasn't expecting so much interest ...
What I was trying to do was to treat different categories of bookmarks / links / blogroll entries in different ways. 
Certain categories (Photo Albums, Camera buddies etc.) are shown in the sidebar, while others would appear on the "Thanks" page.
I wanted these to be driven by data so far as possible, rather than being hard-coded into the page template. So - if I add a new category into links I want to "thank", I'd rather just set a flag.
The "CategoryOverload" plugin sorted this up to WP 2.3, when the new database structure was introduced.
At this point, link categories were given there own slot in the taxonomy (see the 12th Nov 2007 comment).
Many of the functions which apply to post / page categories were no longer available for link categories - previously, this seems to have been constrained by screens, but now many functions "cut out" any entry which isn't a "category".

&lt;h3&gt;So how do you use this code, then eh ?&lt;/h3&gt;
One of the comments said the documentation was "a bit vague" (sorry about that).
Well, this does involve messing around a bit with your theme's template pages, and it does involve php and SQL code, so you should understand what you're doing.
I've not got into the WordPress development process enough yet to wrap this up as a Plugin, and all of the above isn't anything like "official" WP code.
But what I've done is to create a template called "thankslinks.php", and plumbed in the above code.
That code selects a set of data which can be iterated and used for standard WP template tags such as wp_list_bookmarks().
My "Thanks" page has that template assigned (in the "Page Template" tab when you edit the page) and then the code just kinda drops things out ...</description>
		<content:encoded><![CDATA[<h3>Back to basics</h3>
<p>Rather worryingly, this is getting quite high on the Google list for &#8220;Category Overload&#8221;. That&#8217;s very flattering, but I wasn&#8217;t expecting so much interest &#8230;<br />
What I was trying to do was to treat different categories of bookmarks / links / blogroll entries in different ways.<br />
Certain categories (Photo Albums, Camera buddies etc.) are shown in the sidebar, while others would appear on the &#8220;Thanks&#8221; page.<br />
I wanted these to be driven by data so far as possible, rather than being hard-coded into the page template. So - if I add a new category into links I want to &#8220;thank&#8221;, I&#8217;d rather just set a flag.<br />
The &#8220;CategoryOverload&#8221; plugin sorted this up to WP 2.3, when the new database structure was introduced.<br />
At this point, link categories were given there own slot in the taxonomy (see the 12th Nov 2007 comment).<br />
Many of the functions which apply to post / page categories were no longer available for link categories - previously, this seems to have been constrained by screens, but now many functions &#8220;cut out&#8221; any entry which isn&#8217;t a &#8220;category&#8221;.</p>
<h3>So how do you use this code, then eh ?</h3>
<p>One of the comments said the documentation was &#8220;a bit vague&#8221; (sorry about that).<br />
Well, this does involve messing around a bit with your theme&#8217;s template pages, and it does involve php and SQL code, so you should understand what you&#8217;re doing.<br />
I&#8217;ve not got into the WordPress development process enough yet to wrap this up as a Plugin, and all of the above isn&#8217;t anything like &#8220;official&#8221; WP code.<br />
But what I&#8217;ve done is to create a template called &#8220;thankslinks.php&#8221;, and plumbed in the above code.<br />
That code selects a set of data which can be iterated and used for standard WP template tags such as wp_list_bookmarks().<br />
My &#8220;Thanks&#8221; page has that template assigned (in the &#8220;Page Template&#8221; tab when you edit the page) and then the code just kinda drops things out &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muttznutz</title>
		<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-200</link>
		<dc:creator>muttznutz</dc:creator>
		<pubDate>Sat, 04 Oct 2008 11:04:12 +0000</pubDate>
		<guid isPermaLink="false">http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-200</guid>
		<description>I'm getting a bit better with this php stuff (as you may see elsewhere) and I've just got around to reworking this code.
I'm up to v2.6.2. of WP now.
This looks up the category based on the "slug", soit's a bit more portable.

[code lang="php"]
 $querystr = "
	SELECT term_id, name
	FROM $wpdb-&gt;terms
	WHERE term_id IN
	(
	SELECT tt.term_id
	FROM $wpdb-&gt;term_taxonomy tt
       left join $wpdb-&gt;terms t
       on tt.parent = t.term_id
	WHERE t.slug = 'links-thanks-etc-etc'
	)
	ORDER BY term_id
  ";
 $linkcats = $wpdb-&gt;get_results($querystr, OBJECT);
[/code]

As an alternative, there's a WordPress function (since 2.3.0) called "get_category_by_slug()". It's not part of the canonical API - so there's no guarantee it'll be there in future releases - but this means you achieve the same results with something like this :

[code lang="php"]
 $parentCat = get_category_by_slug( 'links-thanks-etc-etc' ) ;
 $querystr = "
	SELECT term_id, name
	FROM $wpdb-&gt;terms
	WHERE term_id IN
	(
	SELECT term_id
	FROM $wpdb-&gt;term_taxonomy 
       where parent = '{$parentCat-&gt;term_id}' and taxonomy = 'link_category'
	)
	ORDER BY term_id
  ";
 $linkcats = $wpdb-&gt;get_results($querystr, OBJECT);
[/code]

You can then do something on the lines of this next snippet to process each link category selected 
[code lang="php"]
if ($linkcats) { 
  foreach ($linkcats as $linkcat) { 
    wp_list_bookmarks("category={$linkcat-&gt;term_id}");
    };				
  };
[/code]

While this works fine, the main problem is still that - since the taxonomy change in 2.3 - there's no way of updating the parent category for link categories without delving in at database level.</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting a bit better with this php stuff (as you may see elsewhere) and I&#8217;ve just got around to reworking this code.<br />
I&#8217;m up to v2.6.2. of WP now.<br />
This looks up the category based on the &#8220;slug&#8221;, soit&#8217;s a bit more portable.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$querystr</span> = <span class="st0">&#8220;<br />
&nbsp; &nbsp; &nbsp; &nbsp; SELECT term_id, name<br />
&nbsp; &nbsp; &nbsp; &nbsp; FROM $wpdb-&gt;terms<br />
&nbsp; &nbsp; &nbsp; &nbsp; WHERE term_id IN<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; SELECT tt.term_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; FROM $wpdb-&gt;term_taxonomy tt<br />
&nbsp; &nbsp; &nbsp; &nbsp;left join $wpdb-&gt;terms t<br />
&nbsp; &nbsp; &nbsp; &nbsp;on tt.parent = t.term_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; WHERE t.slug = &#8216;links-thanks-etc-etc&#8217;<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; ORDER BY term_id<br />
&nbsp; &#8220;</span>;<br />
&nbsp;<span class="re0">$linkcats</span> = <span class="re0">$wpdb</span>-&gt;<span class="me1">get_results</span><span class="br0">&#40;</span><span class="re0">$querystr</span>, OBJECT<span class="br0">&#41;</span>;</div>
</div>
<p>As an alternative, there&#8217;s a WordPress function (since 2.3.0) called &#8220;get_category_by_slug()&#8221;. It&#8217;s not part of the canonical API - so there&#8217;s no guarantee it&#8217;ll be there in future releases - but this means you achieve the same results with something like this :</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$parentCat</span> = get_category_by_slug<span class="br0">&#40;</span> <span class="st0">&#8216;links-thanks-etc-etc&#8217;</span> <span class="br0">&#41;</span> ;<br />
&nbsp;<span class="re0">$querystr</span> = <span class="st0">&#8220;<br />
&nbsp; &nbsp; &nbsp; &nbsp; SELECT term_id, name<br />
&nbsp; &nbsp; &nbsp; &nbsp; FROM $wpdb-&gt;terms<br />
&nbsp; &nbsp; &nbsp; &nbsp; WHERE term_id IN<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; SELECT term_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; FROM $wpdb-&gt;term_taxonomy <br />
&nbsp; &nbsp; &nbsp; &nbsp;where parent = &#8216;{$parentCat-&gt;term_id}&#8217; and taxonomy = &#8216;link_category&#8217;<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; ORDER BY term_id<br />
&nbsp; &#8220;</span>;<br />
&nbsp;<span class="re0">$linkcats</span> = <span class="re0">$wpdb</span>-&gt;<span class="me1">get_results</span><span class="br0">&#40;</span><span class="re0">$querystr</span>, OBJECT<span class="br0">&#41;</span>;</div>
</div>
<p>You can then do something on the lines of this next snippet to process each link category selected </p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$linkcats</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$linkcats</span> <span class="kw1">as</span> <span class="re0">$linkcat</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; wp_list_bookmarks<span class="br0">&#40;</span><span class="st0">&#8220;category={$linkcat-&gt;term_id}&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; <span class="br0">&#125;</span>;</div>
</div>
<p>While this works fine, the main problem is still that - since the taxonomy change in 2.3 - there&#8217;s no way of updating the parent category for link categories without delving in at database level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muttznutz</title>
		<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-81</link>
		<dc:creator>muttznutz</dc:creator>
		<pubDate>Mon, 12 Nov 2007 04:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-81</guid>
		<description>&lt;p&gt;I'm just trying to upgrade to Wordpress 2.3.1
Not everything's working too well, but I'm trying to get through the new database structure.

Key point - I've disabled CategoryOverload.
I've hopefully made the code above a bit more compliant (using the $wpdb-&gt; prefix).
Some of the underlying tables have changed, so here's a replacement for the SQL in the 13th May post (which seems to work for me).
[code lang="sql"]
SELECT term_id, name
FROM $wpdb-&gt;terms
WHERE term_id IN
(
   SELECT term_id
   FROM $wpdb-&gt;term_taxonomy
   WHERE parent=6
)
ORDER BY term_id
[/code]
As the 'get_links' tag - used above - is deprecated in WordPress 2.3, I suppose it's probably best if you switch to the wp_list_bookmarks tag instead.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m just trying to upgrade to Wordpress 2.3.1<br />
Not everything&#8217;s working too well, but I&#8217;m trying to get through the new database structure.</p>
<p>Key point - I&#8217;ve disabled CategoryOverload.<br />
I&#8217;ve hopefully made the code above a bit more compliant (using the $wpdb-> prefix).<br />
Some of the underlying tables have changed, so here&#8217;s a replacement for the SQL in the 13th May post (which seems to work for me).</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw1">SELECT</span> term_id, name<br />
<span class="kw1">FROM</span> $wpdb-&gt;terms<br />
<span class="kw1">WHERE</span> term_id <span class="kw1">IN</span><br />
<span class="br0">&#40;</span><br />
&nbsp; &nbsp;<span class="kw1">SELECT</span> term_id<br />
&nbsp; &nbsp;<span class="kw1">FROM</span> $wpdb-&gt;term_taxonomy<br />
&nbsp; &nbsp;<span class="kw1">WHERE</span> parent=<span class="nu0">6</span><br />
<span class="br0">&#41;</span><br />
<span class="kw1">ORDER</span> <span class="kw1">BY</span> term_id</div>
</div>
<p>As the &#8216;get_links&#8217; tag - used above - is deprecated in WordPress 2.3, I suppose it&#8217;s probably best if you switch to the wp_list_bookmarks tag instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muttznutz</title>
		<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-17</link>
		<dc:creator>muttznutz</dc:creator>
		<pubDate>Fri, 25 May 2007 01:10:44 +0000</pubDate>
		<guid isPermaLink="false">http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-17</guid>
		<description>The above code segments still seem to work with WP 2.2</description>
		<content:encoded><![CDATA[<p>The above code segments still seem to work with WP 2.2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muttznutz</title>
		<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-6</link>
		<dc:creator>muttznutz</dc:creator>
		<pubDate>Mon, 21 May 2007 22:11:44 +0000</pubDate>
		<guid isPermaLink="false">http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-6</guid>
		<description>I've also used the &lt;a href="http://txfx.net/2004/05/25/get-comment-count/" rel="nofollow"&gt;Get Comments Count&lt;/a&gt; plugin from Mark Jaquith's Tempus Fugit site. 
It should make posts summaries cleaner, by only highlighting posts where there is a comment.
Here's how I use it in my Category pages :
[code lang="php"]
&lt; ?php if (get_comments_count() &gt; 0) : ?&gt;
    This post has &lt; ?php comments_number(); ?&gt; 
&lt; ?php endif; ?&gt;
[/code]
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve also used the <a href="http://txfx.net/2004/05/25/get-comment-count/" rel="nofollow">Get Comments Count</a> plugin from Mark Jaquith&#8217;s Tempus Fugit site.<br />
It should make posts summaries cleaner, by only highlighting posts where there is a comment.<br />
Here&#8217;s how I use it in my Category pages :</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span> <span class="kw1">if</span> <span class="br0">&#40;</span>get_comments_count<span class="br0">&#40;</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span> : <span class="kw2">?&gt;</span><br />
&nbsp; &nbsp; This post has <span class="kw2">&lt;?php</span> comments_number<span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span> <br />
<span class="kw2">&lt;?php</span> <span class="kw1">endif</span>; <span class="kw2">?&gt;</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: muttznutz</title>
		<link>http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-5</link>
		<dc:creator>muttznutz</dc:creator>
		<pubDate>Sun, 20 May 2007 13:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/2007/05/13#comment-5</guid>
		<description>I had a few problems getting the code to appear properly. My apologies to anyone affected.
So I've installed the &lt;a href="http://blog.hackerforhire.org/2007/03/16/code-snippet-20/" rel="nofollow"&gt;codesnippet plugin&lt;/a&gt; - which "colourises" the code as well. Thanks to those involved.
I've also - hopefully - got the Comments function working as I'd like (if you can see this, then I have).
This is mostly so I can give updates on topics.
I'm afraid I'm not still opening them up in general, however, as I don't have time to moderate all the spam entries.</description>
		<content:encoded><![CDATA[<p>I had a few problems getting the code to appear properly. My apologies to anyone affected.<br />
So I&#8217;ve installed the <a href="http://blog.hackerforhire.org/2007/03/16/code-snippet-20/" rel="nofollow">codesnippet plugin</a> - which &#8220;colourises&#8221; the code as well. Thanks to those involved.<br />
I&#8217;ve also - hopefully - got the Comments function working as I&#8217;d like (if you can see this, then I have).<br />
This is mostly so I can give updates on topics.<br />
I&#8217;m afraid I&#8217;m not still opening them up in general, however, as I don&#8217;t have time to moderate all the spam entries.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
