SELECT
p.id as id,
p.fk_id_user,
p.fk_category,
DATE_FORMAT(p.data, '%d.%m.%Y') as data,
DATE_FORMAT(p.data_inizio, '%d.%m.%Y') as data_in,
DATE_FORMAT(p.data_scadenza, '%d.%m.%Y') as data_out,
p.data_inizio,
p.data_scadenza,
TXT_GET_MESSAGE(p.txt_titolo,'en','it') as titolo,
TXT_GET_MESSAGE(p.txt_abstract,'en','it') as estratto,
TXT_GET_MESSAGE(p.txt_text,'en','it') as corpo,
p.url_picture,
TXT_GET_MESSAGE(p.txt_mk,'en','it') as metakey,
TXT_GET_MESSAGE(p.txt_md,'en','it') as metadesc,
c.cat_it as cat
FROM ar_posts p
INNER JOIN ar_posts_categorie c
ON p.fk_category = c.id
WHERE p.published = 1 ORDER BY p.data_inizio desc?sortI=asc?sortI=desc?sortF=asc?sortI=desc?sortF=asc?sortF=desc?sortF=asc?sortI=desc?sortI=desc?sortF=asc?sortI=desc?sortI=desc?sortI=asc?sortF=desc?sortI=asc?sortI=asc?sortF=asc?sortI=desc?sortI=asc?sortF=asc?sortI=asc?sortI=asc?sortF=desc?sortF=asc?sortF=asc?sortF=desc?sortF=desc?sortF=asc?sortF=asc?sortI=desc?sortF=asc?sortF=asc?sortF=asc?sortF=asc?sortF=asc?sortF=asc?sortF=desc?sortI=asc?sortI=asc?sortI=asc?sortF=desc?sortI=asc?sortI=desc?sortI=asc?sortI=asc?sortF=desc?sortI=desc?sortF=asc?sortI=asc?sortF=asc?sortI=desc?sortF=asc?sortF=asc?sortF=desc?sortI=desc?sortI=asc?sortI=asc?sortF=asc?sortF=asc?sortI=asc?sortF=desc?sortI=asc?sortI=desc?sortF=asc?sortI=asc?sortI=asc?sortI=desc?sortI=asc?sortF=asc?sortF=desc?sortF=asc?sortF=asc?sortI=asc?sortF=asc?sortF=asc?sortF=desc?sortF=asc?sortI=desc?sortI=asc?sortI=desc?sortI=asc?sortF=asc?sortF=asc?sortI=desc?sortF=desc?sortF=desc?sortI=asc?sortF=desc?sortF=desc?sortI=asc?sortF=desc?sortF=asc?sortI=asc?sortF=desc?sortF=asc?sortI=asc?sortI=desc?sortI=asc?sortI=desc?sortI=asc?sortI=asc?sortI=desc?sortF=asc?sortI=desc?sortI=asc?sortI=desc?sortF=desc?sortF=asc?sortI=desc?sortF=asc?sortF=desc?sortI=asc?sortI=desc?sortI=asc?sortF=asc?sortF=desc?sortI=desc?sortI=desc?sortI=desc?sortI=desc?sortI=desc?