Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 6th, 2018 61 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. /*
  2. Complete list of menus/positions per template and TE engine (old and new)
  3. Possible to detect all differences when commented parts are uncommented
  4. Where menu_to_be_rendered is blank - it means that it is AUTO (this applies only to new TE)
  5. */
  6.  
  7. SET @OLD_TEMPLATE_NAME = '';
  8. SELECT  
  9.     /*count(distinct mt.menu_identificator) as menu_identificator_count,    */
  10.     mt.template_name,
  11.     mt.engine_name,
  12.     mt.menu_position,
  13.     mt.menu_to_be_rendered,
  14.     mt.menu_identificator
  15. FROM
  16. (
  17.     SELECT 'old_te' AS engine_name, new_mt.menu_identificator, new_mt.template_name, new_mt.menu_to_be_rendered, new_mt.menu_position FROM
  18.     (  
  19.         SELECT
  20.             pl.template_name AS template_name,
  21.             IF(pl.template_name = @OLD_TEMPLATE_NAME, @NR:=@NR+1, @NR:=1) AS menu_to_be_rendered,
  22.             IF(pl.template_name <> @OLD_TEMPLATE_NAME, @OLD_TEMPLATE_NAME:=pl.template_name, @OLD_TEMPLATE_NAME),
  23.             p.name AS menu_position,
  24.             CONCAT_WS('-',
  25.                 pl.template_name,
  26.                 p.name,
  27.                 @NR
  28.             ) AS menu_identificator
  29.         FROM flexiweb_template_engine.predefined_layouts AS pl
  30.         LEFT JOIN flexiweb_template_engine.predefined_page_layouts AS ppl ON (ppl.predefined_layout_id = pl.id)
  31.         LEFT JOIN flexiweb_template_engine.positions AS p ON (p.id = ppl.position_id)
  32.         WHERE
  33.             pl.name = 'default' AND
  34.             ppl.page_id = 2 AND
  35.             ppl.content_id = 0 AND
  36.             ppl.module_name LIKE 'menu'
  37.         ORDER BY pl.template_name, ppl.position_id
  38.     ) AS new_mt
  39.  
  40.     UNION
  41.    
  42.     SELECT 'new_te' AS engine_name, old_mt.menu_identificator, old_mt.template_name, old_mt.menu_to_be_rendered, old_mt.menu_position FROM
  43.     (
  44.         SELECT  
  45.             t.folder_name AS template_name,
  46.             te.instance AS selected_instance,
  47.             t.id AS selected_template_id,
  48.             @MENU_TO_BE_RENDERED:=(
  49.                 SELECT if(`value` is not null, `value`, 'AUTO')
  50.                 FROM flexiweb.te_t_elements AS te2     
  51.                 WHERE
  52.                     te2.contenttype_model = 'TeContenttype' AND
  53.                     te2.contenttype_fk = 'TeCMaster' AND           
  54.                     te2.classname = 'TeEMenu' AND
  55.                     te2.`field` = 'menu_sortnum' AND
  56.                     te2.instance = selected_instance AND
  57.                     te2.template_id = selected_template_id
  58.             ) AS menu_to_be_rendered,
  59.             te.`value` AS menu_position,
  60.             IF(te.`value` = 'top_left', 1,
  61.                 IF(te.`value` = 'top', 2,
  62.                     IF(te.`value` = 'top_right', 3,
  63.                         IF(te.`value` = 'left', 4,
  64.                             IF(te.`value` = 'main', 5,
  65.                                 IF(te.`value` = 'right', 6,
  66.                                     IF(te.`value` = 'bottom_left', 7,
  67.                                         IF(te.`value` = 'bottom', 8, 9)
  68.                                     )
  69.                                 )
  70.                             )
  71.                         )
  72.                     )
  73.                 )
  74.             ) AS menu_position_sortnum,
  75.             (
  76.                 SELECT `value`
  77.                 FROM flexiweb.te_t_elements AS te2     
  78.                 WHERE
  79.                     te2.contenttype_model = 'TeContenttype' AND
  80.                     te2.contenttype_fk = 'TeCMaster' AND           
  81.                     te2.classname = 'TeEMenu' AND
  82.                     te2.`field` = 'start_level' AND
  83.                     te2.instance = selected_instance AND
  84.                     te2.template_id = selected_template_id
  85.             ) AS menu_start_level,
  86.             CONCAT_WS('-',
  87.                 t.folder_name,
  88.                 te.`value`,
  89.                 @MENU_TO_BE_RENDERED
  90.             ) AS menu_identificator
  91.         FROM flexiweb.te_t_elements AS te
  92.         LEFT JOIN flexiweb.te_templates AS t ON t.id = te.template_id
  93.         WHERE
  94.         te.contenttype_model = 'TeContenttype' AND
  95.         te.contenttype_fk = 'TeCMaster' AND
  96.         te.classname = 'TeEMenu' AND
  97.         te.`field` = 'position' AND
  98.         te.instance <> ''
  99.         HAVING menu_start_level IS NULL OR menu_start_level = 0
  100.         ORDER BY t.folder_name, menu_position_sortnum
  101.     ) AS old_mt
  102. ) AS mt
  103. /*GROUP BY mt.menu_identificator
  104. HAVING menu_identificator_count < 2*/
  105. ORDER BY mt.template_name, mt.engine_name, mt.menu_to_be_rendered;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top