PDA

Zobacz pełną wersję : Popularne - most read



appaloosa
29-03-2006, 18:47
szukam zamiennika modułu do wyświetlania popularnych newsów - ale z ograniczeniem czaswoym - czyli np starsze niż 2 tyg itd - macie coś takiego na oku , ew wiecie jak coś takiego zrobić :confused:

pozdrawiam

Reasumując mam warunek który wybiera z bazy newsy:


$query = "SELECT a.id, a.title, a.sectionid, a.catid"
. "\n FROM #__content AS a"
. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id"
. "\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 = '$nullDate' OR a.publish_up <= '$now' )"
. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
. ( $access ? "\n AND a.access <= $my->gid" : '' )
. ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' )
. ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' )
. ( $show_front == "0" ? "\n AND f.content_id IS NULL" : '' )
. "\n AND s.published = 1"
. "\n AND cc.published = 1"
. "\n ORDER BY a.hits DESC"
. "\n LIMIT $count"
;
$database->setQuery( $query );
$rows = $database->loadObjectList();

break;

Jak zrobić żeby nie pobierało postów których publish_up jest starsze niż '$now' -14 dni?

Pozdrawiam

Już sobie poradziłem ;-)

magic
30-03-2006, 13:49
A jak?

appaloosa
30-03-2006, 23:59
Zmodydikowałem warunek - przerobiony moduł dołączam do posta i liczę na oklaski i takie tam :D