Query: SELECT a.id, a.title, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,
a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access, a.hits,
CHAR_LENGTH( a.fulltext ) AS readmore, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups
, s.id AS sec_id, cc.id as cat_id
FROM #__content AS a
INNER JOIN #__content_frontpage AS f ON f.content_id = a.id
INNER JOIN #__categories AS cc ON cc.id = a.catid
INNER JOIN #__sections AS s ON s.id = a.sectionid
LEFT JOIN #__users AS u ON u.id = a.created_by
LEFT JOIN #__groups AS g ON a.access = g.id
WHERE a.state = 1
AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2010-09-03 18:34' )
AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2010-09-03 18:34' )
AND s.published = 1
AND cc.published = 1
AND a.access IN ( 0 )
AND s.access IN ( 0 )
AND cc.access IN ( 0 )
ORDER BY f.ordering


