website_jukni/khanav/search.php
2017-12-29 15:51:59 +01:00

45 lines
No EOL
1.6 KiB
PHP

<?php require_once( "./common_tools.php" );
$khnav_search_result = '';
$khnav_search_input = check_get('khnav_search_input');
if ($khnav_search_input)
{
$cibles = 'khaganat.net';
$khnav_search_target = check_get('khnav_search_target');
if ( $khnav_search_target )
{
$cibles = $khnav_search_target;
}
// Recherche Wikhan
if ( $cibles == "https://khaganat.net/wikhan" )
{
$dokuwiki_url = 'https://khaganat.net/wikhan/doku.php?do=search&id='.urlencode($khnav_search_input);
header( 'location: '.$dokuwiki_url );
}
// Recherche um1
elseif ( $cibles == "https://khaganat.net/um1" )
{
$dokuwiki_url = 'https://khaganat.net/um1/doku.php?do=search&id='.urlencode($khnav_search_input);
header( 'location: '.$dokuwiki_url );
}
// Recherche mediateki
elseif ( $cibles == "https://khaganat.net/mediateki" )
{
$dokuwiki_url = 'https://khaganat.net/mediateki/doku.php?do=search&id='.urlencode($khnav_search_input);
header( 'location: '.$dokuwiki_url );
}
//Recherche Duckduckgo s'il n'y a rien d'autre
else
{
$duckduckgo_url = 'https://duckduckgo.com/';
$q3 = 'https://duckduckgo.com/?q=site%3A' . $cibles .'+'. urlencode($khnav_search_input) .'&kj=b&kn=1&kac=1'.'&ko=1&k1=1&kv=1&kaj=-1&t=&kam=osm';
$khnav_search_result = '<iframe class="kh_search_iframe" frameborder="1" name="c" src="'.$q3.'"> ></iframe>';
}
}
else
{
$khnav_search_result = "<div id='khnav_search_noresult'>Entrez quelque chose dans le champ pour une recherche !<br></div>";
}
?>