redirect if ($search == strtolower($name)) { header("Location: $path$item"); exit; } array_push($result,array($path,$item)); } } $showresults = 1; } elseif(isset($_GET['fulltext'])) { $result = SearchDir('sdk/'); $showresults = 2; } } } function SearchDir($path) { if(!$dir = opendir($path)) return; $result = array(); $search = strtolower($_GET['search']); while (false !== ($file = readdir($dir))) { if ($file != "." && $file != "..") { if(is_dir($path.$file)) $result = array_merge($result, SearchDir($path.$file.'/')); else { // HTML-Dokument auslesen $doc = new DOMDocument(); @$doc->loadHTMLFile($path.$file); $divs = $doc->getElementsByTagName('div'); foreach($divs as $div) { if(strpos($div->getAttribute('class'), 'text') !== false) { if(strpos(strtolower(strip_tags($div->nodeValue)),htmlspecialchars($search)) !== false) { $dirname = basename(rtrim($path, '/')); if(!isset($result[$dirname])) $result[$dirname] = array(); $name = $doc->getElementsByTagName('h1')->item(0)->nodeValue; array_push($result[$dirname], array($path.$file,$name)); break; } } } } } } closedir($dir); return $result; } ?> OpenClonk <?php echo $lang == 'de' ? 'Referenz' : 'Reference' ?>

'; echo ' '; echo ''; ?>
array('sdk' => 'Dokumentation', 'script' => 'Script', 'fn' => 'Funktionen', 'scenario' => 'Szenario', 'particle' => 'Partikel', 'material' => 'Material', 'folder' => 'Rundenordner', 'definition' => 'Objektdefinition'), 'en' => array('sdk' => 'Documentation', 'script' => 'Script', 'fn' => 'Functions', 'scenario' => 'Scenario', 'particle' => 'Particle', 'material' => 'Material', 'folder' => 'Folder', 'definition' => 'Definition')); //nothing found if($showresults == 1) { if (count($result) == 0) { echo $lang == 'de' ? 'Es wurde keine Funktion gefunden.' : 'No function found.'; } else { echo "\n"; } } elseif($showresults == 2) { if (count($result) == 0) { echo $lang == 'de' ? 'Nichts gefunden.' : 'Nothing found.'; } else { foreach($result as $dirname => $values) { $dirname = $dirtrans[$lang][$dirname]; echo "$dirname\n"; echo "\n"; } } } ?>