• [Style] Static icons in the Category frame 5 0 5 1
Currently:  

Author Topic: [Style] Static icons in the Category frame  (Read 74034 times)

0 Members and 1 Guest are viewing this topic.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Style] Static icons in the Category frame
« on: January 14, 2003, 10:10:23 AM »
I've got a number of emails asking how to add static icons in the Category frame. Below is my solution:

- Create icons for each category and name them category[cat_id].gif, for example category1.gif, category2.gif, etc.
This is according to your taste, of course. I'm using 40x40 gif's like this:

- Create the image joinbottom.gif for sub-categories or use mine:

- Place them all into /templates/xxxx/images/ folder (or /templates/xxxx/images_lang/ if you are using multiple languages)

- Change your /templates/xxxx/category_bit.html as follows:

Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
<td width="50" rowspan="2" align="center" valign="top">
<a href="{cat_url}"><img src="{template_lang_image_url}/category{cat_id}.gif" border="1"></a></td>
<td align="left" valign="top"><a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})</td>
  </tr>
  <tr>
<td align="left" valign="top">{if cat_description}<span class="smalltext">{cat_description}</span><br />{endif cat_description}</td>
  </tr>
</table>
{if sub_cats}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
<td width="50" align="center" valign="top"><img src="{template_lang_image_url}/joinbottom.gif"></td>
<td align="left" valign="top">{sub_cats}</td>
  </tr>
</table>
{endif sub_cats}

- If you do not use multiple languages, change {template_lang_image_url} to {template_image_url}

That's it! Demo at http://faces.dalnet.ru/index.php?l=english
« Last Edit: June 04, 2010, 06:42:27 PM by Rembrandt »

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Static icons in the Category frame
« Reply #1 on: February 21, 2003, 02:00:20 AM »
VERY nice.. my only question is how do I get it so the text isn't so close to the images?

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Static icons in the Category frame
« Reply #2 on: February 21, 2003, 02:01:22 AM »
ah, nevermind, just figured it out.. great mod!

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Static icons in the Category frame
« Reply #3 on: February 21, 2003, 02:27:46 AM »
ok now I got a problem..

Now my links are messed up, there trying to go to http://www.madfunny.com/{cat_url}

any ideas?

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Static icons in the Category frame
« Reply #4 on: February 21, 2003, 02:33:39 AM »
hmm, weird figured it out, I took the original <a href..... from another template and it works fine not. :idea:

Offline Amosnet

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • Bilder verkaufen
Static icons in the Category frame
« Reply #5 on: March 10, 2003, 11:40:11 PM »
Would be great if you can give me a idea how i impiment it into
the External Random Image from:
http://www.4homepages.de/forum/viewtopic.php?p=19135#19135

Thanks
I love 4images! http://www.fotos-verkaufen.de Fotos verkaufen online Tips und Tricks und http://www.fotoskaufen.de

Offline Fuztug

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Static icons in the Category frame
« Reply #6 on: June 22, 2003, 10:01:14 AM »
How do I do it, that it will only show 1 Catimage not category1, category2, category3, categoryn ?

EDIT:
Thx, I figured it myself out!

Thx, Fuz

Offline Fuztug

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Static icons in the Category frame
« Reply #7 on: June 22, 2003, 10:07:20 AM »
Hello,
it's me again!

What I do miss is that these subcategories are listed one by one. But I want it, like V@no @ gallery.vano.org, mutual.

How do I do this?

Thx, Fut
« Last Edit: March 16, 2005, 12:08:19 AM by V@no »

Offline RuthE

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Discover Kate Gallery
Re: Static icons in the Category frame
« Reply #8 on: June 14, 2005, 12:46:10 AM »
I don't wish to have images for every category. As I have 500+, is it possible to only have them where there are images? Can the clause be written 'if there is an image' then display it? I'm clueless about code, but I like how this mod works.

Offline Cottelletje

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: Static icons in the Category frame
« Reply #9 on: September 05, 2005, 03:25:09 PM »
ah, nevermind, just figured it out.. great mod!

how did you do it i have the same problem?

Offline .real

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: Static icons in the Category frame
« Reply #10 on: September 29, 2005, 10:35:28 PM »
hey thats great, but i have over 200 categorys...
i just need about 12 icons...i get a red x at the other categories. how do i change that? :?


 :arrow: http://aaliyahlegacy.aa.funpic.de/4images/index.php

Offline wydmuch

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • High-End picture gallery
Re: Static icons in the Category frame
« Reply #11 on: December 27, 2005, 08:16:19 PM »
Great mod. It works as expected.
Luckily I only have 42 categories so far and not too much work creating those thumbs.
http://www.wydmuch.de/4images/index.php
It really improved the whole layout of the page, I think  :)

But I still have to do a lot...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Static icons in the Category frame
« Reply #12 on: December 28, 2005, 02:58:36 AM »
hey thats great, but i have over 200 categorys...
i just need about 12 icons...i get a red x at the other categories. how do i change that? :?


 :arrow: http://aaliyahlegacy.aa.funpic.de/4images/index.php
Asuming you have allowed php execution in templates (controled by includes/constants.php)
Then try use in the template something like this:
Code: [Select]
<?php
$icon 
"folder.gif";
if (
in_array($this->val_cache['cat_id'], array(1,2,3,4)))
{
  $icon "category".val_cache['cat_id'].".gif";
}
echo 
"<a href=\"".$this->val_cache['cat_url']."\"><img src=\"".$this->val_cache['template_lang_image_url']."/".$icon."\" border=\"1\"></a>";
?>
Replace 1,2,3,4 with the categorie's IDs which you wish to be displayed with the custom icon.
folder.gif image will be used for the categories not from that list

P.S. make sure there is nothing on the same line with <?php and ?> not even a space!

P.P.S. I have not tested this code and typed it directly in the browser, so there is a possibility of an error... :oops:
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kandah

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: Static icons in the Category frame
« Reply #13 on: January 19, 2006, 12:18:35 PM »
Descent solution!

Offline leedzinh

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Static icons in the Category frame
« Reply #14 on: March 12, 2006, 05:55:10 PM »
great MOD. My gallery is nicer. My members can choose baby through icon now! You can see in sub-cat at http://www.3xland.com  :wink:
thanks SLL so much!