0) $n+=1; if ($n==count($t)) $n/=count($nn); else $n=0; } return $n; } # Founded file processing # Работа с найденным файлом function process($f, $query, $m) { global $desc_header, $desc_footer, $real_loc, $all, $from, $showed, $pages, $color1, $color2, $explodestring, $color0, $interface_all, $lang_goto; if (inlist($f)) if (!is_dir($f)) if (queryfound($f, $query, $m)) { $all++; if (($all>=$from)&&($showed<$pages)) { if ((($showed>>1)<<1)==$showed) echo ""; else echo ""; echo str_replace("%1", $all, $interface_all); echo $desc_header; $fc=file($f); $s=implode($fc,$explodestring); $s=strip_tags($s); $fc=explode($explodestring,$s); $q=explode(" ",$query); for ($i=0; $i$q[$j]", strtolower($t)); $k=strpos(strtolower($t), strtolower($q[$j]), $k+7); } while ($k==0); echo "...$t..."; } } } $showed++; ##---------------------------------------------------------------- ## Maurizio: ## ## abilitare per visualizzare informazioni sui percorsi di ricerca # echo "

".$f."

"; # echo "

".$real_loc."

"; # echo "

".realpath($f)."

"; # echo "

".$lang_goto."

"; ##----------------------------------------------------------------- // ----------------------------------- tristano ---------------------------------------------------------------------------- echo "

$lang_goto > >

"; // ----------------------------------- tristano ---------------------------------------------------------------------------- echo $desc_footer; echo ""; } } } # Counting of suitable files # Подсчет (только подходящие файлы) function counting($f, $query, $m) { global $all; $n=0; if (inlist($f)) if (!is_dir($f)) if (queryfound($f, $query, $m)) $n++; $all+=$n; } # Counting # Подсчет function countdirs($q, $c) { $f="not empty value"; $dir=opendir("."); $f=readdir($dir); while ($f!="") { if (is_dir($f)) { if (($f!=".") && ($f!="..")) { chdir($f); countdirs($q, $c); chdir(".."); } } $f=readdir($dir); counting($f, $q, $c); } closedir($dir); } # Main search function # Главная функция поиска function alldirs($q, $c) { $f="not empty value"; $dir=opendir("."); $f=readdir($dir); while ($f!="") { if (is_dir($f)) { if (($f!=".") && ($f!="..")) { chdir($f); alldirs($q, $c); chdir(".."); } } $f=readdir($dir); process($f, $q, $c); } closedir($dir); } # ****************************> MAIN CODE <********************************* $all=0; $showed=0; if (!isset($from)) $from=1; if (!isset($query)) $query=""; $query=trim($query); $query=strip_tags($query); # Place Header place_header(); if ((isset($query))&&($query!="")) { chdir($start_search); countdirs($query, $m); if ($all>0) { echo "
".str_replace("%1", $all, $lang_wasfound)."

"; alldirs($query, $m); echo "
"; for ($k=1; $k<=$all; $k+=$pages) { echo "$k-"; if (($k+$pages)>$all) echo "$all "; else echo ($k-1+$pages)." "; if (!(($k+$pages)>$all)) echo $search_separator; } $all=0; echo "
"; for ($k=1; $k<=$all; $k+=$pages) { echo "$k-"; if (($k+$pages)>$all) echo "$all "; else echo ($k-1+$pages)." "; if (!(($k+$pages)>$all)) echo $search_separator; } echo "
"; } else echo "
$lang_nofiles
"; } else { echo "
$lang_noquery
"; } # Place Footer place_footer(); ?>