-- Exportar artículos seleccionados de Joomla
-- Artículos de contenido
SELECT 
    c.id,
    c.title,
    c.alias,
    c.introtext,
    c.fulltext,
    c.created,
    c.created_by,
    c.catid,
    cat.title as category_title,
    c.state,
    c.publish_up,
    c.publish_down,
    c.images,
    c.urls,
    c.attribs,
    c.metadata,
    c.metakey,
    c.metadesc,
    c.language
FROM ew4r_content c
LEFT JOIN ew4r_categories cat ON c.catid = cat.id
WHERE c.id IN (
    257,317,523,524,572,1466,1477,1491,1503,2760,3326,4450,5735,5736,5737,5738,5739,5740,7144,8219,8220,8222,8241,8242,8260,8265,8266,8267,8292,17575,17576,17577,17578,17579,17580,17581,17582,17583,17584,17585,17586,17587,17592,17593,17594,17595,17596,17597,17598,17599,17600,17601,17602,17603,17604,17605,17606,17607,17608,17609,17610,17611,17612,17613,17618,17619,17620,17621,17622,17623,17624,17625,17626,17627,17628,17629,17630,17631,17632,17637,17638,17639,17640,17641,17642,17643,17644,17645,17646,17647,17648,17649,17650,17651,17652,17653,17654,17655,17660,17665,17666,17667,17668
)
ORDER BY c.created DESC;

-- Exportar categorías relacionadas
SELECT DISTINCT
    cat.id,
    cat.parent_id,
    cat.title,
    cat.alias,
    cat.description,
    cat.path
FROM ew4r_categories cat
INNER JOIN ew4r_content c ON cat.id = c.catid
WHERE c.id IN (
    257,317,523,524,572,1466,1477,1491,1503,2760,3326,4450,5735,5736,5737,5738,5739,5740,7144,8219,8220,8222,8241,8242,8260,8265,8266,8267,8292,17575,17576,17577,17578,17579,17580,17581,17582,17583,17584,17585,17586,17587,17592,17593,17594,17595,17596,17597,17598,17599,17600,17601,17602,17603,17604,17605,17606,17607,17608,17609,17610,17611,17612,17613,17618,17619,17620,17621,17622,17623,17624,17625,17626,17627,17628,17629,17630,17631,17632,17637,17638,17639,17640,17641,17642,17643,17644,17645,17646,17647,17648,17649,17650,17651,17652,17653,17654,17655,17660,17665,17666,17667,17668
)
ORDER BY cat.lft;
