Hoe kan ik in onderstaan de sql een beperking invoeren dat de eerste 3 die bij frontpage staaan NIET worden weergeven?
Het is nogal een ingewikkelde sql...
dus.. de 3 eerste die ook in _content_fontpage (b.id_content) staan mogen NIET worden weergegeven
<?
$query = "SELECT a.id, a.title, a.introtext, a.fulltext, a.sectionid, a.catid, a.$created as created, a.created_by, a.created_by_alias, a.hits, a.images"
. "\n FROM #__content AS a"
. "\n LEFT JOIN #__content_frontpage AS b ON b.content_id = a.id"
. "\n LEFT JOIN #__users AS c ON c.id = a.created_by"
. "\n LEFT JOIN #__sections AS d ON d.id = a.sectionid"
. "\n LEFT JOIN #__categories AS e ON e.id = a.catid"
. "\n WHERE (a.state = '1')"
. "\n AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= NOW())"
. "\n AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= NOW())"
. "\n AND (d.published = '1')"
. "\n AND (e.published = '1')"
. ($set_section_id_extra ? "\n AND (a.sectionid IN ($set_section_id_extra) )" : '')
. ($set_category_id_extra ? "\n AND (a.catid IN ($set_category_id_extra) )" : '')
. ($show_frontpage == "n" ? "\n AND (b.content_id IS NULL)" : '')
. ($show_frontpage == "only" ? "\n AND (b.content_id = a.id)" : '')
. ($set_article_id ? "\n AND (a.id IN ($set_article_id) )" : '')
. ($set_author_id ? "\n AND (a.created_by IN ($set_author_id) )" : '')
. ($set_author_name ? "\n AND (c.name IN ($set_author_name))" : '')
. ($set_author_alias ? "\n AND (a.created_by_alias IN ('$set_author_alias'))" : '')
. ($set_date_range <> NULL ? "\n AND (TO_DAYS(ADDDATE(NOW(), INTERVAL $mosConfig_offset HOUR)) - TO_DAYS(ADDDATE($created, INTERVAL $mosConfig_offset HOUR)) <= '$set_date_range' )" : '')
. ($set_date_today == "y" ? "\n AND (TO_DAYS(ADDDATE(NOW(), INTERVAL $mosConfig_offset HOUR)) = TO_DAYS(ADDDATE($created, INTERVAL $mosConfig_offset HOUR)))" : '')
. (isset($set_date_month) ? "\n AND ($set_date_month = MONTH(ADDDATE($created, INTERVAL $mosConfig_offset HOUR)))" : '')
. (isset($set_date_year) ? "\n AND ($set_date_year = YEAR(ADDDATE($created, INTERVAL $mosConfig_offset HOUR)))" : '')
. ( $access ? "\n AND a.access <= '$my->gid'" : '' )
. "\n ORDER BY $order_by";
?>
1.350 views