Speeches

AddSolrParam('fq', 'docMetaPagetype:Speech'); $search->SetSmartyTitle('Speeches'); $search->SetSmartyTemplate('teaserlist.tpl'); //prüfen ob Mediatheksuche $medithekfilter = false; $data_format = array(); $data_category = array(); if(true==false){ //Suchfilter setzten if(isset($_POST['format']) || isset($_GET['format'])){ $format_data = array(); if (isset($_GET['format'])) $format_data[] = $_GET['format']; if (isset($_POST['format'])) $format_data[] = $_POST['format']; $i = 0; $fq_format =""; foreach( $format_data[0] as $format ) { if($i==0){ if ($format == 'Video'){$fq_format .= "(docMetaPagetype:".$format."')";} else {$fq_format .= "docMetaPagetype:".$format;} $data_format[$format] = $format; }else{ if ($format == 'Video'){$fq_format .= " OR (docMetaPagetype:".$format."')";} else {$fq_format .= " OR docMetaPagetype:".$format;} $data_format[$format] = $format; } $i++; } $search->AddSolrParam('fq', $fq_format); $medithekfilter = true; }else{ //$search->AddSolrParam('fq', 'docMetaPagetype:Video OR docMetaPagetype:Galerie OR docMetaPagetype:Audio'); $search->AddSolrParam('fq', '(docMetaPagetype:Video) OR docMetaPagetype:Galerie OR docMetaPagetype:Audio'); } if(isset($_POST['category']) || isset($_GET['category'])){ $category_data = array(); if (isset($_GET['category'])) $category_data[] = $_GET['category']; if (isset($_POST['category'])) $category_data[] = $_POST['category']; $i = 0; $fq_category = ""; foreach( $category_data[0] as $category ) { if($i==0){ $fq_category .= "docMetaCategory:".$category; $data_category[str_replace("ä", "ae", $category)] = $category; }else{ $fq_category .= " OR docMetaCategory:".$category; $data_category[str_replace("ä", "ae", $category)] = $category; } $i++; } $search->AddSolrParam('fq', $fq_category); $medithekfilter = true; } } //Filter $daterange = ''; $dr = ''; $sort = ''; $sortby = 'Aktualität'; $type = ''; $itemsperpage = 15; if (isset($_POST['ipp'])) $itemsperpage = $_POST['ipp']; if (isset($_GET['ipp'])) $itemsperpage = $_GET['ipp']; if (isset($_GET['dr'])) $dr = strtolower($_GET['dr']); if (isset($_POST['dr'])) $dr = strtolower($_POST['dr']); if (in_array($dr, array('l2w','l1m','l3m','l1y'))) $daterange = $dr; switch ($daterange) { case 'l2w': $search->AddSolrParam('fq', 'docDate:[NOW-14DAYS/DAY TO NOW/DAY+1DAY]'); break; case 'l1m': $search->AddSolrParam('fq', 'docDate:[NOW-1MONTH/DAY TO NOW/DAY+1DAY]'); break; case 'l3m': $search->AddSolrParam('fq', 'docDate:[NOW-3MONTHS/DAY TO NOW/DAY+1DAY]'); break; case 'l1y': $search->AddSolrParam('fq', 'docDate:[NOW-1YEAR/DAY TO NOW/DAY+1DAY]'); break; } if($q == ''){ $search->AddSolrParam('sort', 'docDate desc, docMetaDate desc');//später, wenn Sortierung nach Relevanz: if ($q == '') }else{ //Nach Datum oder Relevanz sortieren if(isset($_POST['sort']) || isset($_GET['sort'])){ if(isset($_POST['sort'])) $sortby = $_POST['sort']; if(isset($_GET['sort'])) $sortby = $_GET['sort']; }else{ $sortby = 'Aktualität'; } if($sortby=='Aktualität'){ $search->AddSolrParam('sort', 'docDate desc, docMetaDate desc'); } } //Nach Formaten Sortieren if(isset($_POST['type']) || isset($_GET['type'])){ if(isset($_POST['type'])) $type = $_POST['type']; if(isset($_GET['type'])) $type = $_GET['type']; if($type!='Alle'){ $search->AddSolrParam('fq', 'docMetaPagetype:"'.$type.'"'); } }else{ $type='Alle'; } $search->SetSmartyCustomValues( array( 'daterange' => $daterange, 'action_url' => '/de/suche.php', 'sortby' => $sortby, 'pagesize' => $itemsperpage, 'mediathekfilter' => $medithekfilter, 'data_format' => $data_format, 'data_category' => $data_category, 'type' => array( 'name' => 'Formate', 'fq' => 'docMetaPagetype', 'options' => $filterOptions, 'value' => $type ) ) ); $search->SetConfig( array( 'itemsperpage' => $itemsperpage, 'smarty' => array( 'caching' => true ) ) ); $search->Search('',0,'','',TRUE); echo $search->Output; ?>