From 88b777db39070a4255d141edfb25112ab3788d3e Mon Sep 17 00:00:00 2001 From: Luqaska Date: Sat, 18 Dec 2021 20:01:17 +0000 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20'md.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md.php | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 md.php diff --git a/md.php b/md.php new file mode 100644 index 0000000..ab9cb37 --- /dev/null +++ b/md.php @@ -0,0 +1,98 @@ + +<?php if($is=="q"){$safeq=htmlentities($_GET["q"]);echo "'$safeq' - ";} echo $TITLE; ?> + + +# [Filde](md.php) + + +
+
+ > + +
+
+ +" . $words[0] . " ",$line); +} +return $line; +} + + +if($_SERVER["REQUEST_METHOD"] == "GET"){ + +$search_keyword = test_input($_GET["q"]); + + + +$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 "\n\n-----\n\n"; +$line = highlight($line,$search_keyword); +echo $line; +echo "\n\n-----\n\n"; +} +$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 "\n\n-----\n\n"; +$line = highlight($line,$search_keyword); +echo $line; +echo "\n\n-----\n\n"; +} +$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 "\n\n-----\n\n"; +$line = highlight($line,$search_keyword); +echo $line; +echo "\n\n-----\n\n"; +} +$t1=1; +} +} + +//} + +if($t1==0){echo "

( ̄ω ̄;) 0 results...

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

Load more (coming soon)

";} + +} +?> + + + \ No newline at end of file