Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

318
 
319
 
319
 
boxes.php
_> 4141             $data[$Qspecific->value('boxes_group')][] = $Qspecific->value('code');
  4242           }
  4343         } else {
<> 44 -          $Qboxes = $osC_Database->query('select b2p.boxes_group, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.content_page in (:content_page) and b2p.templates_boxes_id = b.id and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
   44+          $Qboxes = $osC_Database->query('select b2p.boxes_group, b2p.content_page, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.content_page in (:content_page) and b2p.templates_boxes_id = b.id and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
4545           $Qboxes->bindTable(':table_templates_boxes_to_pages', TABLE_TEMPLATES_BOXES_TO_PAGES);
  4646           $Qboxes->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  4747           $Qboxes->bindTable(':table_templates', TABLE_TEMPLATES);
     
 !
5050           $Qboxes->execute();
  5151 
  5252           while ($Qboxes->next()) {
<> 53 -            $data[$Qboxes->value('boxes_group')][] = $Qboxes->value('code');
   53+            $_data[$Qboxes->value('boxes_group')][] = array('code' => $Qboxes->value('code'),
   54+                                                            'page' => $Qboxes->value('content_page'));
5455           }
<>  56+
   57+          foreach ($_data as $groups => $boxes) {
   58+            $clean = array();
   59+
   60+            foreach ($boxes as $box) {
   61+              if (isset($clean[$box['code']])) {
   62+                if (substr_count($box['page'], '/') > substr_count($clean[$box['code']]['page'], '/')) {
   63+                  unset($clean[$box['code']]);
   64+                }
   65+              }
   66+
   67+              $clean[$box['code']] = $box;
   68+            }
   69+
   70+            $_data[$groups] = $clean;
   71+          }
   72+
   73+          foreach ($_data as $groups => $boxes) {
   74+            foreach ($boxes as $box) {
   75+              $data[$groups][] = $box['code'];
   76+            }
   77+          }
<_ 5578         }
  5679 
  5780         $osC_Cache->writeBuffer($data);