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

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

0 Members and 1 Guest are viewing this topic.

Offline emilio

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Static icons in the Category frame
« Reply #15 on: April 07, 2006, 11:43:03 AM »
hi V@no

this code in which file I must put it?

<?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>";
?>


do you have had time to prove it to know if it works?

thanks man

saludos
emilio

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Static icons in the Category frame
« Reply #16 on: April 07, 2006, 02:28:47 PM »
in category_bit.html template
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 emilio

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Static icons in the Category frame
« Reply #17 on: April 07, 2006, 05:12:38 PM »
hola V@no

I´am sorry. I can´t do it, could you help me please?

this is the code of my category_bit.html:

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">&nbsp;</td>
 </tr>
</table>

thanks

saludos
emilio

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Static icons in the Category frame
« Reply #18 on: April 07, 2006, 11:56:00 PM »
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50" rowspan="2" align="center" valign="top">
<?php
$icon 
"folder.gif";
if (
in_array($this->val_cache['cat_id'], array(1,2,3,4)))
{
  
$icon "category".$this->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>";
?>

</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">&nbsp;</td>
</tr>
</table>
« Last Edit: April 08, 2006, 12:27:42 AM by V@no »
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 emilio

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Static icons in the Category frame
« Reply #19 on: April 08, 2006, 12:18:18 AM »
hi V@no

I´m sorry, I know that I insist much  :oops:

in my includes/constants.php I have this:

// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 1);


this is ok.

but when put your code in category_bit.html, I see this:

Parse error: parse error in c:\appserv\www\comprar\includes\template.php(101) : eval()'d code on line 8

saludos
emilio


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Static icons in the Category frame
« Reply #20 on: April 08, 2006, 12:27:53 AM »
fixed now ;)
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 Kane

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Static icons in the Category frame
« Reply #21 on: October 24, 2006, 02:41:21 AM »
Thanks! This is exactly what I needed.

Offline gustav

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Static icons in the Category frame
« Reply #22 on: December 18, 2006, 05:07:09 PM »
Vano.... can't you alter your code so, that it just shows the default folder icon if no dedicated icon for the specific category can be found? To avoid the need of filling the array with all the categories that should show a custom icon.....

Quote
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>";
?>

Offline mohrth

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: Static icons in the Category frame
« Reply #23 on: January 08, 2007, 05:17:09 PM »
Hi! V@no

Kann man den Code so umstellen das nicht das Bild UND das folder.gif kommt.
Wenn ich die Kategorien ausblenden will, bei denen das folder.gif NICHT erscheinen soll, dann kommt das von mir erstellte Bild doppelt!

Hier ist mein Code im Moment:

Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
<td width="70" rowspan="2" align="center" valign="top">

<?php
$icon 
"folder.gif";
if (
in_array($this->val_cache['cat_id'], array()))
{
  
$icon "category".$this->val_cache['cat_id'].".gif";
}
echo 
"<a href=\"".$this->val_cache['cat_url']."\"><img src=\"".$this->val_cache['template_image_url']."/".$icon."\" border=\"1\"></a>";
?>


<a href="{cat_url}"><img src="{template_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>
 <td>
{if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}
  </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_image_url}/joinbottom.gif"></td>
<td align="left" valign="top">{sub_cats}</td>
  </tr>
</table>
{endif sub_cats}

Hier ein Bild:

Offline mohrth

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: Static icons in the Category frame
« Reply #24 on: January 09, 2007, 02:08:29 PM »
Hi! V@no

Kann man den Code so umstellen das nicht das Bild UND das folder.gif kommt.
Wenn ich die Kategorien ausblenden will, bei denen das folder.gif NICHT erscheinen soll, dann kommt das von mir erstellte Bild doppelt!


Ok...hab das Problem selber gelöst....Hab den Code von ersten Autor noch mitübernommen => deswegen doppelt.
Code: [Select]
<a href="{cat_url}"><img src="{template_image_url}/category{cat_id}.gif" border="1"></a>Wenn der ausgeklammert oder gelöscht wird und in in den "()))" die category ID reingeschrieben wird die ein selber erstelltes Bild besitzen,
dann funktioniert das alles wunderbar!

Hier mein aktueller Code:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
<td width="70" rowspan="2" align="center" valign="top">


<?php
$icon 
"folder.gif";
if (
in_array($this->val_cache['cat_id'], array(22,23,24,28,25,4,45,48,69,74,75,85,98,99,103,112,6,7,8,55,92,93,90,95,96,100,94,101,11,76,77,78,79,80,12,13,14,15,56,
100,106,110,109,17,18,19,104,105,32,34,35,40,89,27,26,29,46,49,51,82,87,91,102,111,113,43,44,63,72,1,5,10,16,30,37,53,70,41,71)))
{
  
$icon "category".$this->val_cache['cat_id'].".gif";
}
echo 
"<a href=\"".$this->val_cache['cat_url']."\"><img src=\"".$this->val_cache['template_image_url']."/".$icon."\" border=\"1\"></a>";
?>


</td>

<td align="left" valign="top"><a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})</td>
 
<td>
{if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}
  </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_image_url}/joinbottom.gif"></td>
<td align="left" valign="top">{sub_cats}</td>
  </tr>
</table>
{endif sub_cats}

Offline thejflo

  • Pre-Newbie
  • Posts: 4
    • View Profile
    • Juicy Flawless
Re: Static icons in the Category frame
« Reply #25 on: October 28, 2008, 03:07:18 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

I have that problem but I couldn't figure it out. Can someone show me how I all the rest of category2, category3, etc. to show?

edit. heh, figured it out myself.

thanks.
« Last Edit: October 28, 2008, 03:18:36 AM by thejflo »

Offline camera

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: Static icons in the Category frame
« Reply #26 on: October 29, 2008, 04:29:56 PM »
Great mod. It works as expected.