I’m trying to modify to Ditto 1.1 beta (and 0.9.5 beta 1) to only show events that are happening on particular days of the upcoming week. On the Daily Guide page (as in the sample Document Tree below), I’m wanting to show a list of events that are occuring today (I’m also wanting to make subsequent pages that show events occurring on each of the following 6 days). The event pages have a tvEventDate that is set to Unixtime. I’m making a Ditto call from the Daily Guide page (as below) and get an error message instead. I’ve included my modifications to the filter.class.inc.php file, if that helps.
Sample Tree Structure:
Site Root
|
|-->Daily Guide (Document making modified Ditto call)
|
|-->Venues (ID = 6)
| |
| |-->Bar
|
|-->B
|
|-->Bar Beginning With B
|
|-->Upcoming Events
|
|-->Some Event (has TV = "EventDate)
[!Ditto? &startID=`6` &idType=`parents` &hideFolders=`1` &depth=`6` &seeThruUnpub=`1` &sortBy=`tvEventDate` &filter=`tvEventDate,5,dailyguide` &tpl=`BrowseVenuesMainDitto`!]
Inserting this in the function basicfilter()
case "dailyguide" :
$nextWeek = time() + (7 * 24 * 60 * 60);
$arrayday = getdate($value[$this->array_key]);
$DocumentsDay = $arrayday["wday"];
$TodaysDay = getdate();
$TD = $TodaysDay["wday"];
if ($DocumentsDay != $TD) {$unset = 0;}
if ($nextWeek< $value[$this->array_key]) {$unset = 0;}
break;
I get the following error:
PHP error debug
Error: getdate() expects parameter 1 to be long, string given
Error type/ Nr.: Warning - 2
File: /Library/WebServer/Documents/trunk/assets/snippets/ditto/classes/filter.class.inc.php
Line: 157
Line 157 source: $arrayday = getdate($value[$this->array_key]);
The thing is, the exact same call works on some pages - just not on a page that is not a parent of the documents that Ditto is filtering (as is the case with my Daily Guide page). Why it works on one page and not the other is a mystery.
Any help would be greatly, greatly appreciated. Maybe a better way of doing this.
Cheers
mark