phpLD Category Icon Mod
Alright Directory owners, after a long time I am writing some tutorial for directory owners and It feels great. For those who are wondering what a category Icon mod is, It is a mod that allows the user to display unique icons next to main categories on the homepage. A display of that can be seen at my template called Areebu Theme. This is available for Download in my freebies section.
Let me begin with where I got the Idea to work on this mod. There was a thread started on Digitalpoint forum by a member asking for the category icon mod. Shabu, aka Vegabond on the forum replied with a link to phpLD Forum thread which contains the codes.
Now all I did was use the smarty tags to show the images for only the homepage categories and show a default icon for the rest of the subcategories. To do this method you will have to get the category ID for all your main categories. You can find it by simply logging into your Directory Admin Panel, and than going to the categories section.
Simply look for the categories that have Top tag for their parent id, and bring your mouse over. Look in your status bar, and it will show the Cat ID.

Now download any .png Icon at the size you desire but make sure that all of those have same size. I prefer 48 x 48 px, and also for your sub categories in inner pages pick an icon with the dimensions of 16×16 px and name icon.png
Say you have 16 top categories, so get 16 icons and name them each according to their category.
So for example the icon for Art’s name will be 1.png
Upload them to your template’s image folder. Then open main.tpl
Locate:
<a href="{$smarty.const.DOC_ROOT}/{$cat.CACHE_URL|escape}" title="{$cat.TITLE|escape}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}
Replace it with:
{if $category.ID eq 0}<img src="{$smarty.const.FULL_TEMPLATE_PATH}/images/{$cat.ID}.png" border="0" alt="{$cat.TITLE}" align="left" style="margin-right: 10px; margin-top: 5px; margin-bottom: 5px;" />
{else}
<img src="{$smarty.const.FULL_TEMPLATE_PATH}/images/icon.png" border="0" alt="" style="margin-right: 2px;" />{/if}<a href="{$smarty.const.DOC_ROOT}/{$cat.CACHE_URL|escape}" title="{$cat.TITLE|escape}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}
This code will add unique icons next to appropriate main categories, and add a default icon to all the subcategories in the inner page.
This mod does require some work, but It is worth it. If you are not willing to work and don’t want the hassle. Rob aka An0n have a better version of this mod because his version have a backend also, so all of the main.tpl stuff can easily be modified through admin panel. He also offers very good customer service support, so If you have the cash and no time, than I will definately recommend him.
I hope this helped alot of those who were eagerly wanting this mod.
Show me some support and digg this topic as well as add it in other social bookmarks.









Mar 27, 2008















[...] ID = 1 than you have to name the icon for at 1.png To find the codes and instructions Read the full tutorial. Once again this mod does not have any backend admin panel. All are done in the main.tpl. If you [...]
Very nice one syed. A very helpful tutorial
Thanks for a wonderful tutorial.
It will help many dir owners.
thanks meethere.. Yes that was my motive when I created this template.
Syed,
I am going to start a blog, and I was wondering if you could give me a step by step to do list. Like 1. buy domain 2. get it hosted 3. get a word press theme 4. set up affiliates??? But can you email me this list please? paul@newhomessection.com
I also know that you are a big fan of John Chow so I found this video of him that I think you will enjoy http://theuniversitykid.com/ you will have to scroll down just a little to see it.
sure I will send you the email in a bit .. that video was fun … I am not a big fan of Chow but have to say he is doing good with his blog
Thank you for the future email. I thought you were but just cause you are a visitor doesn’t mean that you are his biggest fan. Can I ask what is your favorite site?
hmmm.. That is too hard of a question to just say it in public like that … Maybe if I ever give out an interview and I was asked the question I will give it out
Oh Syed we all know your favorite site is the A.D.
Great post by the way - I am not looking to add the icons but you made it easy enough to follow that I think I could if I wanted to.
ofcourse Bruce
lol
Glad you like the tutorial though
My goal is that people can do stuff by themselves and won’t need to go to all different places to get things done.
Great post Syed..
I thought only my directory apart from other few are going to have the icons on homepage.
But now you opened it for all :p
lol yeah that was the goal of this mod :p To make it available for all.
But i paid for it.. you cheating on it
lol 

Anyways it would just be a great step for directory owners for those who decide to use it, as the directory would look more decent with icons on the home page
if it was my premium mod it would never go paid but I bet your one is much more nicer because you have admin panel control :p
Nice mod and is very easy to do. Does add more class to a person’s directory, that is for sure.
I was thinking of hiring a coder this week, lol thats my bonus.
Thanks a ton
my pleasure
Saved you some bucks hehe
[...] included and installed with it. The Category Icon Mod can be previewed here and can be downloaded here. This template is released on behalf of Balkhis Inc. and it has been designed by Uzzz [...]
Great job syed!! thanks
I used it to my directory
thanks syed, its really cool man.
i love it.
cheers.
mahmood
Hi
I have a small problem, my template doesn’t show the same code you mentioned above. Am using the default Professional template of PHPLD and in main.tpl i have the following code :
{* Display subcategories *}
{if !empty($cat.SUBCATS)}
{foreach from=$cat.SUBCATS item=scat name=scategs}
{$scat.TITLE|escape}, {/foreach} …
{/if}
{if ($smarty.foreach.categs.iteration mod $cats_per_col eq 0 and $cats_per_col gt 1) or $smarty.foreach.categs.last}{/if}
{/foreach}
{/if}
{if $smarty.const.FTR_ENABLE == 1 and !empty($feat_links)}
{l}Meilleurs Sites{/l}
{foreach from=$feat_links item=link name=links}
{include file=”link.tpl” link=$link}
{/foreach}
{/if}
Any change your recommend ?
Thanks for your advice
Maxo
May I ask which version are you using ?
am using the last version 3.3.0
thank you for your reply
Maxo
you are looking at the wrong area … those are the top categories that have icons not the sub categories. The codes you have posted are for subcategories.
look above the codes and you will find these
Oh you are right lol
thanks
Maxo
Hello, i have a little problem, i install your beatiful template, the icon is diplay but the problem is how display the categories in the front page. Is not vertical and orizontal.
Like this:
*** ***
*** ***
*** ***
is is this mode
*** ***
*** ***
*** ***
Please help me.
Thanks
I have no idea what you just said. Please give me a visual, or explain what you want clearly. Thanks
ok, you can see here http://www.gootraffic.com
this template had built in mod, so you had to remove one of the td tag or tr tag for this mess to occur. Please replace the current main.tpl with the original main.tpl and It will fix it self.
sorry, i replace but the same problem
http://www.areebu.balkhis.com/
this is the demo which is using the exact same files, so if you are using the exact same files than you shouldn’t be having this problem.
http://www.balkhis.com/downloads/areebu.zip
Download the template with the link I put above..
oki, i will try again, thanks
i install again the script, the templates but the same problem, i don t understand what is wrong… ~x(
I don’t understand what is wrong either…
Just Perfect tips, I was implemented this tips with some mods
Good tutorial, keep it up syed..
Nice tut syed. Nice icons is what separated a good directory from the rest