root/branches/release-32/default_templates/search_results.mtml @ 1707

Revision 1707, 7.5 kB (checked in by bsmith, 20 months ago)

bugzid:69535 - less modularized template set committed. produces same html as modularized template set

  • Property svn:keywords set to Id Revision
Line 
1<MTSetVar name="search_results_template" value="1">
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                ];
22
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>
105<MTSearchResults>
106    <MTBlogResultHeader>
107                            <div id="search-results">
108                                <span id="current-page" class="hidden"><MTCurrentPage></span>
109                                <h1 id="page-title" class="search-results-header">
110        <MTIfStraightSearch>
111                                    <__trans phrase="Results matching &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>">
112        </MTIfStraightSearch>
113        <MTIfTagSearch>
114                                    <__trans phrase="Results tagged &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>">
115        </MTIfTagSearch>
116                                </h1>
117                                <div class="search-results-container autopagerize_page_element">
118    </MTBlogResultHeader>
119                                    <$MTInclude module="<__trans phrase="Entry Summary">" hide_counts="1"$>
120    <MTBlogResultFooter>
121                                </div><div class="autopagerize_insert_before"></div>
122
123    <MTIgnore><!-- Used with the ajax search capability of the new search class --></MTIgnore>
124                                <div class="content-nav">
125                                    <MTIfPreviousResults><a href="<MTPreviousLink>" rel="prev" onclick="return swapContent(-1);">&lt; <__trans phrase="Previous"></a>&nbsp;&nbsp;</MTIfPreviousResults><MTPagerBlock><MTIfCurrentPage><MTVar name="__value__"><MTElse><a href="<MTPagerLink>"><MTVar name="__value__"></a></MTIfCurrentPage><mt:unless name="__last__">&nbsp;</mt:unless></MTPagerBlock><MTIfMoreResults>&nbsp;&nbsp;<a href="<MTNextLink>" rel="next" onclick="return swapContent();"><__trans phrase="Next"> &gt;</a></MTIfMoreResults>
126                                </div>
127                            </div>
128    </MTBlogResultFooter>
129</MTSearchResults>
130
131
132<mt:ignore><!-- Display no results message --></mt:ignore>
133<MTNoSearchResults>
134                            <h1 id="page-title" class="search-results-header">
135    <MTIfStraightSearch>
136                                <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$MTSearchString$>">
137    </MTIfStraightSearch>
138    <MTIfTagSearch>
139                                <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$MTSearchString$>">
140    </MTIfTagSearch>
141                            </h1>
142                            <p><__trans phrase="No results found for &ldquo;[_1]&rdquo;." params="<$MTSearchString$>"></p>
143</MTNoSearchResults>
144
145
146<mt:ignore><!-- Display instructions for searching if search script was accessed without a query --></mt:ignore>
147<MTNoSearch>
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>
158</MTNoSearch>
159
160<MTIgnore><!-- Used with the ajax search capability of the new search class --></MTIgnore>
161<MTIfMoreResults>
162<script type="text/javascript">
163<!--
164var div = document.getElementById('search-results');
165var results = {
166    '<MTCurrentPage>': {
167        'content': div.innerHTML,
168        'next_url': '<MTNextLink>'
169    }
170};
171var timer = window.setTimeout("getResults(" + <MTCurrentPage> + ")", 1*1000);
172//-->
173</script>
174</MTIfMoreResults>
175
176
177                        </div>
178                    </div>
179
180                    <$MTInclude module="<__trans phrase="Sidebar">"$>
181
182
183                </div>
184            </div>
185
186
187            <$mt:include module="<__trans phrase="Banner Footer">"$>
188
189
190        </div>
191    </div>
192</body>
193</html>
Note: See TracBrowser for help on using the browser.