mirror of https://github.com/BOINC/boinc.git
Remove redundant search boxes from the bottom of the forum pages
svn path=/trunk/boinc/; revision=12660
This commit is contained in:
parent
9c06b48c2d
commit
5f7ed5b8fc
|
@ -393,34 +393,38 @@ function end_forum_table() {
|
|||
/**
|
||||
* Output the forum/thread title.
|
||||
**/
|
||||
function show_forum_title($forum=NULL, $thread=NULL) {
|
||||
start_table_noborder();
|
||||
echo "<tr>\n";
|
||||
function show_forum_title($forum=NULL, $thread=NULL, $extended=true) {
|
||||
if ($extended) {
|
||||
start_table_noborder();
|
||||
echo "<tr>\n";
|
||||
|
||||
// Search
|
||||
echo "<td><form action=\"forum_search_action.php\" method=\"POST\">
|
||||
<input type=\"hidden\" name=\"search_max_time\" value=\"30\">
|
||||
<input type=\"hidden\" name=\"search_forum\" value=\"-1\">
|
||||
<input type=\"hidden\" name=\"search_sort\" value=\"5\">
|
||||
<input type=\"text\" name=\"search_keywords\">
|
||||
<input type=\"submit\" value=\"search\"><br>
|
||||
<span class=\"smalltext\"><a href=\"forum_search.php\">advanced search</a></span>
|
||||
</form>
|
||||
";
|
||||
echo "</td>\n";
|
||||
|
||||
$logged_in_user = get_logged_in_user(false);
|
||||
// Custom stuff for logged in user
|
||||
if ($logged_in_user) {
|
||||
echo "<td align=\"right\">\n";
|
||||
|
||||
// Private messages
|
||||
echo pm_notification($logged_in_user);
|
||||
|
||||
// Search
|
||||
echo "<td><form action=\"forum_search_action.php\" method=\"POST\">
|
||||
<input type=\"hidden\" name=\"search_max_time\" value=\"30\">
|
||||
<input type=\"hidden\" name=\"search_forum\" value=\"-1\">
|
||||
<input type=\"hidden\" name=\"search_sort\" value=\"5\">
|
||||
<input type=\"text\" name=\"search_keywords\">
|
||||
<input type=\"submit\" value=\"search\"><br>
|
||||
<span class=\"smalltext\"><a href=\"forum_search.php\">advanced search</a></span>
|
||||
</form>
|
||||
";
|
||||
echo "</td>\n";
|
||||
|
||||
|
||||
$logged_in_user = get_logged_in_user(false);
|
||||
// Custom stuff for logged in user
|
||||
if ($logged_in_user) {
|
||||
echo "<td align=\"right\">\n";
|
||||
|
||||
// Private messages
|
||||
echo pm_notification($logged_in_user);
|
||||
|
||||
echo "</td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
end_table();
|
||||
}
|
||||
echo "</tr>\n";
|
||||
end_table();
|
||||
|
||||
echo "<p>\n";
|
||||
if ($forum) {
|
||||
|
|
|
@ -36,7 +36,7 @@ echo "
|
|||
</p>
|
||||
";
|
||||
|
||||
show_forum_title(NULL, NULL, false);
|
||||
show_forum_title(NULL, NULL);
|
||||
start_forum_table(array(tr(FORUM_TOPIC), tr(FORUM_THREADS), tr(FORUM_POSTS), tr(FORUM_LAST_POST)));
|
||||
|
||||
$categories = $mainFactory->getCategories();
|
||||
|
|
|
@ -42,13 +42,13 @@ $title = cleanup_title($thread->getTitle());
|
|||
if (!$sort_style) {
|
||||
// get the sorting style from the user or a cookie
|
||||
if ($logged_in_user){
|
||||
$sort_style = $logged_in_user->getThreadSortStyle();
|
||||
$sort_style = $logged_in_user->getThreadSortStyle();
|
||||
} else {
|
||||
list($forum_style, $sort_style)=explode("|",$_COOKIE['sorting']);
|
||||
}
|
||||
} else {
|
||||
if ($logged_in_user){
|
||||
$logged_in_user->setThreadSortStyle($sort_style);
|
||||
$logged_in_user->setThreadSortStyle($sort_style);
|
||||
} else {
|
||||
list($forum_style,$old_style)=explode("|",$_COOKIE['sorting']);
|
||||
setcookie('sorting', implode("|",array($forum_style,$sort_style)), time()+3600*24*365);
|
||||
|
@ -72,25 +72,25 @@ show_forum_title($forum, $thread);
|
|||
if ($thread->getType()!=0 && $thread->getStatus()==0){
|
||||
$thread_owner = $thread->getOwner();
|
||||
if ($logged_in_user){
|
||||
if ($thread_owner->getID() == $logged_in_user->getID()){
|
||||
if ($thread->getPostCount()!=0) {
|
||||
// Show a "this question has been answered" to the author
|
||||
echo "<div class=\"helpdesk_note\">
|
||||
<form action=\"forum_thread_status.php\"><input type=\"hidden\" name=\"id\" value=\"".$thread->getID()."\">
|
||||
<input type=\"submit\" value=\"My question was answered\">
|
||||
</form>
|
||||
If your question has been adequately answered please click here to close it!
|
||||
</div>";
|
||||
}
|
||||
} else {
|
||||
// and a "I also got this question" to everyone else if they havent already told so
|
||||
echo "<div class=\"helpdesk_note\">
|
||||
<form action=\"forum_thread_vote.php\"><input type=\"hidden\" name=\"id\" value=\"".$thread->getID()."\">
|
||||
<input type=\"submit\" value=\"I've also got this question\">
|
||||
</form>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
if ($thread_owner->getID() == $logged_in_user->getID()){
|
||||
if ($thread->getPostCount()!=0) {
|
||||
// Show a "this question has been answered" to the author
|
||||
echo "<div class=\"helpdesk_note\">
|
||||
<form action=\"forum_thread_status.php\"><input type=\"hidden\" name=\"id\" value=\"".$thread->getID()."\">
|
||||
<input type=\"submit\" value=\"My question was answered\">
|
||||
</form>
|
||||
If your question has been adequately answered please click here to close it!
|
||||
</div>";
|
||||
}
|
||||
} else {
|
||||
// and a "I also got this question" to everyone else if they havent already told so
|
||||
echo "<div class=\"helpdesk_note\">
|
||||
<form action=\"forum_thread_vote.php\"><input type=\"hidden\" name=\"id\" value=\"".$thread->getID()."\">
|
||||
<input type=\"submit\" value=\"I've also got this question\">
|
||||
</form>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "
|
||||
|
@ -113,16 +113,16 @@ if ($thread->getType()!=0 && $thread->getStatus()==0){
|
|||
|
||||
//If the logged in user is moderator enable some extra features
|
||||
if ($logged_in_user && $logged_in_user->isSpecialUser(S_MODERATOR)){
|
||||
if ($thread->isHidden()){
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=unhide&thread=".$thread->getID()."$tokens\">Un-Delete this thread</a>";
|
||||
} else {
|
||||
echo "<br /><a href=\"forum_moderate_thread.php?action=hide&thread=".$thread->getID()."\">Delete this thread</a>";
|
||||
}
|
||||
if ($thread->isSticky()){
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=desticky&thread=".$thread->getID()."$tokens\">De-sticky this thread</a>";
|
||||
} else {
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=sticky&thread=".$thread->getID()."$tokens\">Make this thread sticky</a>";
|
||||
}
|
||||
if ($thread->isHidden()){
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=unhide&thread=".$thread->getID()."$tokens\">Un-Delete this thread</a>";
|
||||
} else {
|
||||
echo "<br /><a href=\"forum_moderate_thread.php?action=hide&thread=".$thread->getID()."\">Delete this thread</a>";
|
||||
}
|
||||
if ($thread->isSticky()){
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=desticky&thread=".$thread->getID()."$tokens\">De-sticky this thread</a>";
|
||||
} else {
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=sticky&thread=".$thread->getID()."$tokens\">Make this thread sticky</a>";
|
||||
}
|
||||
if ($thread->isLocked()) {
|
||||
echo "<br /><a href=\"forum_moderate_thread_action.php?action=unlock&thread=".$thread->getID()."$tokens\">Unlock thread</a>";
|
||||
} else {
|
||||
|
@ -147,7 +147,7 @@ if ($thread->getType()!=0 && $thread->getStatus()==0){
|
|||
end_forum_table();
|
||||
|
||||
echo "<p>".$reply_text;
|
||||
show_forum_title($forum, $thread);
|
||||
show_forum_title($forum, $thread, false);
|
||||
$thread->incViews();
|
||||
|
||||
page_tail();
|
||||
|
|
Loading…
Reference in New Issue