root/branches/release-33/default_templates/search_results.mtml @ 1729

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

bugzid:69530 - updated templates to use variables set by the app

  • Property svn:keywords set to Id Revision
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4<head>
5    <title><$MTBlogName encode_html="1"$>: <__trans phrase="Search Results"></title>
6    <$mt:include module="<__trans phrase="HTML Head">"$>
7    <MTIgnore>Below Javascript adds ajax search capability</MTIgnore>
8    <script type="text/javascript">
9    <!--
10    <MTIfMoreResults>
11    function getXmlHttp() {
12        if ( !window.XMLHttpRequest ) {
13            window.XMLHttpRequest = function() {
14                var types = [
15                    "Microsoft.XMLHTTP",
16                    "MSXML2.XMLHTTP.5.0",
17                    "MSXML2.XMLHTTP.4.0",
18                    "MSXML2.XMLHTTP.3.0",
19                    "MSXML2.XMLHTTP"
20                ];
21
22                for ( var i = 0; i < types.length; i++ ) {
23                    try {
24                        return new ActiveXObject( types[ i ] );
25                    } catch( e ) {}
26                }
27
28                return undefined;
29            };
30        }
31        if ( window.XMLHttpRequest )
32            return new XMLHttpRequest();
33    }
34
35    function getResults(page) {
36        page = parseInt(page);
37        if (timer) window.clearTimeout(timer);
38        var xh = getXmlHttp();
39        if (!xh) return false;
40        var res = results[page];
41        if (!res) return;
42        var url = res['next_url'];
43        if (!url) return;
44
45        xh.open('GET', url + '&format=js', true);
46        xh.onreadystatechange = function() {
47            if ( xh.readyState == 4 ) {
48                if ( xh.status && ( xh.status != 200 ) ) {
49                    // error - ignore
50                } else {
51                    try {
52                        var page_results = eval("(" + xh.responseText + ")");
53                        if ( page_results['error'] == null )
54                            results[page + 1] = page_results['result'];
55                    } catch (e) {
56                    }
57                }
58            }
59        };
60        xh.send(null);
61    }
62
63    function swapContent(direction) {
64        if ( direction == undefined ) direction = 1;
65        var page_span = document.getElementById('current-page');
66        if (!page_span) return true;
67        var next_page = direction + parseInt(page_span.innerHTML);
68        var res = results[next_page];
69        if (!res) return true;
70        var content = res['content'];
71        if (!content) return true;
72        var div = document.getElementById('search-results');
73        if (!div) return true;
74        div.innerHTML = content;
75        timer = window.setTimeout("getResults(" + next_page + ")", 1*1000);
76        window.scroll(0, 0);
77        return false;
78    }
79    <MTElse><MTIfPreviousResults>
80    function swapContent(direction) {
81        return true;
82    }</MTIfPreviousResults>
83    </MTIfMoreResults>
84    //-->
85    </script>
86</head>
87<body class="mt-search-results <$MTVar name="page_layout"$>">
88    <div id="container">
89        <div id="container-inner">
90
91
92            <$mt:include module="<__trans phrase="Banner Header">"$>
93
94
95            <div id="content">
96                <div id="content-inner">
97
98
99                    <div id="alpha">
100                        <div id="alpha-inner">
101
102
103<mt:ignore><!-- Display search results --></mt:ignore>
104<MTSearchResults>
105    <MTBlogResultHeader>
106                            <div id="search-results">
107                                <span id="current-page" class="hidden"><MTCurrentPage></span>
108                                <h1 id="page-title" class="search-results-header">
109        <MTIfStraightSearch>
110                                    <__trans phrase="Results matching &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>">
111        </MTIfStraightSearch>
112        <MTIfTagSearch>
113                                    <__trans phrase="Results tagged &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>">
114        </MTIfTagSearch>
115                                </h1>
116                                <div class="search-results-container autopagerize_page_element">
117    </MTBlogResultHeader>
118                                    <$MTInclude module="<__trans phrase="Entry Summary">" hide_counts="1"$>
119    <MTBlogResultFooter>
120                                </div><div class="autopagerize_insert_before"></div>
121
122    <MTIgnore><!-- Used with the ajax search capability of the new search class --></MTIgnore>
123                                <div class="content-nav">
124                                    <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>
125                                </div>
126                            </div>
127    </MTBlogResultFooter>
128</MTSearchResults>
129
130
131<mt:ignore><!-- Display no results message --></mt:ignore>
132<MTNoSearchResults>
133                            <h1 id="page-title" class="search-results-header">
134    <MTIfStraightSearch>
135                                <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$MTSearchString$>">
136    </MTIfStraightSearch>
137    <MTIfTagSearch>
138                                <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$MTSearchString$>">
139    </MTIfTagSearch>
140                            </h1>
141                            <p><__trans phrase="No results found for &ldquo;[_1]&rdquo;." params="<$MTSearchString$>"></p>
142</MTNoSearchResults>
143
144
145<mt:ignore><!-- Display instructions for searching if search script was accessed without a query --></mt:ignore>
146<MTNoSearch>
147                            <h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1>
148                            <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>
149                            <blockquote>
150                                <p><code>"<__trans phrase="movable type">"</code></p>
151                            </blockquote>
152                            <p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p>
153                            <blockquote>
154                                <p><code><__trans phrase="personal OR publishing"></code></p>
155                                <p><code><__trans phrase="publishing NOT personal"></code></p>
156                            </blockquote>
157</MTNoSearch>
158
159<MTIgnore><!-- Used with the ajax search capability of the new search class --></MTIgnore>
160<MTIfMoreResults>
161<script type="text/javascript">
162<!--
163var div = document.getElementById('search-results');
164var results = {
165    '<MTCurrentPage>': {
166        'content': div.innerHTML,
167        'next_url': '<MTNextLink>'
168    }
169};
170var timer = window.setTimeout("getResults(" + <MTCurrentPage> + ")", 1*1000);
171//-->
172</script>
173</MTIfMoreResults>
174
175
176                        </div>
177                    </div>
178
179                    <$MTInclude module="<__trans phrase="Sidebar">"$>
180
181
182                </div>
183            </div>
184
185
186            <$mt:include module="<__trans phrase="Banner Footer">"$>
187
188
189        </div>
190    </div>
191</body>
192</html>
Note: See TracBrowser for help on using the browser.