4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2018, 10:19:51 AM

Login with username, password and session length
Search:     Advanced search
Follow 4images on twitter: Click here to follow!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Templates & Styles (Requests & Discussions) (Moderator: Rembrandt)
| | |-+  Show a thumbnail instead of a folder icon next to category
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 » »» Print
Author Topic: Show a thumbnail instead of a folder icon next to category  (Read 124447 times)
Chris
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4487

Thank You
-Given: 0
-Receive: 31

Did u ever stop to think and then forget to start?


View Profile
« on: March 12, 2005, 10:39:37 PM »

By default, the category_bit.html template displays a folder icon next to categories. It is possible to also display a thumbnail of an image selected at random from that category.

In the category_bit.html template that ships with the downloaded distribution of 4images, there is the following:
1
2
3
4
5
6
7
8
9
10
11
12
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
      <img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />

      <!-- {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}  -->

    </td>
    <td> <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
  </tr>
</table>


As you can see above, there is already HTML that can display a random category image thumbnail. It is simply commented out. To activate the thumbnail, uncomment the HTML. In this example the folder icon HTML is deleted in favor of the image thumbnail.
1
2
3
4
5
6
7
8
9
10
11
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">

      {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}

    </td>
    <td> <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
  </tr>
</table>


Lastly, this feature is enabled by default, but if you previously edited includes/constants.php, check to ensure that the following line is present in that file:
1
define('SHOW_RANDOM_CAT_IMAGE', 1);

Follow members gave a thank to your post:
hammerideas

For this post, 1 member gave a thank you!
Logged

marchchild
Pre-Newbie

Offline Offline

Posts: 9

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #1 on: April 01, 2005, 03:49:25 PM »

Thanks Chris  Very Happy

Is it possible to do this with the categories and/or subcats listings on the homepage?
Logged
jarano
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #2 on: April 12, 2005, 12:30:16 AM »

HI!

Your mod works but it has a little problem, the thumbnail size it's the same that the categories thumbnail. The idea it's to have a small tumbnail before the name of the sub-category something like 60x40 or less, but a thumbnail of 100x75 it's too much. There is any way to put inside the size of the thumbnail? and force to have the same size in all the thumbnails? Thanks!!

Logged
cagedsmurf
Pre-Newbie

Offline Offline

Posts: 4

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #3 on: April 12, 2005, 04:09:10 AM »

Is it Possible to do this with Mantra's Templates as i cant find the code you show here i am using the 4images dark from his site (http://www.mantradream.com) ?

I posted on his forum he told me to post here because he didn't know

Thanks in advance Laughing
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #4 on: April 12, 2005, 04:29:09 AM »

yes, u can.
Logged

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)
Chris
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4487

Thank You
-Given: 0
-Receive: 31

Did u ever stop to think and then forget to start?


View Profile
« Reply #5 on: April 12, 2005, 02:52:18 PM »

Your mod works but it has a little problem, the thumbnail size it's the same that the categories thumbnail.

It's not a mod and there is no problem.  The thumbnail size is working the way it was designed.
Logged

cagedsmurf
Pre-Newbie

Offline Offline

Posts: 4

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #6 on: April 13, 2005, 02:55:39 AM »


Can You Tell Me Where I need To Modify Please Because I cant Find The Code As Shown Above  Question

This All The Code From The 4images_Dark Template catorgory_bit.html  Sorry If I'm Being Blind Embarassed

<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_image_url}/category{cat_id}.gif" border="0" alt="{cat_name}"></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_image_url}/joinbottom.gif"></td>
   <td align="left" valign="top">{sub_cats}</td>
  </tr>
</table>
{endif sub_cats}

Thanks In Advance Smile
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #7 on: April 13, 2005, 03:04:34 AM »

c'mon! just look at the difference between the "seached" code provided and the result code!
Logged

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)
jarano
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #8 on: April 19, 2005, 11:04:26 PM »

Quote  [Expand]
<table border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td valign="top">

      {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}"><width="25" height="33" border="1"></a>{endif random_cat_image_file}

    </td>
    <td> <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
  </tr>
</table>


I did this changes in this code to obtain a small thumbnail with the same size in all the sub-categories.
First of all I added 3 points to "cellpadding" because in the first change I did it was next to the name. This correct the problem and secund I have added width and height as you see in the script and all the thumbnails are axactly the same size taking the pics from the category or sub-category.
Check it here: http://www.celebridadesperuanas.com/galeria

