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

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

0 Members and 2 Guests are viewing this topic.

Offline waleed

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #15 on: May 18, 2005, 11:17:29 PM »
hi.. i want to remove the MOD and i can do that but ..
how can i remove the changes from the phpmyadmin
thanks

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 #16 on: May 19, 2005, 12:08:08 AM »
all you need to remove is cat_image field from 4images_categories table.
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 martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: [MOD] Category Image v1.0.2
« Reply #17 on: July 17, 2005, 12:36:04 PM »
just a little tweak of this great mod:

if you'd like to show the category image smaller, than the thumbnail,
replace the code from step 3 by this:

(includes/functions.php)

Code: [Select]
//cat image
$cat_image = "";
    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);

$file_info = @getimagesize($cat_image);
$dim = 40;
$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 = "<img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\">";
        }
      }
    }
    $site_template->register_vars("cat_image", $cat_image);

//end cat image

and step 4 by:

Code: [Select]
{if cat_image}{cat_image}{endif cat_image}
MAяTRIX


Offline TomYork

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #18 on: August 02, 2005, 07:23:21 AM »
Can I see an example of this mod online?  :oops: :roll:
* La prueba más clara de la sabiduría es una alegría continua...*

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: [MOD] Category Image v1.0.2
« Reply #19 on: August 02, 2005, 12:15:44 PM »
Si.

Just look at V@no's page ;)
MAяTRIX


Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #20 on: October 16, 2005, 12:09:42 AM »
Great MOD and it nearly works  :lol:

It just shows me the adress of the thumb, but not the thumb itself...?

It looks like this:

Code: [Select]
<img src="./data/thumbnails/34/bitte_recht_freundlich.jpg" >Tiere (44) neu

In ACP the Thumb is shown correctly.

Thx for Help!

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 #21 on: October 16, 2005, 12:46:55 AM »
where I can see it in action?
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 Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #22 on: October 16, 2005, 04:02:04 PM »
here:

http://www.amberger-fotogalerie.de

at the first category.

Thx

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 #23 on: October 16, 2005, 09:48:10 PM »
category_bit.html
Quote
     <a href="{cat_url}" class="maincat"> {if cat_image}

 
&lt;img src="{cat_image}" &gt;{endif cat_image}{cat_name}</a>
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 Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Category Image v1.0.2
« Reply #24 on: December 12, 2005, 07:27:13 PM »
Have a littel Modification for this Mod...

Take this Code in Step 3
Quote
      $cat_image = "";
      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);
            }
         }
      }else {
         $cat_image = TEMPLATE_PATH."/images/folder.png";
      }
      $site_template->register_vars("cat_image", $cat_image);
And then it shows the Placeholder (red Code) when there is no Category Image...

Offline yolvy

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #25 on: December 20, 2005, 06:09:41 PM »
Hy V@no I just install this mode and everything work great, but when I go to CP and I try to change the category name or any field show me this message:

DB Error: Bad SQL Query: UPDATE 4images_categories SET cat_name = 'December 05', cat_description = '', cat_parent_id = 0, cat_hits = 0, auth_viewcat = 0, auth_viewimage = 2, auth_download = 2, auth_upload = 2, auth_directupload = 9, auth_vote = 0, auth_sendpostcard = 2, auth_readcomment = 0, auth_postcomment = 2, cat_image = WHERE cat_id = 3
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE cat_id = 3' at line 3
Error editing category


Please help me how fix this ....
-------------------------------------------------------
Yes, I'm a criminal. My crime is that curiosity ...

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Category Image v1.0.2
« Reply #26 on: December 20, 2005, 07:15:45 PM »
reinstall the Mod, i think you have make a mistake... (o:

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 #27 on: December 21, 2005, 12:19:53 AM »
Quote
Step 2
Open admin/categories.php
Find two (2) times:
I'm pretty much sure that's the problem.
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 LucasXavier

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #28 on: December 24, 2005, 11:38:42 PM »
I can't create new categories! You have a fix to this bug?

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 #29 on: December 24, 2005, 11:51:22 PM »
I can't create new categories! You have a fix to this bug?
Restore backups and try again
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)