= $nbchar+strlen($mot)){ $gauche = substr($gauche,-$nbchar-strlen($mot)); $espace = strpos($gauche," "); $gauche = "...".substr($gauche,$espace+1); } $final .= $gauche; $final = substr($final,0,-strlen($mot)); $droite = strstr($chaine,$mot); if(strlen($droite)>=$nbchar){ $droite = substr($droite,0,$nbchar+strlen($mot)); $espace = strrpos($droite," "); $droite = substr($droite,0,$espace)."..."; } $final .= $droite; $final = str_replace($mot, "".$mot."", $final); return $final; } //=========================================================================================// function Extraire($texte,$max) { if (strlen($texte) > $max) { $espace = strpos($texte,' ',$max); $morceau = substr($texte,0,$espace).'...'; } else { $morceau = $texte; } return $morceau; } //=========================================================================================// // Suppression basique et brutale de tous les < ...> function supprimer_tags($texte, $rempl = "") { // super gavant : la regexp ci-dessous plante sous php3, genre boucle infinie ! // $texte = ereg_replace("< ([^>\"']*|\"[^\"]*\"|'[^']*')*>", $rempl, $texte); $texte = ereg_replace("< [^>]*>", $rempl, $texte); return $texte; } //=========================================================================================// // Convertit un texte HTML en texte brut function textebrut($texte) { $texte = ereg_replace("[\n\r]+", " ", $texte); $texte = eregi_replace("< (p|br)([[:space:]][^>]*)?".">", "\n\n", $texte); $texte = ereg_replace("^\n+", "", $texte); $texte = ereg_replace("\n+$", "", $texte); $texte = ereg_replace("\n +", "\n", $texte); $texte = supprimer_tags($texte); $texte = ereg_replace("( | )+", " ", $texte); return $texte; } //=========================================================================================// function htmltotxt($document){ $search = array('@]*?>.*?@si', // Strip out javascript '@]*?>.*?@siU', // Strip style tags properly '@<[?]php[^>].*?[?]>@si', //scripts php '@<[?][^>].*?[?]>@si', //scripts php '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@@' // Strip multi-line comments including CDATA );$text = preg_replace($search, '', $document); return $text; } //=========================================================================================// // convertit html en texte function htm2txt($text) { // Crée un tableau contenant les codes ascii des caractères // ayant un codage en html $ascii_array=array_merge(array(34,38,60,62),range(160,255)); // Crée un tableau contenant les caractères correspondants // aux codes ascci précédents $chars_array=array_map("chr", $ascii_array); // Crée un tableau contenant les mêmes caractères au format html $html_array=array_map("htmlentities", $chars_array); // Remplace les codes html par leurs équivalents txt dans le texte for($i=0; $i par \n dans le texte $text=ereg_replace("
","\n",$text); // Supprime les éventuelles balises html et php $text=strip_tags($text); // Retourne le texte traité return($text); } //=========================================================================================// // convertit html en texte function Html2Txt($text) { // Supprimer les caractéres d'espace au format HTML ( ) $text=ereg_replace(" ","§",$text); // Crée un tableau contenant les codes ascii des caractères // ayant un codage en html $ascii_array=array_merge(array(34,38,60,62),range(160,255)); // Crée un tableau contenant les caractères correspondants // aux codes ascci précédents $chars_array=array_map("chr", $ascii_array); // Crée un tableau contenant les mêmes caractères au format html $html_array=array_map("htmlentities", $chars_array); // Remplace les codes html par leurs équivalents txt dans le texte for($i=0; $i par \n dans le texte //** $text=ereg_replace("
","\n",$text); $text=ereg_replace("
","",$text); $text=ereg_replace("\n","",$text); $text=ereg_replace("\t","",$text); $text=ereg_replace("   ","",$text); $text=ereg_replace(" ","",$text); $text=preg_replace('/%([a-fA-F0-9][a-fA-F0-9])/', '-', $text); $text=preg_replace("/\\x0|[\x01-\x1f]/U","",$text); // Supprime les éventuelles balises html et php $text=strip_tags($text); // Supprime les retour chariot $text=str_replace("§§§","",$text); $text=str_replace("§§"," ",$text); $text=str_replace("§"," ",$text); $text=str_replace("\n", "", $text); $text=str_replace("\t", "", $text); $text=str_replace(" ", "", $text); $text=str_replace("", "", $text); $text=trim($text); // Retourne le texte traité return($text); } //=========================================================================================// // fonction permettant de supprimer les accents et les caratéres spéciaux function supprimeAccents($chaine){ $tofind = "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ#°:,;§!*<>=/'"; $replac = "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNnooooooooooooo"; return(strtr($chaine,$tofind,$replac)); } //=========================================================================================// //** Détecte si la page est au format http ou https function IsSSL() { if ($_SERVER['HTTPS'] == 'on') { $active_ssl = "1"; $prefix_http = "https://"; } else { $active_ssl = "0"; $prefix_http = "http://"; } //** return ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? TRUE : FALSE); return $prefix_http; } //=========================================================================================// // fontion permettant de transformer un texte en url function enleve_accents($chaine) { $reg = '/&(.)(acute|grave|circ|uml|cedil|ring|tilde|slash);/'; return preg_replace($reg, '\1', htmlentities($chaine)); } function enleve_ligatures($chaine) { $tab = array('½' => 'oe', '¼' => 'OE', 'ß' => 'ss'); foreach($tab as $key => $value) $chaine = str_replace($key, $value, $chaine); $reg = '|&([a-zA-Z]{2})lig;|'; return preg_replace($reg, '\1', $chaine); } function suppr_speciaux($chaine) { $reg = '|(&[a-zA-Z0-9]*wink.gif|U'; return preg_replace($reg, '-', $chaine); } function nettoie_url($texte) { if(is_utf8($texte)) $texte = utf8_decode($texte); $texte = strtolower(suppr_speciaux(enleve_ligatures(enleve_accents($texte)))); $reg = '|([^a-z0-9]+)|'; $texte = preg_replace($reg, '-', $texte); return trim($texte, '-'); } function is_utf8($string) { return !strlen( preg_replace( ',[\x09\x0A\x0D\x20-\x7E]' # ASCII . '|[\xC2-\xDF][\x80-\xBF]' # non-overlong 2-byte . '|\xE0[\xA0-\xBF][\x80-\xBF]' # excluding overlongs . '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}' # straight 3-byte . '|\xED[\x80-\x9F][\x80-\xBF]' # excluding surrogates . '|\xF0[\x90-\xBF][\x80-\xBF]{2}' # planes 1-3 . '|[\xF1-\xF3][\x80-\xBF]{3}' # planes 4-15 . '|\xF4[\x80-\x8F][\x80-\xBF]{2}' # plane 16 . ',sS', '', $string) ); } //=========================================================================================// ?> ISS Software - Recherchez une informations sur une page ou une news
 
 Service RECHERCHEZ UNE INFORMATION
