• [MOD] Category Image v1.0.2 4 0 5 1
Currently:  

Author Topic: [MOD] Category Image v1.0.2  (Read 379357 times)

0 Members and 1 Guest are viewing this topic.

Offline blondl

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #120 on: October 03, 2006, 07:57:29 PM »
Hey V@no,

step 2.2 in the find-string "cat_order = $cat_order," is missing for V1.7.3.
same in the replace-string, too.


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: [MOD] Category Image v1.0.2
« Reply #121 on: October 03, 2006, 08:17:24 PM »
step 2.2? there is nothing about cat_order in step 2.2 :?
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 blondl

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #122 on: October 03, 2006, 08:22:44 PM »
step 2.2? there is nothing about cat_order in step 2.2 :?

This is what I said  :wink:

In the source of V1.7.3 is cat_order included, not in the mod



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: [MOD] Category Image v1.0.2
« Reply #123 on: October 03, 2006, 09:26:37 PM »
Got it. thanks.
I've update that step for v1.7.3
;)
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 blondl

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #124 on: October 04, 2006, 06:44:41 AM »
Hey V@no!

Agian...

Step 2.5 occors two times in V1.7.3. Am I right to change both?


btw. Is there a simple way to resize the thumbs according to their format? that means not only a width and heigth satatment. I'm seeking for a solution for landscape and portrait orientation.

and second, how can I get thumbs for the subcats in the startscreen, too?
« Last Edit: October 04, 2006, 07:52:06 AM by blondl »

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: [MOD] Category Image v1.0.2
« Reply #125 on: October 04, 2006, 08:22:28 AM »
Yes, both lines.

sorry, I cant help with further developing the mods untill I get my server back...
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 dave

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #126 on: October 05, 2006, 09:10:35 PM »
@V@no:
Great Mod! :D

But the instructions are a bit misunderstanding, as I thought step 1 would be only necessary for versions 1.7 and 1.7.1.
I had just updated to version 1.7.3 and thus followed only explicit instructions for version 1.7.3... :wink:

Offline blondl

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #127 on: October 18, 2006, 10:48:26 AM »
btw. Is there a simple way to resize the thumbs according to their format? that means not only a width and heigth satatment. I'm seeking for a solution for landscape and portrait orientation.

To answer my own question:

Yes, there is a very simple way...

If you want to see a demo, look here: http://galerie.blondl.net

In the first posting of this thread v@no made a step 3, were he altered includes/functions.php.

If you insert this code below, instead of v@nos code, you will get the thumbs recalculate, not resized, and with correct orietation.
This code is not invented by me, its v@nos code from an other file inserted here with two or three lines added.

Here is the code:
Code: [Select]
    $cat_image = "";
    $cat_image_id = 0;
   
    if ($cat_cache[$category_id]['cat_image'])
    {
      $sql = "SELECT image_id, image_media_file, image_thumb_file, cat_id
              FROM ".IMAGES_TABLE."
              WHERE image_id = ".$cat_cache[$category_id]['cat_image'];
      if ($image_row = $site_db->query_firstrow($sql))
      {
        if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
        {
          $cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
        }
        else
        {
          $cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
          $cat_image_id = $image_row['image_id'];
        }

$file_info = @getimagesize($cat_image);
      $dim = 50;
      $width = $file_info[0];
      $height = $file_info[1];
      if ($width && $height) {
        if ($width > $dim || $height > $dim) {
          @$ratio = $width / $height;
          if ($ratio > 1) {
            $new_width = $dim;
            $new_height = round(($dim/$width) * $height);
          }else {
            $new_width = round(($dim/$height) * $width);
            $new_height = $dim;
          }
        }else{
          $new_width = $width;
          $new_height = $height;
        }
      }else{
        $new_width = $dim;
        $new_height = $dim;
      }
$cat_image = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$cat_image_id)."\" target=\"_blank\"><img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\"></a>&nbsp";
      }
    }
    $site_template->register_vars("cat_image", $cat_image);


@v@no:
feel free to add this mod of your mod if you want.  :wink:

Offline Kane

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #128 on: October 24, 2006, 02:42:00 AM »
u dont need this mod, just uncomment
Code: [Select]
      <!-- {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}  --> in category_bit.html template.

I've wanted this for a long time and never knew it was so easy.

Offline LeeWicKeD

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #129 on: October 28, 2006, 09:45:53 PM »
I have a problem installind this mod for 1.7.4...

I can edit a category and enter a IMAGE ID which should be displayed as category image, but it doesn't saves the number i entered. When I press "SAVE" and edit the same category again there is always entered a "0".

 :(

Offline jimraynor

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #130 on: January 02, 2007, 04:51:44 AM »
i am using 1.7.4 versiyon. How can i do category icons. Otherwise this versiyon have that?

Offline alemao59

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #131 on: January 05, 2007, 11:58:45 PM »
hi,
this mod seems to b great and i would like to use it. where do i get the files to install it? help would be appreciated. Thanks

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #132 on: January 06, 2007, 02:17:12 AM »
The install file is attached to the main post from V@no at the bottom by his signature.

Offline alemao59

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #133 on: January 06, 2007, 06:33:07 PM »
thanks

Offline Ricsca

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #134 on: January 11, 2007, 02:16:02 AM »
If in the category it comes put a description, the image it is not visualized...  Why?