je cherche à modifier le module mod_latestnews.php j'aimerai sur le choix 3 pouvoir afficher les nouveaux articles ET les articles qui ont été mise à jour dernièrement.
Dois-je modifier la requete ou en faire une autre dans ce genre?
Code: Select all
SELECT DATE_FORMAT(modified,'".$dateformat."') AS mod_date, modified ?
Code: Select all
case 3:
//Both
$whereCatid = '';
if ($catid) {
$catids = explode( ',', $catid );
mosArrayToInts( $catids );
$whereCatid = "\n AND ( a.catid=" . implode( " OR a.catid=", $catids ) . " )";
}
$whereSecid = '';
if ($secid) {
$secids = explode( ',', $secid );
mosArrayToInts( $secids );
$whereSecid = "\n AND ( a.sectionid=" . implode( " OR a.sectionid=", $secids ) . " )";
}
$query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state"
. "\n FROM #__content AS a"
. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id"
. "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid"
. "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid"
. "\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 ) . " )"
. ( $access ? "\n AND a.access <= " . (int) $my->gid : '' )
. $whereCatid
. $whereSecid
. ( $show_front == '0' ? "\n AND f.content_id IS NULL" : '' )
. "\n ORDER BY a.created DESC"
;
$database->setQuery( $query, 0, $count );
$temp = $database->loadObjectList();
Bruno