4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: kleiner_Hobbit on January 25, 2006, 08:40:30 PM

Title: Kategorien und Unterkategorien / Categories and Subcategories
Post by: kleiner_Hobbit on January 25, 2006, 08:40:30 PM
Hi Leute,

in der normalen Kategorie-Übersicht werden bei meinem Template die Kategorien wie folgt angezeigt:
my actual Category-Overview looks like this:

(http://www.photo-empire.de/forum/kat-ist.jpg)

Ich suche eine Möglichkeit, dass jede Unterkategorie in einer neuen Zeile angezeigt wird, also in etwa so:
I´m looking for a code to show the categories and subcategories like this (a new line for each subcategory) :

Asien
Japan-Reisebericht
Kambodscha
Laos
Thailand ....

Kann mir jemand dabei helfen?
Can anybody help me with this problem?

Viele Grüße / best wishes

Claudia
Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: mawenzi on January 25, 2006, 08:48:01 PM
Hallo Claudia,

1. ... tolle Bilder auf deiner Seite ...  :wink:
2. ... finde in /includes/functions.php folgendes ...
Code: [Select]
  foreach ($visible_cat_cache as $subcat_id) {
    if ($i <= $num_subs && $i <= $config['num_subcats']) {
      $sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".$cat_cache[$subcat_id]['cat_name']."</a>";
      if ($i != $config['num_subcats'] && $i < $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= ", ";
      }
      if ($i == $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= " ...\n";
      }
    }
    $i++;
  }

... und ändere es wie folgt ...
Quote
  foreach ($visible_cat_cache as $subcat_id) {
    if ($i <= $num_subs && $i <= $config['num_subcats']) {
      $sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".$cat_cache[$subcat_id]['cat_name']."</a>";
      if ($i != $config['num_subcats'] && $i < $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= "<br>";
      }
      if ($i == $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= " ...\n";
      }
    }
    $i++;
  }

... das war's dann schon ...

mawenzi
Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: kleiner_Hobbit on January 25, 2006, 09:01:32 PM
Boah ... das war ja schneller als die Feuerwehr!

Ich habe es gleich probiert und es funktioniert wunderbar! DANKE!!!

Ich hätte da gleich noch eine Frage zur Kategorieansicht  :?:
Kann man auch ggf eine weitere Ebene Unterkategorien anzeigen lassen, dass es dann in etwa so aussieht:

Just another question to show categories.
Is it possible to show the next level of subcategories (sub-subcategory) in an Overview?

Deutschland
     Berlin
     - Berlin - Diverse
     - Berlin - Regierungsviertel
     - Festival of Lights 2005
     Potsdam

Viele Grüße

Claudia
Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: TheOracle on January 25, 2006, 09:11:11 PM
Sorry to interrupt but I'm simply curious to know what are the significations of this topic. Could someone (probably Mawenzi - if possible) translate the subject in english ? ;)
Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: kleiner_Hobbit on January 25, 2006, 09:23:27 PM
@TheOracle
Didn´t you read the blue lines in my first post?
I did my best to translate my problem in english  :mrgreen:

Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: TheOracle on January 25, 2006, 09:29:46 PM
Ah ! just got it. Sorry for interrupting this. :mrgreen:
Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: mawenzi on January 26, 2006, 11:33:08 PM
Hallo Claudia,

... das ist sicher machbar, doch ist dieses Problem nicht so leicht wie oben zu lösen ...  :?
... dazu müsste in der functions.php einiges neu gecodet werden ...
Title: Re: Kategorien und Unterkategorien / Categories and Subcategories
Post by: kleiner_Hobbit on January 27, 2006, 01:17:07 AM
Schade ... aber trotzdem vielen Dank für die Antwort  :)

Falls mal jemand Lust hat den Code zu ändern würde ich mich sehr freuen   :mrgreen: