Hello everyone!
I have a serious problems with Ditto snippet.
Now I’m working on site with catalog of places for children and their parents.
I’m using Ditto to display pages. Every page is a MODx resource with TV-params:
adrtype - type of address - street, square, avenue, etc. (DropDown List menu, possible values are "Street||Square||Avenue||.....", default value is "Street");
bld - building # (text);
city - city name (text, default value is "Moscow");
country - country name (DropDown List menu, possible values are "Russia||Ukraine", default value is "Russia");
email - object’s official e-mail address (text);
img1 - photo 1 (image);
img2 - photo 2 (image);
lat - lattitude for Google Maps (text);
lng - lengtitude for Google Maps (text);
phone - phone number (text);
placetype - type of place - cinema, aquapark, restaurant, etc. (DropDown List menu, possible values are "any type||Aquapark||......", default value is "any type");
strName - street/square/avenue/... name (text);
www - Website URL (text).
Ditto is called from my own snippet. The call contains
&filter field:
$filter="country,$country,1|city,$city,1";
if($adrstreet!="") $filter.="|strName,$adrstreet,1";
if($adrtype!="") $filter.="|adrtype,$adrtype,1";
if($bld!="") $filter.="|bld,$bld,1";
if($placetype!="") $filter.="|placetype,$placetype,1";
$out=$modx->runSnippet("Ditto",array("tpl"=>"placesRow",
"filter"=>$filter,
"startID"=>$places_root_page,
"display"=>"all",
"noResults"=>"<h2>Nothing was found :(...</h2>"
));
New places (i.e. new resources) are being added by web-users using docManager (document.class.php). TVs are also added in this way.
THE PROBLEM IS that I can add ONLY ONE place for every city. When the next place is added to resources tree via my docManager call, the page with Ditto crashes.
Fatal error: Cannot redeclare inputclean() (previously declared in Z:\home\r0\www\manager\includes\document.parser.class.inc.php(814) : eval()'d code:34) in Z:\home\r0\www\manager\includes\document.parser.class.inc.php(814) : eval()'d code on line 57
(By the way, what the hell does inputclean() have to my snippet???)
If I try to set last added place to unpublished or deleted (via phpMyAdmin, setting
published or
deleted field to zero) - everything works fine.
MODx info:
MODx Evolution 1.0.5 @ Apache(WIN7)+PHP5.2+MySQL5 (Denwer v.3)