SELECT m.*, e.nombre as nombre_empresa, e.logo as logo_empresa, e.email as email_empresa, (select persona_contacto from empresas where id=m.empresa) as contacto_empresa, a.email as email_autor, a.nombre as nombre_autor, a.foto as foto, a.nombre as nusuario, c.nombre as catename, c.icono as cateicono, (select count(id) from comentarios where tipo='magazine' && contenido=m.id) as ncomen, (select total from visitas_magazine where magazine_id=m.id) as visitas, (select count(id) from likes where contenido=m.id && tipo='magazine' && tipolike=1) as likes, (select count(id) from likes where contenido=m.id && tipo='magazine' && tipolike=2) as dislikes, (select count(id) from likes where contenido=m.id && tipo='magazine' && tipolike=1 && usuario=0) as yolike, (select count(id) from likes where contenido=m.id && tipo='magazine' && tipolike=2 && usuario=0) as yodislike, REPLACE(m.descripcion, '../', 'https://secure.ganaderia.com/') as detalle FROM magazine as m LEFT JOIN empresas as e on e.id=m.empresa LEFT JOIN autores as a on a.id=m.autor LEFT JOIN categorias as c on c.id=m.categoria WHERE m.id=