$crlf"; //=========================================================================================// $page_web_search .= "$crlf"; //=========================================================================================// if ($tranchn == "") { $tranche="0"; } if ($res_cltn < "10") { $limit=""; } else { $limit=" LIMIT $tranchn,10 "; } $req_page = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_ortho or $req_titre_ortho or $req_desc_regex or $req_titre_regex order by date DESC $limit "); $res_page = MYSQL_NUM_ROWS($req_page); //** echo "SELECT * FROM pack_moteur_search where $req_desc_ortho or $req_titre_ortho or $req_desc_regex or $req_titre_regex order by date DESC $limit
Nb page: ".$res_page."
"; $ipage=0; WHILE($ipage!=$res_page) { $num_page = mysql_result($req_page,$ipage,"pagex"); $desc_page = mysql_result($req_page,$ipage,"descx"); $nom_page = mysql_result($req_page,$ipage,"nom_page"); $titre_page = mysql_result($req_page,$ipage,"titre_page"); $date_page = mysql_result($req_page,$ipage,"date"); $desc_page_decode = html_entity_decode($desc_page); //** $desc_page_decode = htmlspecialchars_decode($desc_page); $desc_page_nohtml = htm2txt($desc_page_decode); $desc_page_nohtml = htmltotxt($desc_page); $affich_resume = ""; $chaine = html_entity_decode($desc_page_nohtml); $nbchar = "150"; // Affichage du mot en minuscule $mot = strtolower($search_page); $affich_resume .= search($chaine, $mot, $nbchar); // Affichage du mot en majuscule $mot = strtoupper($search_page); $affich_resume .= search($chaine, $mot, $nbchar); // Affichage du mot donc la première lettre est en Majuscules $mot = ucfirst($search_page); $affich_resume .= search($chaine, $mot, $nbchar); //** $affich_resume = ""; // Si affich_resume est vide, on extrait les 150 première lettre du texte $affich_resume3 = Html2Txt($desc_page_nohtml); $affich_resume3 = Extraire($affich_resume3,"150"); //** $affich_resume3 = ""; //** $affich_resume .= html_entity_decode($affich_resume); $img_suite_news = "\"Suite\" Lire la suite"; $dates = explode(" ", $date_page); $datex=$dates[0]; $heurex=$dates[1]; $datesx = explode("-", $datex); $yearx=$datesx[0]; $monthx=$datesx[1]; $dayx=$datesx[2]; $moisx = nommois($monthx); $year_now = date("Y"); if ($yearx != $year_now && $affich_year != $yearx) { $page_web_search .= ""; $affich_year = $yearx; } if ($affich_resume == "") { $page_web_search .= ""; } else { $page_web_search .= ""; } /* if ($affich_resume == "") { $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; } else { $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; } */ $nbpg++; $ipage++; } //=========================================================================================// $page_web_search .= "
$crlf"; /* $page_web_search .= "$crlf"; if ($nbimg != "0") { $nbtt = $nb-$nb_limit; $page_web_search .= "$crlf"; } else { $page_web_search .= "$crlf"; } $page_web_search .= "$crlf"; }else { $page_web_search .= "$crlf"; } $page_web_search .= "$crlf"; */ $page_web_search .= "
 

