Lado esquerdo da home page
SELECT * FROM media WHERE Visible=1 and Tipo=1 AND (Permanente=1 OR (CURDATE() BETWEEN Data1 AND Data2) AND N_impressoes > 0 and N_cliques > 0) AND (Lingua="" OR Lingua="en") ORDER BY Peso Asc