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

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

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #180 on: October 29, 2007, 12:34:07 PM »
Quote
I don't receive an error now.

And how you clean error message if image ID is no update after change ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Melissa67

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #181 on: October 29, 2007, 02:17:49 PM »
I went through some of the suggestions in the forum and it somehow disappeared but the number just stays the same in the Category Image ID and I don't see any category image either.

This is my coding for admin/categories.php
Quote
// Category image 
  $cat_image = "";
  if ($result['cat_image'])
  {
    $sql = "SELECT image_id, image_media_file, image_thumb_file, image_name, cat_id
            FROM ".IMAGES_TABLE."
            WHERE image_id = ".$result['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 = 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=".$result['cat_image'])."\" target=\"_blank\"><img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\"></a>&nbsp;<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\">".$image_row['image_name']."</a>";
    }
   
  }
  $value = $result['cat_image'];
  if (isset($HTTP_POST_VARS['cat_image'])/* && $value == ""*/) {
    $value = stripslashes($HTTP_POST_VARS['cat_image']);
  }
  echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">Category image</p></td>\n<td><p><input type=\"text\" size=\"5\" name=\"cat_image\" value=\"".$value."\">&nbsp;$cat_image</p></td>\n</tr>\n";
//End Category image

Coding for category_bit.html
Quote
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"> {ifno cat_image}<a href="{cat_url}" class="maincat"><img src="{cat_image}"></a>{endifno
      cat_image}&nbsp;&nbsp;&nbsp; </td>
    <td> <p><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}<br>
        {if cat_description}<span class="smalltext">{cat_description}</span><br />
        {endif cat_description} {if sub_cats}{sub_cats}{endif sub_cats} </p>
      </td>
  </tr>
</table>


Melissa

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #182 on: October 29, 2007, 03:09:27 PM »
Ok but I see this in code:

Quote
if ($result['cat_image'])
  {

Where is rest ? Where is cat_image code for start in admin/categories.php file ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Melissa67

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #183 on: October 29, 2007, 07:21:50 PM »
I'm not sure what you mean  :oops: but I have attached the entire file. I changed it back to what it was originally with the cat_image code but it still does not work.
« Last Edit: November 23, 2007, 03:33:34 PM by Melissa67 »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #184 on: October 29, 2007, 07:24:55 PM »
No need for add 50 folder in ZIP file. :?

Ok, in file ... I no think this is right ...

Find:

Quote
// Category 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);
            }
         }
      }else {
         $cat_image = TEMPLATE_PATH."/images/folder.gif";
      }
      $site_template->register_vars("cat_image", $cat_image);

//End Category image

replace:

Code: [Select]
// Category image 
$cat_image = "";
      if ($cat_cache[$cat_id]['cat_image'])
      {
         $sql = "SELECT image_id, image_media_file, image_thumb_file, cat_id
              FROM ".IMAGES_TABLE."
              WHERE image_id = ".$cat_cache[$cat_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.gif";
      }
      $site_template->register_vars("cat_image", $cat_image);

//End Category image
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Melissa67

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #185 on: October 29, 2007, 07:39:11 PM »
I had just added one file to the zip folder.

I did that but now there is no place to insert the Category Image ID # under edit category.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #186 on: October 29, 2007, 07:52:51 PM »
Quote
I had just added one file to the zip folder.

Yes - with 50 folder for one file. :?

Quote
I did that but now there is no place to insert the Category Image ID # under edit category.

Sorry ... is no my MOD ... restore file and you see select ID again ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Mte90

  • Newbie
  • *
  • Posts: 16
  • I love Vb.Net
    • View Profile
    • www.dbg.shorturl.com
Re: [MOD] Category Image v1.0.2
« Reply #187 on: November 23, 2007, 02:34:56 PM »
this mod operate with 4images 1.7.4?
Cerco utenti italiani per poter chiedere di fondare una sezione tutta nostra se è possibile!

Offline albertpr9

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #188 on: December 10, 2007, 02:19:35 PM »
I tried installing it once on 1.7.4 I had a few errors... I just quit trying cause I'm not sure if it actually works with this version....

If someone has made this work on the latest version please let me know, so I can try again. : )

Cheers,

Albert

Offline albertpr9

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #189 on: December 10, 2007, 04:00:12 PM »
Ok... Tried again,

This is the error I get on the admin panel >> edit images

Quote
Warning: Cannot modify header information - headers already sent by (output started at /home/albertpr/public_html/mike/projects/admin/categories.php:2) in /home/albertpr/public_html/mike/projects/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/albertpr/public_html/mike/projects/admin/categories.php:2) in /home/albertpr/public_html/mike/projects/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home/albertpr/public_html/mike/projects/admin/categories.php:2) in /home/albertpr/public_html/mike/projects/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home/albertpr/public_html/mike/projects/admin/categories.php:2) in /home/albertpr/public_html/mike/projects/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/albertpr/public_html/mike/projects/admin/categories.php:2) in /home/albertpr/public_html/mike/projects/admin/admin_functions.php on line 172

I have no idea what I can do to fix it.... Can anyone help?

Thanks!

Offline gborislav

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #190 on: December 17, 2007, 07:54:37 PM »
Hi,

I have a question for V@no.


1.
There was once a question :

how to do to have random categories image?

You replied : u don't need this mod, just uncomment,

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

2.
i tried do that but nothing happens:

You replied :

random_cat_image must be enabled in includes/constants.php


Now these are  my questions:

a.
Can you put the whole sentence how to enable it and in which category to do it in.

b.
The picture that is going to be picked out randomly, will it be picked out from the same category where the picture shows up,  or from all the picture that there are.

Thank you

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #191 on: December 17, 2007, 08:05:37 PM »
I have a question for V@no.

... nice statement ... ;)
... V@no : Last Active ... unfortunately ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline gborislav

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #192 on: December 17, 2007, 08:11:00 PM »
I have a question for V@no.

... nice statement ... ;)
... V@no : Last Active ... unfortunately ...


ye, i didn't see that  ( Last Active:     November 03, 2006, 11:56:03 PM.)

SO, anyway can someone help me with my question.

Thanks.

jojomart

  • Guest
Re: [MOD] Category Image v1.0.2
« Reply #193 on: December 17, 2007, 08:33:17 PM »
Ohhh please can someone remodel this for 1.74???

It's lovely and I really want to do it - it will be the perfect addition to my site!

Joanne

Offline albertpr9

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #194 on: December 17, 2007, 08:39:54 PM »
No Doubt, it's a great function!!! I tried everything to make it work but had no luck as well...