17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1207 Views |
-
Creating new Site Reports

17 June 2008 at 4:54am Last edited: 17 June 2008 4:54am
Hi everyone.
I've read the tutorial about creating new site reports here and I've created the "All Pages" site report example.
I want to know is if it's possible to create custom site reports like "Pages edited in the last 2 weeks" but, instead of 2 weeks, I would like to have something like "Pages edited in the last 3 weeks" or "Pages edited in the last month".
Best regards. -
Re: Creating new Site Reports

17 June 2008 at 10:47am
You can just copy the Pages edited in the last 2 weeks reports code and change the date or something. Assuming you have read the Tutorial and understand how to write your own report class etc your records() method would be
// get latest 3 weeks (21 days) of edits
function records() {
return DataObject::get("SiteTree", "`SiteTree`.LastEdited > NOW() - INTERVAL 21 DAY", "`SiteTree`.`LastEdited` DESC");
}
| 1207 Views | ||
|
Page:
1
|
Go to Top |


