Index: trunk/extensions/LuceneSearch.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | $limit = $wgRequest->getInt("limit"); |
63 | 63 | if ($limit < 1 || $limit > 50) |
64 | 64 | $limit = 20; |
65 | | - header("Content-Type: text/plain; charset=ISO_8859-1"); |
| 65 | + header("Content-Type: text/plain; charset=UTF-8"); |
66 | 66 | if (strlen($q) < 1) |
67 | 67 | wfAbruptExit(); |
68 | 68 | |
— | — | @@ -121,16 +121,16 @@ |
122 | 122 | $titles = $this->doTitleMatches($q); |
123 | 123 | if (count($titles) > 0) { |
124 | 124 | $sk =& $wgUser->getSkin(); |
125 | | - $nmtext = "<p>".wfMsg('searchnearmatches'); |
| 125 | + $nmtext = "<p>".wfMsg('searchnearmatches')."</p>"; |
126 | 126 | $i = 0; |
127 | | - $wgOut->addHTML("<ul>"); |
| 127 | + $nmtext .= "<ul>"; |
128 | 128 | foreach ($titles as $title) { |
129 | 129 | if (++$i > 5) break; |
130 | 130 | $nmtext .= wfMsg('searchnearmatch', |
131 | 131 | $sk->makeKnownLinkObj($title, '')); |
132 | 132 | } |
133 | 133 | $nmtext .= "</ul>"; |
134 | | - $nmtext .= "<hr/></p>"; |
| 134 | + $nmtext .= "<hr/>"; |
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | |
153 | 153 | $top = wfMsg("searchnumber", $offset + 1, |
154 | 154 | min($numresults, $offset+$limit), $numresults); |
155 | | - $out = "<ul start=".($offset + 1).">"; |
| 155 | + $out = "<ul>"; |
156 | 156 | $chunks = array_chunk($results, $limit); |
157 | 157 | $numchunks = ceil($numresults / $limit); |
158 | 158 | $whichchunk = $offset / $limit; |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | foreach ($chunks[$whichchunk] as $result) { |
184 | 184 | $out .= $this->showHit($result[0], $result[1], $contextWords); |
185 | 185 | } |
186 | | - $out .= "</ol>"; |
| 186 | + $out .= "</ul>"; |
187 | 187 | } |
188 | 188 | $wgOut->addHTML("<hr/>" . $top . $out); |
189 | 189 | $wgOut->addHTML("<hr/>" . $prevnext); |
— | — | @@ -389,7 +389,7 @@ |
390 | 390 | function makeSuggestJS() { |
391 | 391 | global $wgScript; |
392 | 392 | return <<<___EOF___ |
393 | | -<script language="javascript"> |
| 393 | +<script type="text/javascript"><!-- |
394 | 394 | |
395 | 395 | var xmlHttp = (window.XMLHttpRequest) ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"); |
396 | 396 | var searchCache = {}; |
— | — | @@ -398,14 +398,12 @@ |
399 | 399 | |
400 | 400 | function getResults() |
401 | 401 | { |
402 | | -// alert(searchStr) |
403 | | - //xmlHttp.open("GET", "$wgScript?title=Special:Search?gen=titlematch&ns0=0&limit=10&search=" + escape(searchStr), true); |
404 | 402 | var encStr = escape(searchStr.replace(/ /g, '_')); |
405 | | - xmlHttp.open("GET", "/w/Special:Search?gen=titlematch&ns0=0&limit=10&search=" + encStr, true); |
| 403 | + xmlHttp.open("GET", "$wgScript?title=Special:Search&gen=titlematch&ns0=0&limit=10&search=" |
| 404 | + + encStr, true); |
406 | 405 | |
407 | 406 | xmlHttp.onreadystatechange = parseResults; |
408 | 407 | xmlHttp.send(null); |
409 | | - //document.getElementById("results").innerHTML = "Loading..."; |
410 | 408 | } |
411 | 409 | |
412 | 410 | function parseResults() |
— | — | @@ -460,7 +458,7 @@ |
461 | 459 | document.getElementById("results").style.display = "none"; |
462 | 460 | } |
463 | 461 | } |
464 | | -</script> |
| 462 | +//--></script> |
465 | 463 | ___EOF___; |
466 | 464 | } |
467 | 465 | } |