En alttan ikinci satır uygun şekilde yazılırsa sitemdeki yazarların yazıları üst üste yayınlanmayacak, yeni yazısı geldiğinde eski yazıcı artık görenmeyecek.
GROUP BY a.catid yazdım mesela, öyle yapınca da artık tarihe göre seçmiyor.
GROUP BY a.catid AND a.created yazdım, o zaman da hangi yazarın son yazısı eklenmişse, sadece o yazarı yayınlayıp diğer yazarları yayınlamıyor, yani categori ve yazı sayılarını tek'e düşürüyor.
Ustaların fikirleri çerçevesinde yapabilirsem sevinirim. selamlar
$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 ORDER BY $orderby"
. "\n limit $skip," . $count;