Author Topic: Image Count for Subcategory on Main Page  (Read 18883 times)

0 Members and 1 Guest are viewing this topic.

alinford

  • Guest
Image Count for Subcategory on Main Page
« on: February 14, 2003, 07:13:02 AM »
Is there any way to show the image totals in each subcategory while on the main page?

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Image Count for Subcategory on Main Page
« Reply #1 on: February 15, 2003, 11:44:46 AM »
Just copy {total_images} to the template categories.html

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

alinford

  • Guest
Subcategory image count
« Reply #2 on: February 16, 2003, 03:56:45 AM »
That seems to give me the total of all images, not the total next to each subcategory.

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Image Count for Subcategory on Main Page
« Reply #3 on: February 16, 2003, 09:26:09 AM »
Ok, did not understand you correctly. But what do you mean exactly? You see the image count behind each category name.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline helluvaguy

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Image Count for Subcategory on Main Page
« Reply #4 on: February 16, 2003, 02:44:43 PM »
I guess he wants to see the number of every subcategory that is displayed on the index page.
Like
  • Category (132)
    • Subcategory 1 (33)
    • Subcategory 2 (24)
    • Subcategory 1 (14)
    • and so forth [/list:u] [/list:u]

alinford

  • Guest
Yes...
« Reply #5 on: February 16, 2003, 07:41:30 PM »
You are a helluvaguy, that is exactly what I am looking for.

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
Image Count for Subcategory on Main Page
« Reply #6 on: February 16, 2003, 08:20:38 PM »
Open /includes/functions.php
Find:
Code: [Select]
     $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".$cat_cache[$subcat_id]['cat_name']."</a>";

Replace with:
Code: [Select]
     $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".$cat_cache[$subcat_id]['cat_name']."</a> (".$cat_cache[$subcat_id]['num_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)

alinford

  • Guest
Thanks!
« Reply #7 on: February 16, 2003, 10:54:11 PM »
Thanks!
I had messed around with this for a few days and could not get it right.
I have a family site, http://linford.net
I have 4images integrated with Geeklog and this little change was somthing I needed.

Offline heiko

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Thanks!
« Reply #8 on: February 20, 2003, 10:51:30 AM »
Hi !


Ich habe da ein Problem,

Zwar bekomme ich jetzt auf der Hauptseite die Anzahl der Bilder in den Sub-Kategorien gezeigt, aber irgendwie stimmt der Zähler nicht.

Beispiel:

Musik (55)
      ---- LP´s (0)
      ---- Singles (0)
      ---- DVD (33)

Hier wird  (0) angezeigt obwohl z.B. 18 Bilder in der Kategorie LP´s vorhanden sind.


Irgendeine Idee woran das liegt ????


Liebe Grüße

Heiko

alinford

  • Guest
Code Above
« Reply #9 on: February 23, 2003, 10:52:47 PM »
This is confusing, so you may need to read it more than once.
Is there any way that it can show the subcategory total + the total of all subcategories of the subcategory?

Somthing like this:
    Category (71)
    Subcategory 1 (33)
      Subcategory 1.a (12)
        Subcategory 1.a.1 (5) [/list:u] Subcategory 1.b (10) [/list:u]
        Subcategory 2 (24)
          Subcategory 2.a (24) [/list:u]
          Subcategory 3 (14)
          [/list:u]

          What the above is showing in the () is this:
          Subcategory 1 (33) = 1(11) 1.a(7) + 1.a.1(5) + 1.b(10)
          Subcategory 2 (24) = 2(0) + 2.a(24)
          Subcategory 3 (14) = 3(14)

          What I am trying to avoid is when I have a subdirectory with 0 images, but several subsubidrectories with images.  What shows up is that the subdirectory has (0) images, but you can't see the subsubdirectory totals unless you click on the subdirectory with 0 images.  It gives the idea that there are no images in the subdirectory even though there are images in subsubdirectories.  I don't want to show the subsubdirectories on the main page, but I do want to include the images from the subsubdirectories in the totals for the subdirectories so that they do not look empty.

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: Code Above
« Reply #10 on: February 23, 2003, 10:59:29 PM »
Quote from: alinford

What the above is showing in the () is this:
Subcategory 1 (33) = 1(11) 1.a(7) + 1.a.1(5) + 1.b(10)
Subcategory 2 (24) = 2(0) + 2.a(24)
Subcategory 3 (14) = 3(14)

actualy that how it works...isnt it? atleast for me.
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)

alinford

  • Guest
Not for me
« Reply #11 on: February 23, 2003, 11:28:19 PM »
On the main page it shows like this for me:

    Category (71)
    Subcategory 1 (11)
    Subcategory 2 (0)
    Subcategory 3 (14)
    [/list:u]

    The problem is that Subcategory 1 looks like it has (11)images.  It actually has (33),  (11) in 1 + (7) in 1.a and (5) in 1.a.1 + (10) in 1.b.
    Subcategory 2 looks like it has (0) when it actually has (24) in subcategory 2.a.
    This would be like showing the Category total , but only giving the total for images in the subdirectories and not adding in subsubdirectories because they are 2 directory levels below.

alinford

  • Guest
num_images
« Reply #12 on: March 10, 2003, 10:13:13 PM »
With the script above, I can now see num_images on index.php for each category as well as each immediate subdirectory.  num_images for Category shows the total images for the category, including all subdirectories.  The problem with the code above that adds num_images for the subdirectories only shows the image total for that subdirectory.  I would like it to show the total for the subdirectory and any subdirectories inside that subdirectory.
Any ideas?

Offline jengwen

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • http://www.jenrichardsphotography.com
Image Count for Subcategory on Main Page
« Reply #13 on: May 22, 2003, 06:39:50 PM »
Has anyone figured this out yet?  I am having the same problem.  I created a subcategory and then several subcategories under that.  My total for the main subcategory is 0, since all the images are in the subcategory under that.  For example:

Category:           Zoo Special Events (5)
Subcategory:             Egg Day (5)
Subcategory:             Migratory Bird Day (0)
Sub-Subcategory:             Games (15)
Sub-Subcategory:             Art Show (20)

This is very confusing, because only the main and subcategory show up in the main categories page, so it looks like there are no images under Migratory Bird Day, when there are actually 35.  The user doesn't know to click on it and look for the subcategories since it says there are 0 images.

If this cannot be solved, is there an easy way to show more levels of subcategory on the main category list?

Offline Jasi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Image Count for Subcategory on Main Page
« Reply #14 on: March 28, 2009, 01:31:32 PM »
THX - Danke für diesen kleinen (little) MOD  :wink: Funktioniert bei mir in der V.1.7.6 perfekt!

Working perfect in/on V1.7.6

LG euer Jasi
LG Jasi