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

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

0 Members and 1 Guest are viewing this topic.

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 #45 on: March 11, 2006, 09:57:21 AM »
1) Your problem has absolutely nothing to do with this mod.
2) Please read docs/installation.txt instructions and read our FAQ
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 glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Category Image v1.0.2
« Reply #46 on: March 11, 2006, 10:54:32 AM »
Thanks i find the little problem.

Offline Visual-Dreams

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • Visual-Dreams
Re: [MOD] Category Image v1.0.2
« Reply #47 on: March 11, 2006, 06:05:47 PM »
@V@no

can you help me?

Wenn ich in der admin/categories.php die Änderungen durchführe, kann ich nicht mehr die Kategorien bearbeiten (Im Admin Bereich). Keinerlei Änderungen werden dann übernommen (kein Text und keine Einstellung). Tausche ich wieder gegen die Originaldatei geht alles.

Ich benutze Version 1.7.2

Es liegt an Step 2.2
Code: [Select]
            SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment, cat_image = $cat_image
Sobald ich , cat_image = $cat_image ransetze, geht nichts mehr außer das ich im Feld für das Kategorie Image was eintragen kann. Das wird dann auch übernommen, aber im Formularfeld nicht angzeigt. Alle anderen Felder sind ohne Funktion. Nimm ich cat_image = $cat_image weg, geht alles andere, aber das Kategorie Image dafür nicht.  :roll:

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 #48 on: March 11, 2006, 06:14:00 PM »
@V@no

can you help me?
How can I, if I don't understand a single word you wrote...I don't speak german...
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 Visual-Dreams

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • Visual-Dreams
Re: [MOD] Category Image v1.0.2
« Reply #49 on: March 11, 2006, 07:44:22 PM »
Sorry
When I make changes in
admin/categories.php, i can not chance anything (categories) in the admincenter.

I use Version 1.7.2

Here is the problem  Step 2.2
Code:
            SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment, cat_image = $cat_image

When i add , cat_image = $cat_image only the Category- Image field is ok. When I delete it, the other fields are ok. (Admiin-Center)

Sorry for my bad english.

Offline Patrick81

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #50 on: March 13, 2006, 07:32:32 PM »
Hi,

I've tryed  to install this mod now 4 times with the latest release of 4images (1.7.2) in the admin menue / edit categories / it doesn't show me a thumbnail from the image id I add (for example ID 13, it shows me after save a blanc field and I see no thumb image - it only shows the category image in my album, but not in admin pannel / edit category / categoryname.

Any Ideas?

Thanks for your feedback.
Pat

Offline obmob01

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #51 on: March 14, 2006, 03:00:45 AM »
:( not working in 1.7.2

Offline roger13

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #52 on: March 14, 2006, 03:27:30 AM »
Hi,

I've tryed to install this mod now 4 times with the latest release of 4images (1.7.2) in the admin menue / edit categories / it doesn't show me a thumbnail from the image id I add (for example ID 13, it shows me after save a blanc field and I see no thumb image - it only shows the category image in my album, but not in admin pannel / edit category / categoryname.

Any Ideas?

Thanks for your feedback.
Pat


In admin\categories.php replace this code


Code: [Select]
// 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


with this one:
Code: [Select]
// Category image
  $cat_image = "";
  if ($cat_row['cat_image'])
  {
    $sql = "SELECT image_id, image_media_file, image_thumb_file, image_name, cat_id
            FROM ".IMAGES_TABLE."
            WHERE image_id = ".$cat_row['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 = $cat_row['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

..the variable $image_row has changed to $cat_row

:( not working in 1.7.2

Sure, it do very well!  :wink:

Offline roger13

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #53 on: March 14, 2006, 03:37:32 AM »
ups sorry... I meant the variable $result has canged to $cat_row...


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 #54 on: March 14, 2006, 03:47:53 AM »
ups sorry... I meant the variable $result has canged to $cat_row...


oh, thanks, the easiest fix would be add below
Code: [Select]
  $cat_image = ""; this line:
Code: [Select]
$result = $cat_row;;)
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 roger13

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #55 on: March 14, 2006, 04:05:34 AM »
Quote
oh, thanks, the easiest fix would be add below...

Yes, of course.. it's as simple as that... i'ts looks more smart AND modular! Thank you  :)

Offline obmob01

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #56 on: March 16, 2006, 01:19:06 AM »
 8O so confused now... i guess i'll have to read everything.

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 #57 on: March 16, 2006, 01:23:16 AM »
8O so confused now... i guess i'll have to read everything.
I guess, since you provided absolutly no usefull information about what is wrong and what is going on...
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 Visual-Dreams

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • Visual-Dreams
Re: [MOD] Category Image v1.0.2
« Reply #58 on: March 16, 2006, 09:08:46 AM »
Thanx, the changes from roger13 works.  :D

Offline roger13

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #59 on: March 17, 2006, 10:38:17 AM »
Thanx, the changes from roger13 works. :D

you're welcome. But you can use V@no's little change, because I forgot also to change in my code ($result to $cat_row) in this line:

Code: [Select]
$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>";
it should be like this:

Code: [Select]
$cat_image = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$cat_row['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=".$cat_row['cat_image'])."\" target=\"_blank\">".$image_row['image_name']."</a>";
..so then you will get also the correct thumb link, if you click on it... but anyway, I think V@nos change is more easy..