PHPCMSV9 {loopsubcat (0, 0, 0, $ siteid) $ r} How to explain? {Loopsubcat (, 0, $ siteid) $ r} {loop} *** get subtopic & nbsp; * @ param $ parentid parent id & nbsp; * @ param $ type topic type & nbsp; * @ param $ self: does PHPCMS V9 {loop subcat (, 0, $ siteid) $ r?
{Loop subcat (0, 0, 0, $ siteid) $ r} {/loop}
/**
* Obtain subtopics
* @ Param $ parentid parent id
* @ Param $ type topic type
* @ Param $ whether self contains itself 0 is not included
* @ Param $ siteid site id
*/
Function subcat ($ parentid = NULL, $ type = NULL, $ self = '0', $ siteid = ''){
If (empty ($ siteid) $ siteid = get_siteid ();
$ Category = getcache ('Category _ content _ '. $ siteid, 'commons ');
Foreach ($ category as $ id => $ cat ){
If ($ cat ['siteid'] = $ siteid & ($ parentid = NULL | $ cat ['parentid'] = $ parentid) & ($ type = NULL | $ cat ['type'] = $ type) $ subcat [$ id] = $ cat;
If ($ self = 1 & $ cat ['catid'] = $ parentid &&! $ Cat ['child ']) $ subcat [$ id] = $ cat;
}
Return $ subcat;
}