In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Dependency Graph View Issue ] Relation Graph ] Vertical ]
related to child of duplicate of

Viewing Issue Simple Details
ID Category Type Reproducibility Date Submitted Last Update
0000631 [In-Portal CMS] Optimization feature request always 2010-03-19 11:39 2010-08-31 14:17
Reporter Dmitry View Status public  
Assigned To alex
Priority normal Resolution open  
Status needs feedback      
Summary 0000631: Optimize HasAdditionalImages tag using single SQL for Lists
Description I propose to make category item tag HasAdditionalImages look like this:

This will allow to check for category item additional images during list
printing without additional sql for each printed category item.
Additional Information /**
         * Allows to detect if item has any additional images available
         *
         * @param Array $params
         * @return string
         */
        function HasAdditionalImages($params)
        {
            static $cache = null;
            $object =& $this->getObject($params);
            /* @var $object kDBList */
            if (!isset($cache)) {
                $resource_ids = $object->GetCol('ResourceId');
                $sql = 'SELECT ImageId, ResourceId
                        FROM ' . $this->Application->getUnitOption('img',
'TableName') . '
                        WHERE ResourceId IN (' . implode(',', $resource_ids)
. ') AND DefaultImg != 1 AND Enabled = 1
                        GROUP BY ResourceId';
                $cache = $this->Conn->GetCol($sql, 'ResourceId');
            }
            $resource_id = $object->GetDBField('ResourceId');
            return array_key_exists($resource_id, $cache) ?
$cache[$resource_id] : false;
        }



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker