| 4 | | <MTSetVarBlock name="page_title"><__trans phrase="Search Results"></MTSetVarBlock> |
| 5 | | <MTSetVarBlock name="title"><$MTBlogName encode_html="1"$>: <$MTGetVar name="page_title"$></MTSetVarBlock> |
| 6 | | <MTIfStraightSearch> |
| 7 | | <MTSetVar name="search_type" value="search"> |
| 8 | | <MTElse> |
| 9 | | <MTSetVar name="search_type" value="tag"> |
| 10 | | </MTIfStraightSearch> |
| | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| | 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | 4 | <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard"> |
| | 5 | <head> |
| | 6 | <title><$MTBlogName encode_html="1"$>: <__trans phrase="Search Results"></title> |
| | 7 | <$mt:include module="<__trans phrase="HTML Head">"$> |
| | 8 | <MTIgnore>Below Javascript adds ajax search capability</MTIgnore> |
| | 9 | <script type="text/javascript"> |
| | 10 | <!-- |
| | 11 | <MTIfMoreResults> |
| | 12 | function getXmlHttp() { |
| | 13 | if ( !window.XMLHttpRequest ) { |
| | 14 | window.XMLHttpRequest = function() { |
| | 15 | var types = [ |
| | 16 | "Microsoft.XMLHTTP", |
| | 17 | "MSXML2.XMLHTTP.5.0", |
| | 18 | "MSXML2.XMLHTTP.4.0", |
| | 19 | "MSXML2.XMLHTTP.3.0", |
| | 20 | "MSXML2.XMLHTTP" |
| | 21 | ]; |
| 12 | | <MTSetVarTemplate id="search_results" name="search_results"> |
| 13 | | <div id="search-results"><span id="current-page" class="hidden"><MTCurrentPage></span> |
| | 23 | for ( var i = 0; i < types.length; i++ ) { |
| | 24 | try { |
| | 25 | return new ActiveXObject( types[ i ] ); |
| | 26 | } catch( e ) {} |
| | 27 | } |
| | 28 | |
| | 29 | return undefined; |
| | 30 | }; |
| | 31 | } |
| | 32 | if ( window.XMLHttpRequest ) |
| | 33 | return new XMLHttpRequest(); |
| | 34 | } |
| | 35 | |
| | 36 | function getResults(page) { |
| | 37 | page = parseInt(page); |
| | 38 | if (timer) window.clearTimeout(timer); |
| | 39 | var xh = getXmlHttp(); |
| | 40 | if (!xh) return false; |
| | 41 | var res = results[page]; |
| | 42 | if (!res) return; |
| | 43 | var url = res['next_url']; |
| | 44 | if (!url) return; |
| | 45 | |
| | 46 | xh.open('GET', url + '&format=js', true); |
| | 47 | xh.onreadystatechange = function() { |
| | 48 | if ( xh.readyState == 4 ) { |
| | 49 | if ( xh.status && ( xh.status != 200 ) ) { |
| | 50 | // error - ignore |
| | 51 | } else { |
| | 52 | try { |
| | 53 | var page_results = eval("(" + xh.responseText + ")"); |
| | 54 | if ( page_results['error'] == null ) |
| | 55 | results[page + 1] = page_results['result']; |
| | 56 | } catch (e) { |
| | 57 | } |
| | 58 | } |
| | 59 | } |
| | 60 | }; |
| | 61 | xh.send(null); |
| | 62 | } |
| | 63 | |
| | 64 | function swapContent(direction) { |
| | 65 | if ( direction == undefined ) direction = 1; |
| | 66 | var page_span = document.getElementById('current-page'); |
| | 67 | if (!page_span) return true; |
| | 68 | var next_page = direction + parseInt(page_span.innerHTML); |
| | 69 | var res = results[next_page]; |
| | 70 | if (!res) return true; |
| | 71 | var content = res['content']; |
| | 72 | if (!content) return true; |
| | 73 | var div = document.getElementById('search-results'); |
| | 74 | if (!div) return true; |
| | 75 | div.innerHTML = content; |
| | 76 | timer = window.setTimeout("getResults(" + next_page + ")", 1*1000); |
| | 77 | window.scroll(0, 0); |
| | 78 | return false; |
| | 79 | } |
| | 80 | <MTElse><MTIfPreviousResults> |
| | 81 | function swapContent(direction) { |
| | 82 | return true; |
| | 83 | }</MTIfPreviousResults> |
| | 84 | </MTIfMoreResults> |
| | 85 | //--> |
| | 86 | </script> |
| | 87 | </head> |
| | 88 | <body class="mt-search-results <$MTVar name="page_layout"$>"> |
| | 89 | <div id="container"> |
| | 90 | <div id="container-inner"> |
| | 91 | |
| | 92 | |
| | 93 | <$mt:include module="<__trans phrase="Banner Header">"$> |
| | 94 | |
| | 95 | |
| | 96 | <div id="content"> |
| | 97 | <div id="content-inner"> |
| | 98 | |
| | 99 | |
| | 100 | <div id="alpha"> |
| | 101 | <div id="alpha-inner"> |
| | 102 | |
| | 103 | |
| | 104 | <mt:ignore><!-- Display search results --></mt:ignore> |
| 54 | | for ( var i = 0; i < types.length; i++ ) { |
| 55 | | try { |
| 56 | | return new ActiveXObject( types[ i ] ); |
| 57 | | } catch( e ) {} |
| 58 | | } |
| 59 | | |
| 60 | | return undefined; |
| 61 | | }; |
| 62 | | } |
| 63 | | if ( window.XMLHttpRequest ) |
| 64 | | return new XMLHttpRequest(); |
| 65 | | } |
| 66 | | |
| 67 | | function getResults(page) { |
| 68 | | page = parseInt(page); |
| 69 | | if (timer) window.clearTimeout(timer); |
| 70 | | var xh = getXmlHttp(); |
| 71 | | if (!xh) return false; |
| 72 | | var res = results[page]; |
| 73 | | if (!res) return; |
| 74 | | var url = res['next_url']; |
| 75 | | if (!url) return; |
| 76 | | |
| 77 | | xh.open('GET', url + '&format=js', true); |
| 78 | | xh.onreadystatechange = function() { |
| 79 | | if ( xh.readyState == 4 ) { |
| 80 | | if ( xh.status && ( xh.status != 200 ) ) { |
| 81 | | // error - ignore |
| 82 | | } else { |
| 83 | | try { |
| 84 | | var page_results = eval("(" + xh.responseText + ")"); |
| 85 | | if ( page_results['error'] == null ) |
| 86 | | results[page + 1] = page_results['result']; |
| 87 | | } catch (e) { |
| 88 | | } |
| 89 | | } |
| 90 | | } |
| 91 | | }; |
| 92 | | xh.send(null); |
| 93 | | } |
| 94 | | |
| 95 | | function swapContent(direction) { |
| 96 | | if ( direction == undefined ) direction = 1; |
| 97 | | var page_span = document.getElementById('current-page'); |
| 98 | | if (!page_span) return true; |
| 99 | | var next_page = direction + parseInt(page_span.innerHTML); |
| 100 | | var res = results[next_page]; |
| 101 | | if (!res) return true; |
| 102 | | var content = res['content']; |
| 103 | | if (!content) return true; |
| 104 | | var div = document.getElementById('search-results'); |
| 105 | | if (!div) return true; |
| 106 | | div.innerHTML = content; |
| 107 | | timer = window.setTimeout("getResults(" + next_page + ")", 1*1000); |
| 108 | | window.scroll(0, 0); |
| 109 | | return false; |
| 110 | | } |
| 111 | | <MTElse><MTIfPreviousResults> |
| 112 | | function swapContent(direction) { |
| 113 | | return true; |
| 114 | | }</MTIfPreviousResults> |
| 115 | | </MTIfMoreResults> |
| 116 | | //--> |
| 117 | | </script> |
| 118 | | </MTSetVarBlock> |
| 119 | | |
| 120 | | <$MTInclude module="<__trans phrase="Header">"$> |
| 121 | | |
| 122 | | <$MTVar name="search_results"$> |
| 123 | | |
| | 132 | <mt:ignore><!-- Display no results message --></mt:ignore> |
| 137 | | <h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1> |
| 138 | | <p><__trans phrase="By default, this search engine looks for all words in any order. To search for an exact phrase, enclose the phrase in quotes:"></p> |
| 139 | | <blockquote> |
| 140 | | <p><code>"<__trans phrase="movable type">"</code></p> |
| 141 | | </blockquote> |
| 142 | | <p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p> |
| 143 | | <blockquote> |
| 144 | | <p><code><__trans phrase="personal OR publishing"></code></p> |
| 145 | | <p><code><__trans phrase="publishing NOT personal"></code></p> |
| 146 | | </blockquote> |
| | 148 | <h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1> |
| | 149 | <p><__trans phrase="By default, this search engine looks for all words in any order. To search for an exact phrase, enclose the phrase in quotes:"></p> |
| | 150 | <blockquote> |
| | 151 | <p><code>"<__trans phrase="movable type">"</code></p> |
| | 152 | </blockquote> |
| | 153 | <p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p> |
| | 154 | <blockquote> |
| | 155 | <p><code><__trans phrase="personal OR publishing"></code></p> |
| | 156 | <p><code><__trans phrase="publishing NOT personal"></code></p> |
| | 157 | </blockquote> |