>

Fork of Yessle - About

Wanna add a result? Go here

Submitions are now added automaticly

";} function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } function highlight($line,$search_keyword){ $number_of_words = str_word_count($search_keyword); $words = str_word_count($search_keyword,1); if($number_of_words==1){ $line = str_replace(" " . $words[0] . " ", " " . $words[0] . " ",$line); } return $line; } if($_SERVER["REQUEST_METHOD"] == "GET"){ $search_keyword = test_input($_GET["q"]); echo "

"; $txt = file_get_contents("database.txt"); $keyword = "/" . $search_keyword . "/i"; $keyword_with_space = "/" . " " . $search_keyword . " " . "/i"; $keyword_in_start_title = "/" . "" . $search_keyword . "" . "/i"; $t1=0; //while($t1 <= 9){ foreach(preg_split("/((\r?\n)|(\r\n?))/",$txt) as $line){ if($t1!=10&&preg_match($keyword_in_start_title,$line)){ if(!($search_keyword=="")){ echo "
"; $line = highlight($line,$search_keyword); echo $line; echo "
"; } $t1=1; } } foreach(preg_split("/((\r?\n)|(\r\n?))/",$txt) as $line){ if($t1!=10&&preg_match($keyword_with_space,$line)&&!(preg_match($keyword_in_start_title,$line))){ if(!($search_keyword=="")){ echo "
"; $line = highlight($line,$search_keyword); echo $line; echo "
"; } $t1=1; } } foreach(preg_split("/((\r?\n)|(\r\n?))/",$txt) as $line){ if($t1!=10&&preg_match($keyword,$line)&&!(preg_match($keyword_with_space,$line))&&!(preg_match($keyword_in_start_title,$line))){ if(!($search_keyword=="")){ echo "
"; $line = highlight($line,$search_keyword); echo $line; echo "
"; } $t1=1; } } //} if($t1==0){echo "

( ̄ω ̄;) 0 results...

";} if($t1==10&&$is=="q"){echo "

Load more (coming soon)

";} } ?>