[[!AdvSearch? &extractLength=`220` &queryHook=`ArticleSearchQHook` &extractEllipsis=`.` &contexts=`web,tech,data,main` &tpl=`articleSearchResult` &perPage=`10` &minChars=`2` &withTVs=`docGroup,post_category,post_subcategory,category` &fields=`pagetitle,longtitle,description,introtext,content,publishedon`]]
advanced-search-result?id=9817&asId=as0&pubfromdate=2012-11-01&pubtodate=2012-12-18&search=tech&sub=Search
This question has been answered by amitpatil. See the first response.
if (!empty($_REQUEST['pubfromdate']) && $pubfromdate = strtotime($_REQUEST['pubfromdate'])) {
$andConditions['modResource.publishedon:>'] = "{$pubfromdate}:numeric";
}
if (!empty($_REQUEST['pubtodate']) && $pubtodate = strtotime($_REQUEST['pubtodate'])) {
$andConditions['modResource.publishedon:<'] = "{$pubtodate}:numeric";
}
$andConditions = array();
if (!empty($_REQUEST['pubfromdate']) && $pubfromdate = strtotime($_REQUEST['pubfromdate'])) {
$andConditions['modResource.publishedon:>'] = "{$pubfromdate}:numeric";
}
if (!empty($_REQUEST['pubtodate']) && $pubtodate = strtotime($_REQUEST['pubtodate'])) {
$andConditions['modResource.publishedon:<'] = "{$pubtodate}:numeric";
}
$andConditions['tv.post_category:MATCH'] = 'ctg:request:all';
$andConditions['tv.post_subcategory:MATCH'] = 'type:request:all';
$qhDeclaration = array(
'qhVersion' => '1.2',
'andConditions' => $andConditions
);
$hook->setQueryHook($qhDeclaration);
return true;