[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [websites/quality-kde-org] website/api.kde.org: improved searching with wildcard support
From:       Allen Winter <allen.winter () kdab ! com>
Date:       2013-11-08 14:42:40
Message-ID: E1VenGi-0007IV-Fe () scm ! kde ! org
[Download RAW message or body]

Git commit 80b2a5e1969ab150e74aa407729f8a03e0a89d42 by Allen Winter.
Committed on 08/11/2013 at 14:40.
Pushed by winterz into branch 'master'.

improved searching with wildcard support

CCMAIL: reeves.87@gmail.com

M  +2    -2    website/api.kde.org/mapsearcher.php

http://commits.kde.org/websites/quality-kde-org/80b2a5e1969ab150e74aa407729f8a03e0a89d42


diff --git a/website/api.kde.org/mapsearcher.php \
b/website/api.kde.org/mapsearcher.php index 648beda..c21eba0 100644
--- a/website/api.kde.org/mapsearcher.php
+++ b/website/api.kde.org/mapsearcher.php
@@ -28,7 +28,7 @@ if (!empty($class)) {
 		if (file_exists($path)) {
 			include $path;
 			$loclass = strtolower( $class ); #ensure all the map generators output lower case \
                search terms
-			$potential_files = array_keys($map, $loclass);
+			$potential_files = array_keys(preg_grep("/$loclass/", $map));#match *.$loclass.* \
instead of just $loclass  $count = count($potential_files);
 			if ($count == 0) {
 				# Nothing found, return to index via bailout below.
@@ -72,7 +72,7 @@ if ($count <= 1) {
 		$m=str_replace("-apidocs","",$mpart);
 		$bclass=str_replace("_1_1","::",str_replace(".html","",str_replace("class","",basename($file))));
                
                 $project_url="http://api.kde.org/$cpart/$mpart/$p/html/index.html";
-		echo "<li><a href=\"$file\">$class</a> in module $m-$c, project <a \
href=\"$project_url\">$p</a></li>\n"; +		echo "<li><a href=\"$file\">$bclass</a> in \
module $m-$c, project <a href=\"$project_url\">$p</a></li>\n";  } 
 	echo "</ul>";
 	include 'footer.inc';


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic