From f35a7b0e70032de2feec9f3bda09da44cf0e1073 Mon Sep 17 00:00:00 2001 From: srv Date: Mon, 28 Apr 2025 17:11:28 -0500 Subject: first commit --- content/pages/buscar.php.md | 195 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 content/pages/buscar.php.md (limited to 'content/pages/buscar.php.md') diff --git a/content/pages/buscar.php.md b/content/pages/buscar.php.md new file mode 100644 index 0000000..e9de76a --- /dev/null +++ b/content/pages/buscar.php.md @@ -0,0 +1,195 @@ +Author: Jorge Maldonado Ventura +Date: 2017-04-22 20:38 +Modified: 2020-06-11 11:38 +Save_as: buscar.php +Status: hidden +Title: Resultados + +
+ 0) { + $score += 10 * $match_count; + } + + } + if ($score != 0) { + $found_results[] = [ + 'score' => $score, + 'title' => $page['title'], + 'time' => $page['time'], + 'videoThumbnail' => $page['videoThumbnail'], + 'url' => $page['url'], + 'published' => $page['published'], + 'publishedText' => $page['publishedText'], + 'author' => $page['author'], + 'authorUrl' => $page['authorUrl'], + ]; + } + } + + /** + * Compare results score. + */ + function comp_result_score($a, $b) { + if ($a['score'] == $b['score']) { + return 0; + } + return ($a['score'] > $b['score']) ? -1 : 1; + }; + + if ($stop_words_ignored) { + printf(' +
+
%s
+
+
', 'Algunas palabras «comunes» fueron ignoradas'); + } + + $found_results_count = count($found_results); + + if ($found_results_count > 0) { + usort($found_results, 'comp_result_score'); + if ($found_results_count == 1) { + $found_results_count_str = NULL; + } + } else if ($found_results_count == 0) { + $found_results_count_str = NULL; + printf('
%s
', 'No se ha encontrado nada'); + } + + // Init head + printf(' +
+
'); + foreach ($found_results as $found_result) { + printf(' + ', + $found_result['url'], $found_result['videoThumbnail'], $found_result['title'], + $found_result['time'], $found_result['url'], $found_result['title'], + $found_result['title'], $found_result['published'], $found_result['publishedText'], + $found_result['authorUrl'], $found_result['author']); + } + +} else { + printf('
%s
', 'Aún no has buscado'); +} +// End head +printf('
+
'); +?> +
-- cgit v1.2.3