Differences

This shows you the differences between two versions of the page.

deutsch:technik:aufruf-interner-funktionen:kategorie-top-down [2009/04/25 08:06]
127.0.0.1 external edit
deutsch:technik:aufruf-interner-funktionen:kategorie-top-down [2018/06/03 18:08] (current)
Line 9: Line 9:
\\ \\
-<code php>+ 
 +<del>**Version 1.0**</del>  Bitte nicht mehr verwenden!! 
 +<code php |h StructureTopDown_v1.0 |h>
function buildStruct_TopDown($start=0) { function buildStruct_TopDown($start=0) {
Line 28: Line 30:
} }
</code> </code>
 +
 +\\
 +
 +**Version 1.1** Empfohlen!! //(Update: KH 25.01.2011)//
 +<code php |h StructureTopDown_v1.1 |h>
 +function buildStruct_TopDown($start=0, &$my_cat_id='') { // KH: V1.1 25.01.2011
 +
 +    $struct = getStructureChildData($start);
 +
 +    foreach($struct as $value) {
 + 
 +//        buildStruct_TopDown($value['acat_id'],$my_cat_id);
 +        $my_cat_id .= ($my_cat_id != '') ? ','.$value['acat_id'] : $value['acat_id'];
 +        buildStruct_TopDown($value['acat_id'],$my_cat_id);
 + 
 +//        echo  '||'.$value['acat_id'].' ,';
 + 
 +    }
 + 
 +return $my_cat_id;
 +}
 +</code>
 +
 +\\
 +
 +
==== Beispiel: ==== ==== Beispiel: ====
Line 57: Line 85:
Ausgabe ##$s##: **4,6,7,5,8** Ausgabe ##$s##: **4,6,7,5,8**
 +\\
 +
 +===== Anzahl der Unterebenen =====
 +
 +Anzahl der Kategorien der nächsten Ebene wenn vorhanden.
 +
 +<code php>
 +echo count(getStructureChildData($GLOBALS['content']['cat_id']));
 +</code>
 +
 +
 +\\
 +
 +==== Ist eine Unterebene vorhanden? ====
 +
 +Einfaches Script un festzustellen, ob unterhalb der aktuellen Ebene eine Unterebene vorhanden ist.
 +
 +<code php>
 +// Sub-Level available?
 +
 +if (!count(getStructureChildData($GLOBALS['content']['cat_id'])))
 +   echo 'No Sub-level!';
 +else
 +   echo 'Sub-level available!';
 +
 +</code>
 +
 +\\
deutsch/technik/aufruf-interner-funktionen/kategorie-top-down.1240639561.txt.gz · Last modified: 2018/06/03 18:06 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0