Recherchez dans:

"; //=========================================================================================// $req_search = MYSQL_QUERY("SELECT * FROM pack_search where cle = '$cle_admin' && valid = '1' && mot LIKE '%".$search_page."%' "); $res_search = MYSQL_NUM_ROWS($req_search); $isearch=0; WHILE($isearch!=$res_search) { $id_search = mysql_result($req_search,$isearch,"id"); $nb_search = mysql_result($req_search,$isearch,"nbx"); $isearch++; } $ip_search = $_SERVER['REMOTE_ADDR']; $nav_search = $_SERVER['HTTP_USER_AGENT']; $hote_search = gethostbyaddr($ip_search); $date_search = date("Y-m-d H:i:s"); if ($res_search == "0") { $query_aj_word = "INSERT INTO pack_search (mot, nbx, valid, cle, languex, date_search, ip_search, nav_search, hote_search)"; $query_aj_word .= " VALUES('$search_page', '1', '1', '$cle_admin', 'fr', '$date_search', '$ip_search','$nav_search','$hote_search')"; $result_aj_word = mysql_query($query_aj_word); } else { $nb_search = $nb_search+1; $query_maj_word = "UPDATE pack_search"; $query_maj_word .= " SET nbx='$nb_search' WHERE id = '$id_search'"; $result_maj_word = mysql_query($query_maj_word); } //=========================================================================================// if ($search_type_news == "T" && $search_page != "") { $req_newsT = " && type = 'page' "; } else { $req_newsT = ""; } if ($search_type_news == "D" && $search_page != "") { $req_newsD = " && type = 'news' "; } else { $req_newsD = ""; } if ($search_type_news == "M" && $search_page != "") { $req_newsM = ""; } else { $req_newsM = ""; } $desc_sound = soundex($search_page); $approx_search = approx($search_page); $search_page_regex = $search_page; if (eregi ("f", $search_page_regex)) { $search_page_regex = str_replace("f","(f|ph)",$search_page_regex); $checkf="1"; } if ($checkf != "1" && eregi ("ph", $search_page_regex)) { $search_page_regex = str_replace("ph","(f|ph)",$search_page_regex); } if (eregi ("k", $search_page_regex)) { $search_page_regex = str_replace("k","(k|ch)",$search_page_regex); $checkk="1"; } if ($checkk != "1" && eregi ("ch", $search_page_regex)) { $search_page_regex = str_replace("k","(k|ch)",$search_page_regex); } if (eregi ("c", $search_page_regex)) { $search_page_regex = str_replace("c","(c|ç)",$search_page_regex); $checkc="1"; } if ($checkc != "1" && eregi ("ç", $search_page_regex)) { $search_page_regex = str_replace("ç","(c|ç)",$search_page_regex); } if (eregi ("ñ", $search_page_regex)) { $search_page_regex = str_replace("ñ","(n|ñ)",$search_page_regex); $checkn="1"; } if ($checkn != "1" && eregi ("n", $search_page_regex)) { $search_page_regex = str_replace("n","(n|ñ)",$search_page_regex); } if (eregi ("é", $search_page_regex)) { $search_page_regex = str_replace("é","(e|é|è|ê|ë)",$search_page_regex); $checke1="1"; } if ($checke1 != "1" && eregi ("è", $search_page_regex)) { $search_page_regex = str_replace("è","(e|é|è|ê|ë)",$search_page_regex); $checke2="1"; } if ($checke1 != "1" && $checke2 != "1" && eregi ("ê", $search_page_regex)) { $search_page_regex = str_replace("ê","(e|é|è|ê|ë)",$search_page_regex); $checke3="1"; } if ($checke1 != "1" && $checke2 != "1" && $checke3 != "1" && eregi ("ë", $search_page_regex)) { $search_page_regex = str_replace("ë","(e|é|è|ê|ë)",$search_page_regex); $checke4="1"; } if (eregi ("à", $search_page_regex)) { $search_page_regex = str_replace("à","(a|à|á|â|ã|ä|å)",$search_page_regex); $checka1="1"; } if ($checka1 != "1" && eregi ("á", $search_page_regex)) { $search_page_regex = str_replace("á","(a|à|á|â|ã|ä|å)",$search_page_regex); $checka2="1"; } if ($checka1 != "1" && $checka2 != "1" && eregi ("â", $search_page_regex)) { $search_page_regex = str_replace("â","(a|à|á|â|ã|ä|å)",$search_page_regex); $checka3="1"; } if ($checka1 != "1" && $checka2 != "1" && $checka3 != "1" && eregi ("ã", $search_page_regex)) { $search_page_regex = str_replace("ã","(a|à|á|â|ã|ä|å)",$search_page_regex); $checka4="1"; } if ($checka1 != "1" && $checka2 != "1" && $checka3 != "1" && $checka4 != "1" && eregi ("ä", $search_page_regex)) { $search_page_regex = str_replace("ä","(a|à|á|â|ã|ä|å)",$search_page_regex); $checka5="1"; } if ($checka1 != "1" && $checka2 != "1" && $checka3 != "1" && $checka4 != "1" && $checka5 != "1" && eregi ("å", $search_page_regex)) { $search_page_regex = str_replace("å","(a|à|á|â|ã|ä|å)",$search_page_regex); } if (eregi ("ì", $search_page_regex)) { $search_page_regex = str_replace("ì","(i|ì|í|î|ï)",$search_page_regex); $checki1="1"; } if ($checki1 != "1" && eregi ("í", $search_page_regex)) { $search_page_regex = str_replace("í","(i|ì|í|î|ï)",$search_page_regex); $checki2="1"; } if ($checki1 != "1" && $checki2 != "1" && eregi ("î", $search_page_regex)) { $search_page_regex = str_replace("î","(i|ì|í|î|ï)",$search_page_regex); $checki3="1"; } if ($checki1 != "1" && $checki2 != "1" && $checki3 != "1" && eregi ("ï", $search_page_regex)) { $search_page_regex = str_replace("ï","(i|ì|í|î|ï)",$search_page_regex); } if (eregi ("ù", $search_page_regex)) { $search_page_regex = str_replace("ù","(u|ù|ú|û|ü)",$search_page_regex); $checku1="1"; } if ($checku1 != "1" && eregi ("ú", $search_page_regex)) { $search_page_regex = str_replace("ú","(u|ù|ú|û|ü)",$search_page_regex); $checku2="1"; } if ($checku1 != "1" && $checku2 != "1" && eregi ("û", $search_page_regex)) { $search_page_regex = str_replace("û","(u|ù|ú|û|ü)",$search_page_regex); $checku3="1"; } if ($checku1 != "1" && $checku2 != "1" && $checku3 != "1" && eregi ("ü", $search_page_regex)) { $search_page_regex = str_replace("ü","(u|ù|ú|û|ü)",$search_page_regex); } if (eregi ("ò", $search_page_regex)) { $search_page_regex = str_replace("ò","(o|ò|ó|ô|õ|ö|ø)",$search_page_regex); $checko1="1"; } if ($checko1 != "1" && eregi ("ó", $search_page_regex)) { $search_page_regex = str_replace("ó","(o|ò|ó|ô|õ|ö|ø)",$search_page_regex); $checko2="1"; } if ($checko1 != "1" && $checko2 != "1" && eregi ("ô", $search_page_regex)) { $search_page_regex = str_replace("ô","(o|ò|ó|ô|õ|ö|ø)",$search_page_regex); $checko3="1"; } if ($checko1 != "1" && $checko2 != "1" && $checko3 != "1" && eregi ("õ", $search_page_regex)) { $search_page_regex = str_replace("õ","(o|ò|ó|ô|õ|ö|ø)",$search_page_regex); $checko4="1"; } if ($checko1 != "1" && $checko2 != "1" && $checko3 != "1" && $checko4 != "1" && eregi ("ö", $search_page_regex)) { $search_page_regex = str_replace("ö","(o|ò|ó|ô|õ|ö|ø)",$search_page_regex); $checko5="1"; } if ($checko1 != "1" && $checko2 != "1" && $checko3 != "1" && $checko4 != "1" && $checko5 != "1" && eregi ("ø", $search_page_regex)) { $search_page_regex = str_replace("ø","(o|ò|ó|ô|õ|ö|ø)",$search_page_regex); } if (eregi ("au", $search_page_regex)) { $search_page_regex = str_replace("au","(o|au)",$search_page_regex); $checko="1"; } if ($checko != "1" && eregi ("o", $search_page_regex)) { $search_page_regex = str_replace("o","(o|au)",$search_page_regex); } if (eregi ("ÿ", $search_page_regex)) { $search_page_regex = str_replace("ÿ","(y|ÿ)",$search_page_regex); $checky="1"; } if ($checky != "1" && eregi ("y", $search_page_regex)) { $search_page_regex = str_replace("y","(y|ÿ)",$search_page_regex); } if (eregi ("y", $search_page_regex)) { $search_page_regex = str_replace("y","(i|y)",$search_page_regex); $checki="1"; } if ($checki != "1" && eregi ("i", $search_page_regex)) { $search_page_regex = str_replace("i","(i|y)",$search_page_regex); } //** if (eregi ("au", $search_page_regex) && !eregi ("|au", $search_page_regex)) { $search_page_regex = str_replace("au","(o|au)",$search_page_regex); } $search_page_orthos = $search_page; $search_page_orthos = supprimeAccents($search_page_orthos); $search_page_orthos = strtolower($search_page_orthos); $test_pluriel = substr($search_page_orthos, -1); if ($test_pluriel == "s") { $search_page_orthos = str_replace("s","",$search_page_orthos); } if ($test_pluriel == "x") { $search_page_orthos = str_replace("x","",$search_page_orthos); } $search_page_orthos = str_replace("%","",$search_page_orthos); //** $search_page = str_replace(" ","%",$search_page); $search_page_orthos = str_replace("+"," ",$search_page_orthos); $search_page_orthos = str_replace('"'," ",$search_page_orthos); $search_page_orthos = str_replace("-"," ",$search_page_orthos); $search_page_orthos = str_replace(" ","%",$search_page_orthos); //** $search_page_orthos = str_replace("%%","%",$search_page_orthos); $lng_word_tt = strlen($search_page_orthos); $lng_word = ceil($lng_word_tt/2); //** $lng_word = floor($lng_word/2); $word_orthos = explode("%", $search_page_orthos); $nb_word = count($word_orthos); if ($nb_word > "1") { for ($iw=0;$iw<$nb_word;$iw++) { //** echo $word_orthos[$iw]."
"; $lng_words_tt = strlen($word_orthos[$iw]); $lng_words = ceil($lng_words_tt/2); if ($lng_words_tt > "5") { $search_page_ortho = chunk_split($search_page_orthos,$lng_words,"%"); } else { $search_page_ortho = $search_page_orthos."%"; } } } else { if ($lng_word_tt > "5") { $search_page_ortho = chunk_split($search_page_orthos,$lng_word,"%"); } else { $search_page_ortho = $search_page_orthos."%"; } } $search_page_ortho = str_replace("%%","%",$search_page_ortho); //** echo "Nb word: ".$nb_word."
Nbr total: ".$lng_word_tt."
Nbr: ".$lng_word."
Search normal: ".$search_page."
Search formater: ".$search_page_orthos."
Search ortho: ".$search_page_ortho."
"; //** $req_desc = " cle = '$cle_admin' && valid = '1' && descx LIKE '%".$search_page."%' $req_newsM $req_newsD $req_newsT "; //** $req_titre = " cle = '$cle_admin' && valid = '1' && titre_page LIKE '%".$search_page."%' $req_newsM $req_newsD $req_newsT "; //** $req_descs = " cle = '$cle_admin' && valid = '1' && descx LIKE '%".$search_page."%' "; //** $req_titres = " cle = '$cle_admin' && valid = '1' && titre_page LIKE '%".$search_page."%' "; $req_descs_ortho = " cle = '$cle_admin' && valid = '1' && descx LIKE '%".$search_page_ortho."%' "; $req_titres_ortho = " cle = '$cle_admin' && valid = '1' && titre_page LIKE '%".$search_page_ortho."%' "; $req_descs_regex = " cle = '$cle_admin' && valid = '1' && descx LIKE REGEXP '".$search_page_regex."' "; $req_titres_regex = " cle = '$cle_admin' && valid = '1' && titre_page REGEXP '".$search_page_regex."' "; $req_vide = " cle = '$cle_admin' && valid = '1' "; //** $req_desc_sound = " cle = '$cle_admin' && valid = '1' && soundex_code LIKE '%".$desc_sound."%' $req_newsM $req_newsD $req_newsT "; //** $req_desc_approx = " cle = '$cle_admin' && valid = '1' && descx LIKE '%".$approx_search."%' $req_newsM $req_newsD $req_newsT "; //** $req_titre_approx = " cle = '$cle_admin' && valid = '1' && titre_page LIKE '%".$approx_search."%' $req_newsM $req_newsD $req_newsT "; $req_desc_ortho = " cle = '$cle_admin' && valid = '1' && descx LIKE '%".$search_page_ortho."' $req_newsM $req_newsD $req_newsT "; $req_titre_ortho = " cle = '$cle_admin' && valid = '1' && titre_page LIKE '%".$search_page_ortho."' $req_newsM $req_newsD $req_newsT "; $req_desc_regex = " cle = '$cle_admin' && valid = '1' && descx REGEXP '".$search_page_regex."' $req_newsM $req_newsD $req_newsT "; $req_titre_regex = " cle = '$cle_admin' && valid = '1' && titre_page REGEXP '".$search_page_regex."' $req_newsM $req_newsD $req_newsT "; //** soundex(name)=soundex('$searchstring') $req_desc = $req_desc_ortho; $req_titre = $req_titre_ortho; $req_descs = $req_descs_ortho; $req_titres = $req_titres_ortho; //=========================================================================================// $xxsearch_page = "ok"; if ($xxsearch_page != "") { //** $word_sound = soundex($_GET['ville']); //** mysql_query('SELECT ville FROM table_ville WHERE ville = \'' . addslashes($_GET['ville']) . '\' OR soundex_code = \'' . $word_sound . '\''); // nom du formulaire //** $req_pagett = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc or $req_titre order by date DESC "); //** $req_pagett = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_approx or $req_titre_approx order by date DESC "); $req_pagett = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_ortho or $req_titre_ortho or $req_desc_regex or $req_titre_regex order by date DESC "); //** $req_pagett = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_regex order by date DESC "); //** $req_pagett = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_sound order by date DESC "); //** $req_pagett = MYSQL_QUERY("SELECT * MATCH (descx,titre_page) AGAINST ('$search_page') FROM pack_moteur_search "); //** $req_pagett = MYSQL_QUERY("SELECT id, descx, titre_page, nom_page, date,((0.05 * (MATCH (descx) AGAINST ('$search_page' IN BOOLEAN MODE))) AS relevance FROM pack_moteur_search WHERE ( MATCH (descx, titre_page) AGAINST ('$search_page' IN BOOLEAN MODE) ) AND valid='1' HAVING relevance > 0 ORDER BY relevance DESC "); $res_pagett = MYSQL_NUM_ROWS($req_pagett); //** echo "SELECT * FROM pack_moteur_search where $req_desc_ortho or $req_titre_ortho or $req_desc_regex order by date DESC
Nb: ".$res_pagett."
Longueur: ".$lng_word."
"; //** echo "SELECT * FROM pack_moteur_search where $req_desc or $req_titre or $req_desc_sound order by date DESC
Nb: ".$res_pagett."
"; //** echo "SELECT * FROM pack_moteur_search where $req_desc_sound order by date DESC
Nb: ".$res_pagett."
"; //** echo "SELECT id, descx, titre_page, nom_page, date,((X.XX * (MATCH (descx) AGAINST ('$search_page' IN BOOLEAN MODE))) AS relevance FROM pack_moteur_search WHERE ( MATCH (descx, titre_page) AGAINST ('$search_page' IN BOOLEAN MODE) ) AND valid='1' HAVING relevance > 0 ORDER BY relevance DESC
Nb: ".$res_pagett."
"; //** $res_pagett = $res_pagett-$nb_limit; $res_pagettx = "5"; //** echo "Soundex: ".soundex($search_page)."
Soundex 2: ".son2 ($search_page)."
Soundex 3: ".soundex2 ($search_page)."
Soundex 4: ".phonetique($search_page)."
"; if ($res_pagettx == "0") { /* $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; //** $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; $page_web_search .= "$crlf"; $page_web_search .= "
$res_page Résultat de votre recherche sur le mot ".ucfirst($search_page)."Nous n'avons trouvée aucune page contenant le mot "".ucfirst($search_page)."" recherchée.
$crlf"; */ } else { //=========================================================================================// $page_web_search .= "$crlf"; //=========================================================================================// $page_web_search .= ""; $tranche=$HTTP_GET_VARS[valeurtranche]; if ($tranche == "") { $tranche="0"; } if ($res_cltn < "10") { $limit=""; } else { $limit=" LIMIT $tranche,10 "; } $aff_search_news.=""; $page_web_search .= $aff_search_news; //=================================================================================================================// $page_web_search .= "
$crlf"; $page_web_search .= "$crlf"; $page_web_search .= ""; $aff_search_news .= ""; $aff_search_news .= "
$crlf"; //=========================================================================================// $don = $HTTP_GET_VARS[valeurtranche]; if ($don != "") { $donnee = explode("-", $don); $tranchn = $donnee[0]; $search_page = str_replace("searchnews_","",$donnee[1]); $search_page_type_news = str_replace("searchtypenews_","",$donnee[2]); $send = str_replace("send_","",$donnee[3]); } else { $tranchn = "0"; } //=========================================================================================// $page_web_search .= "$crlf"; $chm_img_cat = "images/"; $aff_search_news = ""; $aff_search_news.="$crlf"; //** $page_web_search .= "$crlf"; //** $aff_search_news .= "$crlf"; if ($search_page != "") { $aff_search_news .= "Nous avons trouvée $res_spage pages et $res_snews news contenant le mot "".ucfirst($search_page)."" recherchée.
$crlf"; } else { $aff_search_news .= "Il y a $res_spage pages et $res_snews news.
$crlf"; } //** $aff_search_news .= "$crlf"; } $aff_search_news .= $tranchexx." / ".$res_cltn." news"; } /*$aff_search_news .= "
"; //** $req_cltnx = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc or $req_titre order by date DESC limit $nb_limitp,$nb_limit "); //** $req_cltnx = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc or $req_titre order by date DESC "); $req_cltnx = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_ortho or $req_titre_ortho or $req_desc_regex or $req_titre_regex order by date DESC "); $res_cltnx = MYSQL_NUM_ROWS($req_cltnx); //** $req_cltn = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc or $req_titre order by date DESC "); $req_cltn = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_desc_ortho or $req_titre_ortho or $req_desc_regex or $req_titre_regex order by date DESC "); $res_cltn = MYSQL_NUM_ROWS($req_cltn); //** echo "SELECT * FROM pack_moteur_search where $req_desc or $req_titre order by date DESC
Nb: ".$res_cltn."
"; //** $res_cltn = $res_cltn-$nb_limit; /* if($res_cltn > 0) { //** echo "Positif
"; } else { $res_cltn = "0"; //** echo "Negatif
"; } */ //** echo "Nb search: ".$res_cltn." - ".$res_cltnx."
"; if ($search_page == "") { $req_spage = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_vide && type = 'page' order by date DESC "); $res_spage = MYSQL_NUM_ROWS($req_spage); //echo "SELECT * FROM pack_moteur_search where $req_descs && type = 'page' order by date DESC
Nb page: ".$res_spage."
"; $req_snews = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_vide && type = 'news' order by date DESC "); $res_snews = MYSQL_NUM_ROWS($req_snews); //** echo "SELECT * FROM pack_moteur_search where $req_descs && type = 'news' order by date DESC
Nb news: ".$res_snews."
"; } else { $req_spage = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_descs && type = 'page' or $req_titres && type = 'page' or $req_descs_regex && type = 'page' or $req_titres_regex && type = 'page' order by date DESC "); $res_spage = MYSQL_NUM_ROWS($req_spage); //** echo "SELECT * FROM pack_moteur_search where $req_descs && type = 'page' or $req_titres && type = 'page' order by date DESC
Nb page: ".$res_spage."
"; $req_snews = MYSQL_QUERY("SELECT * FROM pack_moteur_search where $req_descs && type = 'news' or $req_titres && type = 'news' or $req_descs_regex && type = 'news' or $req_titres_regex && type = 'news' order by date DESC "); $res_snews = MYSQL_NUM_ROWS($req_snews); } $tranchexx=$tranchn+10; if ($tranchexx > $res_cltn) { $tranchexx=$res_cltn; } if ($res_cltn == "0") { $search_mot = soundex2 ($search_page); $aff_search_news .= "Désolé, nous n'avons pas de pages et news contenant le mot $search_page ! $search_mot "; } else { if ($res_cltn != "0") { //** $aff_search_news .= "
$res_page Résultat de votre recherche sur le mot ".ucfirst($search_page)."Nous avons trouvée [nb_page] page(s) contenant le mot "".ucfirst($search_page)."" recherchée.
"; $aff_search_news .= ""; $aff_search_news .= "
";*/ $tranche=0+$valeurtranche; if ($tranche == 0) { $tranche=0; } $nb_page=$res_cltn/10; $nb_page=ceil($nb_page); $pagex=$tranche/10; $pagexm1=$pagex-1; $pagexm2=$pagex-2; $pagexm3=$pagex-3; $pagexm4=$pagex-4; $pagexm5=$pagex-5; $pagexp1=$pagex+1; $pagexp2=$pagex+2; $pagexp3=$pagex+3; $pagexp4=$pagex+4; $pagexp5=$pagex+5; // } // echo $res_cltn; if ($res_cltn > "10") { if ($valeurtranche == 0) { //** http://www.iss-software.fr/rechercher-sur-le-site.php?cle=iss-software&search=service&nb=0 //** valeurtranche=$tranc-searchnews_$search_page-searchtypenews_$search_page_type_news-send_1 //** cle=$cle_admin&search=$search_page&nb=$tranc $aff_search_news .= "
"; $aff_search_news .= "\"Debut\" [1], "; $nb_pagexx=$nb_page-1; if ($pagexp1 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+10; $aff_search_news .= "2, "; } if ($pagexp2 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+20; $aff_search_news .= "3, "; } if ($pagexp3 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+30; $aff_search_news .= "4, "; } if ($pagexp4 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+40; $aff_search_news .= "5, "; } if ($pagexmmx < 6) { $txt_p = "... "; } else { $txt_p = ""; } if ($pagexp5 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+50; $aff_search_news .= "6$txt_p"; } $tranc=$nb_pagexx*10; $pagexmmx=$nb_pagexx+1; $trancnb=$HTTP_GET_VARS[valeurtranche]; $tranc_nb=$valeurtranche+10; $aff_search_news .= "$pagexmmx "; $aff_search_news .= "\"Page  "; $aff_search_news .= "\"Dernière"; $aff_search_news .= "
"; } else { $aff_search_news .= "
"; $aff_search_news .= "\"Page  "; $trancnbx=$HTTP_GET_VARS[valeurtranche]; $tranc_nbx=$valeurtranche-10; $aff_search_news .= "\"Première "; if ($pagexm5 < 0) { $aff_search_news .= ""; } else { $tranc=$valeurtranche-50; $pagexmm5=$pagexm5+1; $aff_search_news .= "".$pagexmm5.", "; } if ($pagexm4 < 0) { $aff_search_news .= ""; } else { $tranc=$valeurtranche-40; $pagexmm4=$pagexm4+1; $aff_search_news .= "".$pagexmm4.", "; } if ($pagexm3 < 0) { $aff_search_news .= ""; } else { $tranc=$valeurtranche-30; $pagexmm3=$pagexm3+1; $aff_search_news .= "".$pagexmm3.", "; } if ($pagexm2 < 0) { $aff_search_news .= ""; } else { $tranc=$valeurtranche-20; $pagexmm2=$pagexm2+1; $aff_search_news .= "".$pagexmm2.", "; } if ($pagexm1 < 0) { $aff_search_news .= ""; } else { $tranc=$valeurtranche-10; $pagexmm1=$pagexm1+1; $aff_search_news .= "".$pagexmm1.", "; } $pagexmm=$pagex+1; $aff_search_news .= "[".$pagexmm."], "; $nb_pagexx=$nb_page-1; if ($pagexp1 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+10; $pagexpp1=$pagexp1+1; $aff_search_news .= "".$pagexpp1.", "; } if ($pagexp2 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+20; $pagexpp2=$pagexp2+1; $aff_search_news .= "".$pagexpp2.", "; } if ($pagexp3 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+30; $pagexpp3=$pagexp3+1; $aff_search_news .= "".$pagexpp3.", "; } if ($pagexp4 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+40; $pagexpp4=$pagexp4+1; $aff_search_news .= "".$pagexpp4.", "; } if ($pagexp5 >= $nb_pagexx) { $aff_search_news .= ""; } else { $tranc=$valeurtranche+50; $pagexpp5=$pagexp5+1; if ($pagexmmx < 6) { $txt_p = "... "; } else { $txt_p = ""; } $aff_search_news .= "".$pagexpp5."$txt_p"; } $tranc=$nb_pagexx*10; if ($nb_pagexx == $pagex) { $aff_search_news .= " \"Fin\""; } else { $pagexpp=$nb_pagexx+1; $trancnb=$HTTP_GET_VARS[valeurtranche]; $tranc_nb=$valeurtranche+10; $aff_search_news .= "".$pagexpp." "; $aff_search_news .= "\"Page  "; $aff_search_news .= "\"Dernière"; } $aff_search_news .= "
"; } /*$aff_search_news .= "
"; $aff_search_news .= ""; $aff_search_news .= "
";*/ } /*$aff_search_news .= "
";*/ //** $aff_search_news .= "
 
