[TYPO3-dam-devel] How to check a dam category that it is not empty?

Andreas Balzer andreasbalzer at gmail.com
Wed Dec 19 23:35:04 CET 2007


Hello to everyone :)
I have the following code from the extension ce_gallery.
How do I have to modify the mysql statement that empty categories are
excluded?

Thanks for your help.

Greetings,
Andreas

code follows:
_________________
    function getNumCat()    {
        $categories = $this->lConf['categoryView']['category'];
        if ($this->lConf['categoryView']['recursive']) {
            $whereAdd = ' AND (tx_dam_cat.uid IN (' . $categories. ')' .
                ' or tx_dam_cat.parent_id IN ('.$categories.'))';
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                'tx_dam_cat.uid',
                'tx_dam_cat, tx_dam_mm_cat',
                'tx_dam_mm_cat.uid_foreign=tx_dam_cat.uid' . $whereAdd .
$this->cObj->enableFields('tx_dam_cat'),
                'tx_dam_cat.uid');
            $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
            $ret = array (
                $GLOBALS['TYPO3_DB']->sql_num_rows ($res),
                $row['uid']);
        } else {
            $categories = split(',', $categories);
            $ret = array(
                count($categories),
                $categories[0]);
        }
        return $ret;
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-dam/attachments/20071219/22f390d4/attachment.htm 


More information about the TYPO3-team-dam mailing list