Thank you Chris, you knew what I was looking for but you just told me that this script wasn't a mod, that answer didn't teach me anything, thanks God I could find the answer by myself but...is this the Forum idea? Is this how we share knowledge?...from people who knows very much to people as myself who doesn't know anything?? Thanks anyway...You have create the script and with out it I never could find the solution
Logged
Chris
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4487

Thank You
-Given: 0
-Receive: 31

Did u ever stop to think and then forget to start?


View Profile
« Reply #9 on: April 20, 2005, 03:05:49 AM »

Thank you Chris, you knew what I was looking for but you just told me that this script wasn't a mod, that answer didn't teach me anything, thanks God I could find the answer by myself but...is this the Forum idea? Is this how we share knowledge?...from people who knows very much to people as myself who doesn't know anything?? Thanks anyway...You have create the script and with out it I never could find the solution

Please understand that I'm just a volunteer like the others and did not develop the 4images product.  To my knowledge it belongs to Jan and no one else.  I don't always have time to personally tutor everyone on everything under the sun.  Although I do think I've spent a great deal of time over the last 2 years doing just that...

In this case, the thread simply points out something that can already be done with the existing product and requires no coding changes.  That's all I had time for when I posted it and that's all I intend to do with this thread.

Best wishes.
Logged

jarano
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #10 on: April 21, 2005, 04:05:35 PM »

Hi Chris!
You are right, I am sorry.
Regards
Logged
wiitanen
Pre-Newbie

Offline Offline

Posts: 8

Thank You
-Given: 0
-Receive: 0

Doh - answers are not referrals to general topics!


View Profile WWW
« Reply #11 on: August 09, 2005, 09:29:13 PM »

By default, the category_bit.html template displays a folder icon next to categories. It is possible to also display a thumbnail of an image selected at random from that category.

In the category_bit.html template that ships with the downloaded distribution of 4images, there is the following:
1
2
3
4
5
6
7
8
9
10
11
12
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
      <img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />

      <!-- {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}  -->

    </td>
    <td> <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
  </tr>
</table>


As you can see above, there is already HTML that can display a random category image thumbnail. It is simply commented out. To activate the thumbnail, uncomment the HTML. In this example the folder icon HTML is deleted in favor of the image thumbnail.
1
2
3
4
5
6
7
8
9
10
11
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">

      {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}

    </td>
    <td> <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
  </tr>
</table>


Lastly, this feature is enabled by default, but if you previously edited includes/constants.php, check to ensure that the following line is present in that file:
1
define('SHOW_RANDOM_CAT_IMAGE', 1);

OK - so... removing the 'Comment Out' gives me code that still shows the folder icon AND the random image. I changed the code to the following:

<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
     <img src="{template_url}/images/folder.gif" width="20" height="13" alt="" border="0" />
      {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" width="20" height="13" border="0"></a>{endif random_cat_image_file}
    </td>
    <td>
     <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}
   </td>
  </tr>
</table>
{if cat_description}<span class="smalltext">{cat_description}</span><br />{endif cat_description}
{if sub_cats}{sub_cats}{endif sub_cats}


It would be nice if the random image icon would show up without the folder, and only show the folder if no random image was found.  I just can't see where this is done.
Logged
TheOracle
Guest
« Reply #12 on: August 09, 2005, 10:11:37 PM »

Quote  [Expand]

It would be nice if the random image icon would show up without the folder, and only show the folder if no random image was found.  I just can't see where this is done.


With the EXIF MOD, it would be easier to convert

this line :

Quote  [Expand]

<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />


into :

1
2
3

{ifno random_cat_image_file}<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />{endifno random_cat_image_file}


From there, it would even be much easier, for you, to customize this line rather than modifying a whole paragraph in order to replace a folder icon into a thumbnail presentation. Wink
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #13 on: August 10, 2005, 12:20:39 AM »

1
2
3

{ifno random_cat_image_file}<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />{endifno random_cat_image_file}


From there, it would even be much easier, for you, to customize this line rather than modifying a whole paragraph in order to replace a folder icon into a thumbnail presentation. Wink
please note, for this to work u'll need install "{ifno blah}...{endifno blah}" mod/fix (try FAQ) Wink
Logged

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)
TheOracle
Guest
« Reply #14 on: August 10, 2005, 12:33:49 AM »

Correction of the name - added with the URL this time :

http://www.4homepages.de/forum/index.php?topic=7493.0

Follow members gave a thank to your post:
visionpakhsh

For this post, 1 member gave a thank you!
Logged
Pages: [1] 2 3 4 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.204 seconds with 22 queries.