<?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>indexu.com &#187; category list</title>
	<atom:link href="http://www.indexu.com/tag/category-list/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indexu.com</link>
	<description>developer blog</description>
	<lastBuildDate>Wed, 30 Jun 2010 05:06:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Custom category listing in browse.html</title>
		<link>http://www.indexu.com/custom-category-listing-in-browse-html/</link>
		<comments>http://www.indexu.com/custom-category-listing-in-browse-html/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 00:13:02 +0000</pubDate>
		<dc:creator>dody</dc:creator>
				<category><![CDATA[Templates]]></category>
		<category><![CDATA[category list]]></category>

		<guid isPermaLink="false">http://www.indexu.com/?p=52</guid>
		<description><![CDATA[In earlier post, I show you how to create custom category listing in front page. Now will show you how to create custom category listing in category pages (browse.html). The real challenge here is to construct the category path as we are deep inside category level. First, you need to remove this tag from browse.html [...]]]></description>
			<content:encoded><![CDATA[<p>In earlier post, I show you how to create custom category listing in front page. Now will show you how to create custom category listing in category pages (browse.html). The real challenge here is to construct the category path as we are deep inside category level.</p>
<p>First, you need to remove this tag from browse.html</p>

<div class="wp_codebox"><table><tr id="p523"><td class="code" id="p52code3"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;%$category%&gt;</span></pre></td></tr></table></div>

<p>Then replace with the following codes</p>

<div class="wp_codebox"><table><tr id="p524"><td class="code" id="p52code4"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;%php%&gt;</span>
  global $dbConn, $indexu, $cat;
&nbsp;
  $img_path = $indexu-&gt;config['site_url'].'/themes/'.$indexu-&gt;config['active_theme'].'/cat';
&nbsp;
  $query = &quot;select category_id, name, image
            from idx_category
            where parent_id = '$cat'&quot;;
  $result = $dbConn-&gt;Execute($query);
&nbsp;
  $limit = $result-&gt;RecordCount();
  $i=0;
&nbsp;
  while ($row = $result-&gt;FetchRow()) {
    $i++;
&nbsp;
    // here we construct the category url, need to fetch the parents
&nbsp;
    $parents = $dbConn-&gt;Lookup('parents', 'idx_category_path', &quot;category_id = '{$row['category_id']}'&quot;);
    $arr = explode(';',$parents);
    array_pop($arr);
    array_pop($arr);
    array_shift($arr);
    array_reverse($arr);
&nbsp;
    unset($path);
&nbsp;
    foreach ($arr as $k =&gt; $v) {
      $name = $dbConn-&gt;Lookup('name', 'idx_category', &quot;category_id = '$v'&quot;);
      $path .= SEOReplace($name).'/';
    }
&nbsp;
    $url = $path.SEOReplace($row['name']).'/';
    print &quot;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'subList'</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'$url'</span>&gt;</span>{$row['name']}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span> \n&quot;;
  }
<span style="color: #009900;">&lt;%<span style="color: #66cc66;">/</span>php%&gt;</span></pre></td></tr></table></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.indexu.com/custom-category-listing-in-browse-html/&amp;n=Custom+category+listing+in+browse.html&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.indexu.com/custom-category-listing-in-browse-html/&amp;title=Custom+category+listing+in+browse.html" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.indexu.com/custom-category-listing-in-browse-html/&amp;t=Custom+category+listing+in+browse.html" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.indexu.com/custom-category-listing-in-browse-html/&amp;title=Custom+category+listing+in+browse.html" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-squidoo">
			<a href="http://www.squidoo.com/lensmaster/bookmark?http://www.indexu.com/custom-category-listing-in-browse-html/" rel="nofollow" class="external" title="Add to a lense on Squidoo">Add to a lense on Squidoo</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Custom+category+listing+in+browse.html+-+http://b2l.me/425pu&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.indexu.com/custom-category-listing-in-browse-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

