Balkhis - Vision For Success

phpLD Category Icon Mod

Dear Readers, I would like to thank you for reading this post. I highly value your feedback and would like to know more about my readers. Follow me on Twitter

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.

Category 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.



To stay updated with the blog, please consider subscribing to my full feed RSS. You can also subscribe by Email and have new posts sent directly to your inbox. I hate spam as well, so I promise you that you will not be spammed.
Add to Social Bookmarks:
Add this Article to Digg Add this Article to Stumbleupon Add this Article to Del.icio.us Add this Article to Reddit Add this Article to Newsvine Add this Article to Technorati

RSS feed

53 Comments

2008-03-27 12:07:12

[...] 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 [...]


 
Comment by Ilyas
2008-03-27 12:12:32

Very nice one syed. A very helpful tutorial :D


 
Comment by meethere
2008-03-27 12:30:26

Thanks for a wonderful tutorial.
It will help many dir owners. :)


Comment by Syed Balkhi
2008-03-27 12:46:10

thanks meethere.. Yes that was my motive when I created this template.


 
 
2008-03-27 12:41:23

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.


Comment by Syed Balkhi
2008-03-27 12:45:48

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 ;)


 
 
2008-03-27 13:12:20

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?


Comment by Syed Balkhi
2008-03-27 13:49:47

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 ;)


 
 
Comment by Authority Directory
2008-03-28 00:04:28

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.


Comment by Syed Balkhi
2008-03-28 00:27:42

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.


 
 
Comment by Chetan
2008-03-28 13:26:38

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


Comment by Syed Balkhi
2008-03-28 14:19:45

lol yeah that was the goal of this mod :p To make it available for all.


Comment by Chetan
2008-03-28 22:16:57

But i paid for it.. you cheating on it :mad: lol :D
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 :)

(Comments wont nest below this level)

Comment by Syed Balkhi
2008-03-29 00:08:09

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


 
 
 
 
Comment by Squeaky
2008-03-28 20:57:00

Nice mod and is very easy to do. Does add more class to a person’s directory, that is for sure.


 
Comment by Dr. Teeth
2008-03-30 18:32:34

I was thinking of hiring a coder this week, lol thats my bonus.
Thanks a ton


Comment by Syed Balkhi
2008-03-30 19:55:27

my pleasure :) Saved you some bucks hehe


 
 
2008-04-02 23:52:34

[...] 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 [...]


 
Comment by mark123
2008-04-09 06:09:46

Great job syed!! thanks
I used it to my directory


 
Comment by Genious
2008-05-05 13:47:40

thanks syed, its really cool man.

i love it.

cheers.
mahmood


 
Comment by maxo Subscribed to comments via email
2008-05-17 14:46:56

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


Comment by Syed Balkhi
2008-05-17 21:43:56

May I ask which version are you using ?


 
 
Comment by maxo Subscribed to comments via email
2008-05-19 03:16:08

am using the last version 3.3.0
thank you for your reply
Maxo


Comment by Syed Balkhi
2008-05-19 04:29:09

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


 
 
Comment by maxo Subscribed to comments via email
2008-05-19 05:13:39

Oh you are right lol
thanks ;)
Maxo


 
Comment by sorin
2008-05-20 06:21:42

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


Comment by Syed Balkhi
2008-05-20 06:25:11

I have no idea what you just said. Please give me a visual, or explain what you want clearly. Thanks


 
 
Comment by sorin
2008-05-20 06:52:06

ok, you can see here http://www.gootraffic.com


Comment by Syed Balkhi
2008-05-20 07:58:17

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.


 
 
Comment by sorin
2008-05-20 08:20:50

sorry, i replace but the same problem


Comment by Syed Balkhi
2008-05-20 09:37:03

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..


 
 
Comment by sorin
2008-05-20 09:40:07

oki, i will try again, thanks


 
Comment by sorin
2008-05-20 12:19:44

i install again the script, the templates but the same problem, i don t understand what is wrong… ~x(


Comment by Syed Balkhi
2008-05-20 19:35:43

I don’t understand what is wrong either…


 
 
Comment by Blog Top Ranks
2008-06-02 00:40:04

Just Perfect tips, I was implemented this tips with some mods ;)


 
Comment by Rakhshinda
2008-06-18 14:21:04

Good tutorial, keep it up syed..


 
Comment by Angad Sodhi
2008-06-18 23:49:29

Nice tut syed. Nice icons is what separated a good directory from the rest


 
2008-07-06 23:55:34

[...] Demo Download [...]


 
Comment by dizin
2008-09-09 16:05:25

its very good project.


 
Comment by Free Directories
2008-09-13 13:00:52

I’ve wanted to add icons to my dir for a while. Unfortunately my template won’t really allow it since space is limited. But I will take a look at this. I might be able to find a way to make it work. :)


 
Comment by facepark
2008-12-04 10:21:17

Awesome mod to improve my design. I’m just implementing it to my directory.
Thank you Syed.


 
Comment by Tatil Yerleri
2008-12-28 07:26:54

Nice mod and is very easy to do. Does add more class to a person’s directory, that is for sure.


 
Comment by Joseph
2008-12-28 19:54:11

Syed Balkhi, thank you for your tut. It’s easy to do it.
It’s a showcase of sites using this mod, A Quality Link Directory.


 
Comment by Mark Mclean Subscribed to comments via email
2009-01-07 04:17:44

Does this cat image mod work in 2.2


Comment by Syed Balkhi
2009-01-07 07:43:37

It should work.


 
 
Comment by Mark Mclean Subscribed to comments via email
2009-01-07 08:09:47

But this code isn’t in 2.2

[code]{$cat.TITLE|escape}{if $smarty.const.CATS_COUNT} ({$cat.COUNT}){/if}[/code]


 
Comment by Mark Mclean Subscribed to comments via email
2009-01-07 08:11:53

Sorry, i mean this code for main.tpl edit

{$cat.TITLE|escape}{if $smarty.const.CATS_COUNT} ({$cat.COUNT}){/if}


 
Comment by Kojak Subscribed to comments via email
2009-02-12 13:20:40

Hi Syed. This doesnt work on 3.4.0 version of phpld.. Can you kindly update you tutorial..?

Thanks!


Comment by Syed Balkhi
2009-02-12 13:51:20

I haven’t gotten a chance to look at phpLD 3.4 as I have set aside from the development of phpLD. Due to my lack of interest in directories and development of phpLD I will not be upgrading this plugin.

So sorry for that. I am pretty sure phpLD would come out with a tutorial and implement this in their script like they have done to a lot of other tutorials.


 
 
Comment by Kojak Subscribed to comments via email
2009-02-12 15:28:03

Thanks for the reply syed. I just tried it again and it works now! Its still the same in this new version just a little tweak (because they change some of the code structure) and you will get it.

Heres another demo Health Directory Since the demo is down.

Regards,
Kojak


Comment by Syed Balkhi
2009-02-12 16:42:54

O great to know that it works. Thanks for the demo :) Wish you best of luck.


 
 
Comment by En Leon Guanajuato
2009-05-29 18:37:14

Indeed a very helpful tip. Thanks for sharing it.


 
Comment by Links aanmelden
2009-06-01 03:47:22

Thanks for this tutorial!


 

Sorry, the comment form is closed at this time.

Subscribe to Balkhis via RSS
Subscribe to Balkhis via Email Pimp My Blog