📄 searchresults.jsp
字号:
<script language="JavaScript" type="text/javascript"><!--document.searchform.q.focus();//--></script><% // Get the Iterator of results: Iterator results = action.getResults(); if (results != null) { // counter for num results int resultNum = action.getResultStart();%> <div class="jive-search-results"> <table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr> <th colspan="2" style="text-align:left;border-bottom:1px #ccc solid;"> <% if (action.getResultCount() == 0) { %> <%-- No Results - please try a less restrictive search. --%> <jive:i18n key="search.no_results" /> <% } else { %> <%-- Results: {NUM} --%> <jive:i18n key="search.result_count"> <jive:arg> <%= action.getNumberFormat().format(action.getResultCount()) %> </jive:arg> </jive:i18n> <% if (queryText != null) { %> <%-- Search Terms: {terms} --%> <jive:i18n key="search.search_terms_display"> <jive:arg> <%= StringUtils.escapeHTMLTags(queryText) %> </jive:arg> </jive:i18n> <% } %> <% } %> </th> </tr> <% if (action.getCorrectedQ() != null) { %> <tr> <td align="right" width="1%" nowrap> <%-- Perhaps You Meant: --%> <span class="jive-error-text"> <jive:i18n key="search.did_you_mean" /><jive:i18n key="global.colon" /> </span> </td> <td colspan="2" width="99%"> <a href="search!execute.jspa?<ww:property value="correctedSearchParams" />"> <ww:property value="correctedQ" /></a> </td> </tr> <% } %> <% Paginator paginator = new Paginator(action); if (action.getResultCount() > 0 && paginator.getNumPages() > 1) { %> <tr> <td colspan="2" style="text-align:left;border-bottom:1px #ccc solid;"> <jive:cache id="paginator"> <%-- Pages: XXX --%> <jive:i18n key="global.pages" /><jive:i18n key="global.colon" /> <%= paginator.getNumPages() %> <% if (paginator.getNumPages() > 1) { %> <span class="jive-paginator"> [ <% if (paginator.getPreviousPage()) { %> <%-- previous --%> <a href="search!execute.jspa?<%= action.getSearchParams() %>&start=<%= paginator.getPreviousPageStart() %>" ><jive:i18n key="global.previous" /></a> | <% } %> <%-- show result page numbers --%> <% Page[] pages = paginator.getPages(); for (int i=0; i<pages.length; i++) { %> <% if (pages[i] != null) { %> <a href="search!execute.jspa?<%= action.getSearchParams() %>&start=<%= pages[i].getStart() %>" class="<%= ((pages[i].getStart()==action.getStart()) ? "jive-current" : "") %>" ><%= pages[i].getNumber() %></a> <% } else { %> ... <% } %> <% } %> <% if (paginator.getNextPage()) { %> <%-- previous --%> | <a href="search!execute.jspa?<%= action.getSearchParams() %>&start=<%= paginator.getNextPageStart() %>" ><jive:i18n key="global.next" /></a> <% } %> ] </span> <% } %> </jive:cache> </td> </tr> <% } %> <tr><td colspan="2"> </td></tr> </table> <%-- Loop through all search results for this page: --%> <% while (results.hasNext()) { ForumMessage message = (ForumMessage)results.next(); %> <table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr valign="top"> <td width="1%"><%= (resultNum++) %>)</td> <td width="99%"> <span class="jive-search-result"> <a href="thread.jspa?forumID=<%= message.getForumThread().getForum().getID() %>&threadID=<%= message.getForumThread().getID() %>&messageID=<%= message.getID() %>#<%= message.getID() %>" ><%= message.getSubject() %></a> <br> <span class="jive-info"> <%-- Posted on: {date}, by: {user} --%> <jive:i18n key="search.search_result_info"> <jive:arg> <%= action.getDateFormat().format(message.getCreationDate()) %> </jive:arg> <jive:arg> <% if (message.getUser() != null) { %> <a href="profile.jspa?userID=<%= message.getUser().getID() %>" ><%= message.getUser().getUsername() %></a> <% } else { %> <%-- use a guest bean to format the display of guest properties --%> <% Guest guest = new Guest(); guest.setMessage(message); %> <% if (guest.getEmail() != null) { %> <i><a href="mailto:<%= StringUtils.escapeHTMLTags(guest.getEmail()) %>" ><%= guest.getDisplay() %></a></i> <% } else { %> <i><%= guest.getDisplay() %></i> <% } %> <% } %> </jive:arg> </jive:i18n> </span> <% if (queryText != null) { %> <br> <% String bodyPreview = action.getMessageBodyPreview(message); if (bodyPreview != null) { %> <span class="jive-body"> <%= bodyPreview %> </span> <% } %> <% } %> </span> <% if (action.isDisplayPerThread() && action.getThreadID() == null) { %> <br> <span> <a href="search!execute.jspa?<%=action.getSearchParams()%>&threadID=<%= message.getForumThread().getID() %>"><jive:i18n key="search.search_within_thread"/></a> <span> <% } %> <br><br> </td> </tr> </table> <% } %> <% if (results != null) { %> <table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr> <td colspan="2" style="text-align:left;border-top:1px #ccc solid;"> <jive:cache id="paginator" /> </td> </tr> </table> <% } %> </span><% } else { %> <% if (queryText != null) { %> <br><hr size="0"> <p> <%-- No search results for "{0}". You should try a less restrictive search. --%> <jive:i18n key="search.no_results_query"> <jive:arg> <%= StringUtils.escapeHTMLTags(queryText) %> </jive:arg> </jive:i18n> </p> <% } %><% } %><jsp:include page="footer.jsp" flush="true" /><%! // Method for printing spacers String getSpacer(String spacer, int num) { if (num <= 1) { return spacer; } StringBuffer buf = new StringBuffer(spacer.length()*num); for (int i=0; i<num; i++) { buf.append(spacer); } return buf.toString(); }%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -