Son hali bu, artık AB adlı yazarın bugün 2 tane yazısı yayınlasa dahi, sadece yeni yazısı anasayfada görünüyor. Ama Anasayfadaki yazarları üst üste dizilişleri tarihe göre değil, categori ID'sinin büyüklüğüne göre oluyor. İstiyorum ki tarihe göre 10 tane yazar sıralansın.
$query = "SELECT a.*, u.name, u.username, cc.image AS image,"
." CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\":\", a.id, a.alias) ELSE a.id END as slug,"
." CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\":\", cc.id, cc.alias) ELSE cc.id END as catslug,'link' as link"
. "\n FROM #__content AS a"
. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id"
. "\n LEFT JOIN #__users AS u ON u.id = a.created_by"
. "\n INNER JOIN #__categories AS cc ON cc.id = a.catid"
. "\n INNER JOIN #__sections AS s ON s.id = a.sectionid"
. "\n WHERE ( a.state = 1 AND a.sectionid > 0 )"
. "\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) $user->get('aid') . " AND cc.access <= "
. (int) $user->get('aid') . " AND s.access <= " . (int) $user->get('aid') : '' )
. $whereCatid
. $whereSecid
. "\n AND ((TO_DAYS('" . date( 'Y-m-d', time()+$tzoffset*60*60 )
. "') - TO_DAYS(a.created)) <= '" . $period . "')"
. ( $show_front == '0' ? "\n AND f.content_id IS NULL" : '' )
. "\n AND s.published = 1"
. "\n AND cc.published = 1"
. "\n GROUP BY a.catid"
. "\n limit $skip," . $count;