<?php
$database = & JFactory::getDBO();
$query = "SELECT asset_id FROM #__content WHERE state = 1";
$database->setQuery( $query );
$count_at = $database->loadObjectList();
$count_nbr = count($count_at);
?>
So $count_nbr returns all created and published articles, but i need to add “today” filter to it. If some guru could hep ot please… Need 2 types of filter: “1 day” and a “week”…
UPDATE: adding $date = date (Y-m-d); amd modifieng string to SELECT asset_id FROM #__content WHERE state = 1 AND publish_up = $date; doen’t help cause publish_up in mysql Y-m-d H:i:s and I need to ignore time stamp…
To get the articles published today:
This uses the MySQL
DATE_FORMAT()function to format that published date toY-m-dformat, so that you can compare it.To get articles published this week use the
YEARWEEK()function: