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

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

0 Members and 2 Guests are viewing this topic.

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #270 on: November 16, 2009, 07:53:35 PM »
Hello,
I am applying here : http://www.4homepages.de/forum/index.php?topic=26297.0
so I installed the mod : http://www.4homepages.de/forum/index.php?topic=6922.0
then make the change presented here http://www.4homepages.de/forum/index.php?topic=6675.0

when I click on a category, I have this error:

Code: [Select]
Warning: main(admin_global.php) [function.main]: failed to open stream: No such file or directory in /homez.312/iphonefo/www/categories.php on line 27

Fatal error: main() [function.require]: Failed opening required 'admin_global.php' (include_path='.:/usr/local/lib/php') in /homez.312/iphonefo/www/categories.php on line 27

In categorie line 27 :
Code: [Select]
require('admin_global.php');

admin_global.php on my server

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 #271 on: November 17, 2009, 04:27:37 AM »
When I removed it then all other folders gone. I have folder on some and images on others.
In that case use this:
Code: (HTML template) [Select]
{ifno cat_image}<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />{endifno cat_image}

when I click on a category, I have this error:
Looks like you've uploaded categories.php file that belongs in admin/ directory into 4images root directory...I hope you have backups of both files.
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 winracer

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Help Me With Perl
Re: [MOD] Category Image v1.0.2
« Reply #272 on: November 17, 2009, 02:29:27 PM »
When I removed it then all other folders gone. I have folder on some and images on others.
In that case use this:
Code: (HTML template) [Select]
{ifno cat_image}<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />{endifno cat_image}


thanks for your help I got it

Code: [Select]
{if cat_image}<img src="{cat_image}" width="20" height="13" alt="" />{endif cat_image}

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



Do you know if  there a mod like this for subcategory image?
winracer

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 #273 on: November 17, 2009, 02:59:55 PM »
Absolutely not tested.

In includes/functions.php find:
  $sub_cat_list "";


Insert below:
  $cat_image_list = array();
  
$i 1;
  foreach (
$visible_cat_cache as $subcat_id)
  {
    if (
$i $num_subs || $i $config['num_subcats'])
      break;

    if (!
$cat_cache[$subcat_id]['cat_image'] || isset($cat_cache[$subcat_id]['cat_image_url']))
      continue;

    
$cat_image_list[] = $cat_cache[$subcat_id]['cat_image'];
    
$i++;
  }
  if (!empty(
$cat_image_list)) 
  { 
    
$sql "SELECT image_id, image_media_file, image_thumb_file, cat_id 
            FROM "
.IMAGES_TABLE.
            WHERE image_id IN ("
.implode(","$cat_image_list).")"
    if (
$result $site_db->query($sql))
    {
      while (
$image_row $site_db->fetch_array($result))
      {
        if (!
get_file_path($image_row['image_thumb_file'], "thumb"$image_row['cat_id'], 00)) 
        { 
          
$cat_cache[$image_row['cat_id']]['cat_image_url'] = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif"
        } 
        else 
        { 
          
$cat_cache[$image_row['cat_id']]['cat_image_url'] = get_file_path($image_row['image_thumb_file'], "thumb"$image_row['cat_id'], 01); 
        } 
      }
    } 
  }



Find:
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".format_text($cat_cache[$subcat_id]['cat_name'], 2)."</a>";


Replace with:
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">";
      if (isset(
$cat_cache[$subcat_id]['cat_image_url']) && $cat_cache[$subcat_id]['cat_image_url'])
        
$sub_cat_list .= '<img src="' $cat_cache[$subcat_id]['cat_image_url'] . '" width="20" height="13" alt="" /> ';
      
$sub_cat_list .= format_text($cat_cache[$subcat_id]['cat_name'], 2);
      
$sub_cat_list .= "</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 winracer

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Help Me With Perl
Re: [MOD] Category Image v1.0.2
« Reply #274 on: November 17, 2009, 03:45:46 PM »
thanks!!!!, I have installed and will test.

Question how do I add the image to the subcategory?

can it be setup like category? what i mean is that when you edit a photo you have some option as category like
Category image
Current image:
 
  Yes     No
 

also have a

Subcategory image
Current image:

  Yes     No


hoep this makes sence
 
winracer

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 #275 on: November 17, 2009, 03:53:41 PM »
mmmm...just edit subcategories and add their own images...
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 winracer

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Help Me With Perl
Re: [MOD] Category Image v1.0.2
« Reply #276 on: November 17, 2009, 04:09:34 PM »
mmmm...just edit subcategories and add their own images...


ok can i edit the category_bit.html

and replace this
Code: [Select]
{if sub_cats}{sub_cats}{endif sub_cats}

with this


Code: [Select]
{if subcat_image}<img src="{subcat_image}" width="20" height="13" alt="" />{endif subcat_image}

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


Next question would this work if I took the code at the start of the and added  $subcat_image and  cat_image



sorry I see now that this is only to display the subcat on main page
« Last Edit: November 17, 2009, 06:01:27 PM by winracer »
winracer

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #277 on: May 15, 2010, 02:10:15 PM »
Hello
How to get it working for sub categories?

http://nsa15.casimages.com/img/2010/05/15//100515030413798529.jpg

« Last Edit: May 15, 2010, 03:03:46 PM by satine88 »

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 #278 on: May 15, 2010, 07:57:32 PM »
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 satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #279 on: May 16, 2010, 11:40:03 AM »
Just a few messages before yours
http://www.4homepages.de/forum/index.php?topic=6922.msg143083#msg143083
Ok; sorry
Thanks ;)

But : I've this error :

Code: [Select]
Fatal error: Call to undefined function: get_basename() in /homez.93/fondecra/www/global.php on line 346
global.php on line 346 :
Code: [Select]
  $url = get_basename(getenv("HTTP_REFERER"));


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 #280 on: May 16, 2010, 08:19:18 PM »
You did something wrong, 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)

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #281 on: May 16, 2010, 09:41:17 PM »
You did something wrong, restore backups and try again ;)

Thank you!
Will it be possible, just for sub-categories to the name of the sub-category below
image?

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 #282 on: May 16, 2010, 09:45:54 PM »
replace        $sub_cat_list .= '<img src="' $cat_cache[$subcat_id]['cat_image_url'] . '" width="20" height="13" alt="" /> ';


with:       $sub_cat_list .= '<img src="' $cat_cache[$subcat_id]['cat_image_url'] . '" width="20" height="13" alt="" /><br />';
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 simpley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [MOD] Category Image v1.0.2
« Reply #283 on: July 15, 2010, 12:46:27 PM »
Hi, i am using 1.7.7 Does that mean i don't have to change anything in the global as i can not see the line that needs changing ?

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 #284 on: July 15, 2010, 02:34:47 PM »
Hi, i am using 1.7.7 Does that mean i don't have to change anything in the global as i can not see the line that needs changing ?
Every step required. If you can't find exact line, find a similar and add the need part at the end of that line.
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)