$crlf"; $page_web_search .= "
Résultat(s) précédent(s)  $crlf"; if ($nbimg == "0") { $page_web_search .= "1/".$res_pagett; } else { $page_web_search .= $nb."/".$res_pagett; } if ($res_pagett > $nb_limitp) { $nbtt = $nb+$nb_limit; $page_web_search .= "Résultat(s) suivant(s)  
$crlf"; $page_web_search .= "
 
\"Suite\" Année $yearx
"; $page_web_search .= "
 
"; $page_web_search .= ""; $page_web_search .= ""; $page_web_search .= "
$moisx
\"spacer\"
$dayx
".$titre_page."
".$affich_resume3.$img_suite_news."
"; $page_web_search .= "
 
"; $page_web_search .= ""; $page_web_search .= ""; $page_web_search .= "
$moisx
\"spacer\"
$dayx
".$titre_page."
".$affich_resume.$img_suite_news."
"; $page_web_search .= "
 
".$puce_search."".$titre_page."
".$affich_resume3."
 
".$puce_search."".$titre_page."
".$affich_resume."
 
$crlf"; } } //=========================================================================================// //** [nb_page] $nbpgtt = $nbpg; $page_web_search = str_replace("[nb_page]",$res_pagett,$page_web_search); echo $page_web_search; //=========================================================================================// ?>