Merge pull request #605 from fermionic/20130204-events-request-too-many-dates

limit event queries to one month even if no finish date is specified
This commit is contained in:
friendica 2013-02-05 17:36:58 -08:00
commit b00426c9fb

View file

@ -260,13 +260,15 @@ function events_content(&$a) {
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`, $r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id`
WHERE `event`.`uid` = %d and event.ignore = %d WHERE `event`.`uid` = %d and event.ignore = %d
AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' ) AND (( `adjust` = 0 AND ( `finish` >= '%s' OR ( nofinish AND start >= '%s' ) ) AND `start` <= '%s' )
OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' )) ", OR ( `adjust` = 1 AND ( `finish` >= '%s' OR ( nofinish AND start >= '%s' ) ) AND `start` <= '%s' )) ",
intval(local_user()), intval(local_user()),
intval($ignored), intval($ignored),
dbesc($start), dbesc($start),
dbesc($start),
dbesc($finish), dbesc($finish),
dbesc($adjust_start), dbesc($adjust_start),
dbesc($adjust_start),
dbesc($adjust_finish) dbesc($adjust_finish)
); );
} }