2006-06-16 23:53:56 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
2014-04-18 22:54:28 +00:00
|
|
|
// Copyright (C) 2014 University of California
|
2008-08-05 22:43:14 +00:00
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
// Allows users to search for a post or thread.
|
|
|
|
// Sends to forum_search_action.php for action and display.
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
require_once('../inc/forum.inc');
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2014-04-18 22:54:28 +00:00
|
|
|
if (DISABLE_FORUMS) error_page("Forums are disabled");
|
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("forumid"));
|
|
|
|
|
2007-11-02 14:43:02 +00:00
|
|
|
page_head(tra("Forum search"));
|
2006-06-16 23:53:56 +00:00
|
|
|
|
|
|
|
start_table();
|
|
|
|
echo "<form action=\"forum_search_action.php\" method=\"post\">";
|
2011-08-25 22:12:48 +00:00
|
|
|
row1(tra("Search query"));
|
|
|
|
row2(tra("Search for keywords:")."<br />
|
|
|
|
<span class=\"smalltext\">".tra("Posts that contain all the specified words will be displayed")."</span>",
|
2011-08-28 21:27:52 +00:00
|
|
|
"<input type=\"text\" style=\"width: 290px\" name=\"search_keywords\" size=\"30\" /><br />
|
2011-08-25 22:12:48 +00:00
|
|
|
<span class=\"smalltext\">".tra("For example: \"screensaver freeze\"")."</span>");
|
|
|
|
row2(tra("Search for author ID:")."<br />
|
|
|
|
<span class=\"smalltext\">".tra("Only posts by this author will be displayed")."</span>",
|
|
|
|
"<input type=\"text\" style=\"width: 150px\" name=\"search_author\" size=\"10\" /><br />
|
|
|
|
<span class=\"smalltext\">".tra("For example: \"43214\"")."</span>");
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2011-08-25 22:12:48 +00:00
|
|
|
row1(tra("Search options"));
|
|
|
|
row2(tra("Search limits")."<br />
|
|
|
|
<span class=\"smalltext\">".tra("Search at most this many days back in time")."</span>",
|
|
|
|
"<select name=\"search_max_time\">
|
|
|
|
<option value=\"1\">".tra("1 day")."</option>
|
|
|
|
<option value=\"3\">".tra("%1 days", "3")."</option>
|
|
|
|
<option value=\"7\">".tra("%1 days", "7")."</option>
|
|
|
|
<option value=\"15\">".tra("%1 days", "15")."</option>
|
|
|
|
<option value=\"30\" selected>".tra("%1 days", "30")."</option>
|
|
|
|
<option value=\"90\">".tra("%1 months", "3")."</option>
|
|
|
|
<option value=\"180\">".tra("%1 months", "6")."</option>
|
2011-09-06 04:34:29 +00:00
|
|
|
<option value=\"365\">".tra("1 year")."</option>
|
|
|
|
<option value=\"0\">".tra("no limit")."</option>
|
2011-08-25 22:12:48 +00:00
|
|
|
</select>");
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2007-10-12 17:58:50 +00:00
|
|
|
$forumid = null;
|
2006-06-16 23:53:56 +00:00
|
|
|
if (get_str("forumid",true)){
|
|
|
|
$forumid = get_str("forumid");
|
|
|
|
}
|
2011-08-25 22:12:48 +00:00
|
|
|
$forumlist="<option value=\"-1\">".tra("All")."</option>";
|
2007-11-12 20:57:15 +00:00
|
|
|
$categories = BoincCategory::enum();
|
|
|
|
foreach ($categories as $category) {
|
2007-11-25 04:47:54 +00:00
|
|
|
$forums = BoincForum::enum("parent_type=0 and category=$category->id");
|
2007-11-12 20:57:15 +00:00
|
|
|
foreach ($forums as $forum) {
|
|
|
|
if ($forum->id==$forumid){
|
|
|
|
$forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>";
|
|
|
|
} else {
|
|
|
|
$forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>";
|
|
|
|
}
|
2006-06-16 23:53:56 +00:00
|
|
|
}
|
|
|
|
}
|
2011-08-25 22:12:48 +00:00
|
|
|
row2(tra("Forum")."<br />
|
|
|
|
<span class=\"smalltext\">".tra("Only display posts from this forum")."</span>",
|
2006-06-16 23:53:56 +00:00
|
|
|
'<select name="search_forum">'.$forumlist.'</select');
|
|
|
|
|
2007-10-12 17:58:50 +00:00
|
|
|
$sortlist = null;
|
2006-06-16 23:53:56 +00:00
|
|
|
foreach ($thread_sort_styles as $id => $style){
|
2007-11-12 20:57:15 +00:00
|
|
|
if ($id == CREATE_TIME_NEW){
|
|
|
|
$sortlist.="<option selected value=\"".$id."\">".$style."</option>";
|
|
|
|
} else {
|
|
|
|
$sortlist.="<option value=\"".$id."\">".$style."</option>";
|
|
|
|
}
|
2006-06-16 23:53:56 +00:00
|
|
|
}
|
2011-08-25 22:12:48 +00:00
|
|
|
row2(tra("Sort by"),
|
2006-06-16 23:53:56 +00:00
|
|
|
'<select name="search_sort">'.$sortlist.'</select');
|
|
|
|
|
|
|
|
row1(" ");
|
2011-08-25 22:12:48 +00:00
|
|
|
row2("","<input type=\"submit\" value=\"".tra("Start the search")."\">");
|
2006-06-16 23:53:56 +00:00
|
|
|
echo "</form>";
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
2006-06-16 23:53:56 +00:00
|
|
|
?>
|