The simple way to separate article trash from active articles is to get the state datafield of the table #__content equals to 1.
1 2 3 4 5 6 7 8 9 10 11 | $query = "SELECT a.*, n.*, t.*, n.link as linkThisPage" . "\n FROM #__componentnews_news AS n" . "\n LEFT JOIN #__content AS a ON a.id = n.pr_id" . "\n LEFT JOIN #__componentnews_types AS t ON t.id = n.type_id" . "\n WHERE ( a.state = 1 )" . "\n AND ( a.publish_up = " .$database->Quote($nullDate) . " OR a.publish_up <= " . $database->Quote($now) . ")" . "\n AND ( a.publish_down = " . $database->Quote($nullDate) . " OR a.publish_down >= " . $database->Quote($now) . " )" . "\n ORDER BY $orderby" . "\n limit $skip," . $count; |
Where in this query . "\n WHERE ( a.state = 1 )" should do it.
