web: forum and PM cleanup

- don't use tables when they're not needed.
    In light mode, bootstrap puts noisy lines around them

- use constants PM_LH_PCT and FORUM_LH_PCT for width
    of left (informational) column.

- show lists of posts (user posts, search results) in 2-column format

- use functions like row2() rather than <tr><td>...

- forums: show header (search box, PM links) only in top-level pages.
    Not needed on e.g. form for posting a message

- change page titles to say what you're looking at (forum, thread)

- use sprintf() instead of long concatenations

- make terminology consistent:
    you 'post' to a thread or you 'reply' to a message.
    You don't reply to a thread.
This commit is contained in:
David Anderson 2024-08-06 16:04:55 -07:00
parent 190fa61242
commit 631dab3155
11 changed files with 227 additions and 178 deletions

View File

@ -5,47 +5,44 @@ require_once("../inc/util.inc");
$bbcode_js = "<script type=\"text/javascript\" src=\"bbcode_toolbar.js\"></script>";
$bbcode_html = '
<tr>
<td>
<input type="button" class="btn btn-default btn-sm" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; " onClick="bbstyle(0)" title="'.tra("Bold text: [b]text[/b] (alt+b)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; " onClick="bbstyle(2)" title="'.tra("Italic text: [i]text[/i] (alt+i)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; " onClick="bbstyle(4)" title="'.tra("Underline text: [u]text[/u] (alt+u)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="k" name="addbbcode20" value=" k " style="text-decoration: line-through; " onClick="bbstyle(20)" title="'.tra("Strikethrough text: [s]text[/s] (alt+k)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="q" name="addbbcode6" value="Quote" onClick="bbstyle(6)" title="'.tra("Quote text: [quote]text[/quote] (alt+q)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="c" name="addbbcode8" value="Code" style="" onClick="bbstyle(8)" title="'.tra("Code display: [code]code[/code] (alt+c)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="l" name="addbbcode10" value="List" style="" onClick="bbstyle(10)" title="'.tra("List: [list]text[/list] (alt+l)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="o" name="addbbcode12" value="List=1" style="" onClick="bbstyle(12)" title="'.tra("Ordered list: [list=1]text[/list] (alt+o)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="p" name="addbbcode14" value="Img" style="" onClick="bbstyle(14)" title="'.tra("Insert image: [img]http://image_url[/img] (alt+p)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; " onClick="bbstyle(16)" title="'.tra("Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)").'" />
</td>
</tr>
<tr>
<td>
&nbsp;'.tra("Font color").':
<select style="color:#000;" name="addbbcode22" onChange="bbfontstyle(\'[color=\' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + \']\', \'[/color]\');this.selectedIndex=0;" title="'.tra("Font color: [color=red]text[/color] Tip: you can also use color=#FF0000").'" >
<option style="color:black" value="#000000" class="genmed">'.tra("Default").'</option>
<option style="color:darkred" value="darkred" class="genmed">'.tra("Dark Red").'</option>
<option style="color:red" value="red" class="genmed">'.tra("Red").'</option>
<option style="color:orange" value="orange" class="genmed">'.tra("Orange").'</option>
<option style="color:brown" value="brown" class="genmed">'.tra("Brown").'</option>
<option style="color:yellow" value="yellow" class="genmed">'.tra("Yellow").'</option>
<option style="color:green" value="green" class="genmed">'.tra("Green").'</option>
<option style="color:olive" value="olive" class="genmed">'.tra("Olive").'</option>
<option style="color:cyan" value="cyan" class="genmed">'.tra("Cyan").'</option>
<option style="color:blue" value="blue" class="genmed">'.tra("Blue").'</option>
<option style="color:darkblue" value="darkblue" class="genmed">'.tra("Dark Blue").'</option>
<option style="color:indigo" value="indigo" class="genmed">'.tra("Indigo").'</option>
<option style="color:violet" value="violet" class="genmed">'.tra("Violet").'</option>
</select>
&nbsp;'.tra("Font size").':
<select style="color:#000;" name="addbbcode24" onChange="bbfontstyle(\'[size=\' + this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value + \']\', \'[/size]\');this.selectedIndex=0;" title="'.tra("Font size: [size=x-small]small text[/size]").'" >
<option value="12" selected class="genmed">'.tra("Default").'</option>
<option value="9" class="genmed">'.tra("Small").'</option>
<option value="12" class="genmed">'.tra("Normal").'</option>
<option value="18" class="genmed">'.tra("Large").'</option>
</select>
&nbsp;
<a href="javascript:bbstyle(-1)" title='.tra("Close all open bbCode tags").'>'.tra("Close Tags").'</a>
</td>
</tr>
<p>
<input type="button" class="btn btn-default btn-sm" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; " onClick="bbstyle(0)" title="'.tra("Bold text: [b]text[/b] (alt+b)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; " onClick="bbstyle(2)" title="'.tra("Italic text: [i]text[/i] (alt+i)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; " onClick="bbstyle(4)" title="'.tra("Underline text: [u]text[/u] (alt+u)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="k" name="addbbcode20" value=" k " style="text-decoration: line-through; " onClick="bbstyle(20)" title="'.tra("Strikethrough text: [s]text[/s] (alt+k)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="q" name="addbbcode6" value="Quote" onClick="bbstyle(6)" title="'.tra("Quote text: [quote]text[/quote] (alt+q)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="c" name="addbbcode8" value="Code" style="" onClick="bbstyle(8)" title="'.tra("Code display: [code]code[/code] (alt+c)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="l" name="addbbcode10" value="List" style="" onClick="bbstyle(10)" title="'.tra("List: [list]text[/list] (alt+l)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="o" name="addbbcode12" value="List=1" style="" onClick="bbstyle(12)" title="'.tra("Ordered list: [list=1]text[/list] (alt+o)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="p" name="addbbcode14" value="Img" style="" onClick="bbstyle(14)" title="'.tra("Insert image: [img]http://image_url[/img] (alt+p)").'" />
<input type="button" class="btn btn-default btn-sm" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; " onClick="bbstyle(16)" title="'.tra("Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)").'" />
<p>
&nbsp;'.tra("Font color").':
<select style="color:#000;" name="addbbcode22" onChange="bbfontstyle(\'[color=\' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + \']\', \'[/color]\');this.selectedIndex=0;" title="'.tra("Font color: [color=red]text[/color] Tip: you can also use color=#FF0000").'" >
<option style="color:black" value="#000000" class="genmed">'.tra("Default").'</option>
<option style="color:darkred" value="darkred" class="genmed">'.tra("Dark Red").'</option>
<option style="color:red" value="red" class="genmed">'.tra("Red").'</option>
<option style="color:orange" value="orange" class="genmed">'.tra("Orange").'</option>
<option style="color:brown" value="brown" class="genmed">'.tra("Brown").'</option>
<option style="color:yellow" value="yellow" class="genmed">'.tra("Yellow").'</option>
<option style="color:green" value="green" class="genmed">'.tra("Green").'</option>
<option style="color:olive" value="olive" class="genmed">'.tra("Olive").'</option>
<option style="color:cyan" value="cyan" class="genmed">'.tra("Cyan").'</option>
<option style="color:blue" value="blue" class="genmed">'.tra("Blue").'</option>
<option style="color:darkblue" value="darkblue" class="genmed">'.tra("Dark Blue").'</option>
<option style="color:indigo" value="indigo" class="genmed">'.tra("Indigo").'</option>
<option style="color:violet" value="violet" class="genmed">'.tra("Violet").'</option>
</select>
&nbsp;'.tra("Font size").':
<select style="color:#000;" name="addbbcode24" onChange="bbfontstyle(\'[size=\' + this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value + \']\', \'[/size]\');this.selectedIndex=0;" title="'.tra("Font size: [size=x-small]small text[/size]").'" >
<option value="12" selected class="genmed">'.tra("Default").'</option>
<option value="9" class="genmed">'.tra("Small").'</option>
<option value="12" class="genmed">'.tra("Normal").'</option>
<option value="18" class="genmed">'.tra("Large").'</option>
</select>
&nbsp;
<a href="javascript:bbstyle(-1)" title='.tra("Close all open bbCode tags").'>'.tra("Close Tags").'</a>
<p>
';
?>

View File

@ -24,6 +24,7 @@ require_once("../inc/news.inc");
require_once("../inc/text_transform.inc");
define('THREADS_PER_PAGE', 50);
define('FORUM_LH_PCT', '25%'); // width of LH column
$forum_error = "";
// for functions that return null on error,
@ -192,11 +193,11 @@ function forum_title($category, $forum, $thread, $link_thread=false) {
$forum->title
);
} else if ($forum && $thread) {
$x .= sprintf('<a href="%s">%s</a> :',
$x .= sprintf('<a href="%s">%s</a> : ',
$top_url,
$where
);
$x .= sprintf('<a href="forum_forum.php?id=%d">%s</a> :',
$x .= sprintf('<a href="forum_forum.php?id=%d">%s</a> : ',
$forum->id,
$forum->title
);
@ -781,30 +782,29 @@ function show_post_and_context($post, $thread, $forum, $options, $n) {
} else {
$deleted = "";
}
echo "
<tr>
<td>
$n)
";
switch ($forum->parent_type) {
case 0:
$category = BoincCategory::lookup_id($forum->category);
echo forum_title($category, $forum, $thread, true);
$title= forum_title($category, $forum, $thread, true);
break;
case 1:
echo team_forum_title($forum);
$title= team_forum_title($forum);
break;
}
echo "
(<a href=\"forum_thread.php?id=".$thread->id."&amp;postid=".$post->id."\">".tra("Message %1", $post->id)."</a>)
<br>
".tra("Posted %1 by %2", $when, user_links($user))." $deleted
<br>
Post:
<hr>
row_array([
sprintf(
'%d) %s
<br><a href="forum_thread.php?id=%d&amp;postid=%d">%s</a>
<br>%s%s
',
$n, $title,
$thread->id, $post->id,
tra("Message %1", $post->id),
tra("Posted %1 by %2", $when, user_links($user)),
$deleted
),
$content
</td></tr>
";
]);
}
function is_banished($user) {
@ -858,9 +858,7 @@ function post_rules() {
}
function post_warning($forum=null) {
$x = "<br><br>
<table><tr><td align=left>
";
$x = '<p><div style="text-align:left">';
// let projects add extra instructions in specific forums,
// e.g. Questions and Problems
@ -873,7 +871,7 @@ function post_warning($forum=null) {
<small>
".post_rules()."
</small>
</td></tr></table>
</div>
";
return $x;
}

View File

@ -20,6 +20,8 @@ require_once("boinc_db.inc");
require_once("sanitize_html.inc");
require_once("bbcode_html.inc");
define('PM_LH_PCT', '30%');
function pm_header() {
echo "<div>\n";
echo " <a href=\"pm.php?action=inbox\">".tra("Inbox")."</a>\n";
@ -29,7 +31,7 @@ function pm_header() {
function pm_rules() {
if (defined('PM_RULES')) return PM_RULES;
$x = "<table><tr><td align=left><small>";
$x = '<span style="text-align: left"><p>';
$x .= tra("
<ul>
<li> Messages may not contain content that is obscene, hate-related,
@ -45,7 +47,7 @@ function pm_rules() {
<li> If your account is suspended, don't create a new one.
</ul>
");
$x .= "</small></td></tr></table>\n";
$x .= "</span>";
return $x;
}
@ -82,25 +84,25 @@ function pm_team_form($user, $teamid, $error=null) {
row2(
tra("Subject"),
"<input type=\"text\" class=\"form-control\" name=\"subject\" value=\"$subject\">",
null, '20%'
null, PM_LH_PCT
);
row2_init(tra("Message")."<small>".bbcode_info()."</small>", '20%');
start_table();
echo $bbcode_html;
echo "<tr><td>\n";
echo "<textarea name=\"content\" class=\"form-control\" rows=\"18\">$content</textarea>";
echo "</td></tr>\n";
end_table();
echo sprintf(
'<tr><td></td><td>
<input class="btn" %s type="submit" name="preview" value="%s">
<input class="btn" %s type="submit" value="%s">
</td></tr>
',
button_style('blue'),
tra("Preview"),
button_style(),
tra("Send message")
row2(
tra("Message")."<small>".bbcode_info()."</small>",
$bbcode_html."<textarea name=\"content\" class=\"form-control\" rows=\"18\">$content</textarea>",
null, PM_LH_PCT
);
row2(
'',
sprintf(
'<input class="btn" %s type="submit" name="preview" value="%s">
<input class="btn" %s type="submit" value="%s">
',
button_style('blue'),
tra("Preview"),
button_style(),
tra("Send message")
),
null, PM_LH_PCT
);
end_table();
page_tail();
@ -174,24 +176,33 @@ function pm_form_page($replyto, $userid, $error = null) {
'<textarea rows=2 class="form-control" name="to">%s</textarea>',
$writeto
),
null, '20%'
null, PM_LH_PCT
);
row2(
tra("Subject"),
"<input type=\"text\" class=\"form-control\" name=\"subject\" value=\"$subject\">",
null, '20%'
"<input type=\"text\" class=\"form-control\" name=\"subject\" value=\"$subject\">",
null, PM_LH_PCT
);
row2_init(
row2(
tra("Message")."<small>".bbcode_info().pm_rules()."</small>",
'20%'
sprintf(
'%s <textarea name="content" class="form-control" rows="18">%s</textarea>',
$bbcode_html,
$content
),
null, PM_LH_PCT
);
row2(
'',
sprintf(
'<input class="btn btn-primary" type="submit" name="preview" value="%s">
<input class="btn btn-success" type="submit" value="%s">
',
tra("Preview"),
tra("Send message")
),
null, PM_LH_PCT
);
start_table();
echo $bbcode_html;
echo "<tr><td>\n";
echo "<textarea name=\"content\" class=\"form-control\" rows=\"18\">$content</textarea>";
echo "</td></tr>\n";
end_table();
echo "<tr><td></td><td><input class=\"btn btn-primary\" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> <input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Send message")."\"></td></tr>\n";
end_table();
page_tail();

View File

@ -296,12 +296,12 @@ function externalize_links($text) {
$linkpos=true;
$out = "";
while (true){
//Find a link
// Find a link
//
$linkpos=strpos($text, "<a ", $i);
if ($linkpos===false) break;
//Replace with target='_new'
// Replace with target='_new'
//
$out .= substr($text, $i, $linkpos-$i)."<a target=\"_new\" ";
$i = $linkpos+3;
@ -311,18 +311,15 @@ function externalize_links($text) {
}
// Converts image tags to links to the images.
//
function image_as_link($text){
/* This function depends on sanitized HTML */
// Build some regex (should be a *lot* faster)
$pattern = '@<img([\S\s]+?)src=([^>]+?)>@si';
$replacement = '<a href=${2}>[Image link]</a>'; // Turns that URL into a hyperlink
$text = preg_replace($pattern, $replacement, $text);
return $text;
$replacement = '<a href=${2}>[Image link]</a>';
return preg_replace($pattern, $replacement, $text);
}
// Highlight terms in text (most likely used with searches)
// Highlight terms in text (used in search results)
//
function highlight_terms($text, $terms) {
$search = $terms;
$replace = array();

View File

@ -16,10 +16,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Using this page you can edit a post.
// First it displays a box to edit in, and when you submit the changes
// it will call the methods on the post to make the changes.
//
// Edit a post.
// The creator of the post can do this up to MAXIMUM_EDIT_TIME
require_once('../inc/forum.inc');
require_once('../inc/bbcode_html.inc');
@ -91,7 +89,6 @@ if (post_str('submit',true) && (!$preview)) {
page_head(tra("Edit post"),'','','', $bbcode_js);
show_forum_header($logged_in_user);
switch ($forum->parent_type) {
case 0:
$category = BoincCategory::lookup_id($forum->category);
@ -112,45 +109,59 @@ if ($preview == tra("Preview")) {
);
}
echo "<form action=\"forum_edit.php?id=".$post->id."\" method=\"POST\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
echo sprintf(
'<form action="forum_edit.php?id=%d" method="POST" name=post onsubmit="return checkForm(this)">',
$post->id
);
echo form_tokens($logged_in_user->authenticator);
start_table();
row1(tra("Edit your message"));
if ($can_edit_title) {
//If this is the user can edit the thread title display a way of doing so
if ($preview) {
row2(
tra("Title").bbcode_info(),
"<input type=\"text\" size=80 name=\"title\" value=\"".htmlspecialchars($title)."\">"
);
} else {
row2(
tra("Title").bbcode_info(),
'<input type="text" size=80 name="title" value="'.htmlspecialchars($thread->title).'">'
);
}
};
if ($preview) {
row2(
tra("Message").bbcode_info().post_warning(),
start_table_str().$bbcode_html.end_table_str()."<textarea name=\"content\" rows=\"12\" cols=\"80\">".htmlspecialchars($content)."</textarea>"
);
} else {
row2(
tra("Message").bbcode_info().post_warning(),
start_table_str().$bbcode_html.end_table_str().'<textarea name="content" rows="12" cols="80">'.htmlspecialchars($post->content).'</textarea>'
tra("Title").bbcode_info(),
sprintf(
'<input type="text" size=%d name="title" value="%s">',
80,
htmlspecialchars($preview?$title:$thread->title)
),
null, FORUM_LH_PCT
);
}
if ($post->signature) {
$enable_signature="checked=\"true\"";
} else {
$enable_signature="";
}
row2("", "<input id=\"add_signature\" name=\"add_signature\" value=\"1\" ".$enable_signature." type=\"checkbox\">
<label for=\"add_signature\">".tra("Add my signature to this post")."</label>");
row2("", "<input class=\"btn btn-primary\" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\">&nbsp;<input class=\"btn btn-success\" type=\"submit\" name=\"submit\" value=\"OK\">"
row2(
sprintf('%s %s %s',
tra("Message"),
bbcode_info(),
post_warning()
),
sprintf(
'%s <textarea name="content" rows="%d" cols="%d">%s</textarea>',
$bbcode_html,
12,
80,
htmlspecialchars($preview?$content:$post->content)
),
null, FORUM_LH_PCT
);
row2("",
sprintf(
'<input id="add_signature" name="add_signature" value="1" type="checkbox" %s>
<label for="add_signature">%s</label>
',
$post->signature?'checked="true"':'',
tra("Add my signature to this post")
),
null, FORUM_LH_PCT
);
row2("",
sprintf(
'<input class="btn btn-primary" type="submit" name="preview" value="%s">
&nbsp;
<input class="btn btn-success" type="submit" name="submit" value="OK">',
tra("Preview")
),
null, FORUM_LH_PCT
);
end_table();

View File

@ -67,11 +67,7 @@ function forum_page($forum, $user, $msg=null) {
switch ($forum->parent_type) {
case 0:
$category = BoincCategory::lookup_id($forum->category);
if ($category->is_helpdesk) {
page_head(tra("Questions and Answers").' : '.$forum->title);
} else {
page_head(tra("Message boards").' : '.$forum->title);
}
page_head(sprintf("%s '%s'", tra("Forum"), $forum->title));
if ($msg) echo "<p>$msg</p>\n";
show_forum_header($user);
echo forum_title($category, $forum, NULL);

View File

@ -120,23 +120,34 @@ if ($content && !$title) {
}
if ($force_title && $title){
row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">");
row2(
tra("Title"),
sprintf(
'%s <input type="hidden" name="title" value="%s">',
htmlspecialchars($title),
htmlspecialchars($title)
),
null, FORUM_LH_PCT
);
} else {
row2(tra("Title").$submit_help,
row2(
tra("Title").$submit_help,
sprintf('<input type="text" class="form-control" name="title" value="%s">',
$title?htmlspecialchars($title):''
)
),
null, FORUM_LH_PCT
);
}
row2_init(tra("Message").bbcode_info().post_warning($forum).$body_help);
start_table();
echo $bbcode_html;
end_table();
echo sprintf('<textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>',
$content?htmlspecialchars($content):''
row2(
tra("Message").bbcode_info().post_warning($forum).$body_help,
sprintf(
'%s <textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>',
$bbcode_html,
$content?htmlspecialchars($content):''
),
null, FORUM_LH_PCT
);
echo "</td></tr>";
if (!$logged_in_user->prefs->no_signature_by_default) {
$enable_signature="checked=\"true\"";
@ -145,11 +156,33 @@ if (!$logged_in_user->prefs->no_signature_by_default) {
}
if (is_news_forum($forum)) {
row2("", "<input name=export type=checkbox> ".tra("Show this item as a Notice in the BOINC Manager")."<br><p class=\"text-muted\">".tra("Do so only for items likely to be of interest to all volunteers.")."</p>");
row2("",
sprintf(
'<input name=export type=checkbox> %s
<br><p class="text-muted">%s</p>',
tra("Show this item as a Notice in the BOINC Manager"),
tra("Do so only for items likely to be of interest to all volunteers.")
),
null, FORUM_LH_PCT
);
}
row2("", "<input name=\"add_signature\" value=\"add_it\" ".$enable_signature." type=\"checkbox\"> ".tra("Add my signature to this post"));
row2("", "<input class=\"btn btn-primary\" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> <input class=\"btn btn-success\" type=\"submit\" value=\"".tra("OK")."\">");
row2("",
sprintf(
'<input name="add_signature" value="add_it" %s type="checkbox"> %s',
$enable_signature,
tra("Add my signature to this post")
),
null, FORUM_LH_PCT
);
row2("",
sprintf(
'<input class="btn btn-primary" type="submit" name="preview" value="%s">
<input class="btn btn-success" type="submit" value="%s">',
tra("Preview"),
tra("OK")
),
null, FORUM_LH_PCT
);
end_table();

View File

@ -16,8 +16,11 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Post a reply to a thread.
// Both input (form) and action take place here.
// Post to a thread (possibly replying to an existing post).
// Both form and action are here.
//
// Note: the filename is confusing:
// we "reply" to a post, not a thread
require_once('../inc/util.inc');
require_once('../inc/forum_email.inc');
@ -91,9 +94,15 @@ if ($content && (!$preview)){
}
}
page_head(tra("Post to thread"),'','','', $bbcode_js);
page_head(tra("Post to thread")." '$thread->title'",'','','', $bbcode_js);
show_forum_header($logged_in_user);
if ($parent_post) {
echo sprintf(
'<h4>Replying to <a href=#%d>message %d</a></h4>',
$parent_post->id,
$parent_post->id
);
}
if ($warning) {
echo "<p class=\"text-danger\">$warning</p>";
@ -144,9 +153,6 @@ function show_message_row($thread, $parent_post) {
$x1 = tra("Message:").bbcode_info().post_warning();
$x2 = "";
if ($parent_post) {
$x2 .=" ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
}
$x2 .= "<form action=forum_reply.php?thread=".$thread->id;
if ($parent_post) {
@ -155,7 +161,7 @@ function show_message_row($thread, $parent_post) {
$x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
$x2 .= form_tokens($logged_in_user->authenticator);
$x2 .= start_table_str().$bbcode_html.end_table_str()."<textarea class=\"form-control\" name=\"content\" rows=\"18\">";
$x2 .= $bbcode_html."<textarea class=\"form-control\" name=\"content\" rows=\"18\">";
$no_quote = get_int("no_quote", true)==1;
if ($preview) {
$x2 .= htmlspecialchars($content);
@ -179,11 +185,11 @@ function show_message_row($thread, $parent_post) {
button_style('blue'),
tra("Preview"),
button_style(),
tra("Post reply"),
tra("Post"),
$enable_signature,
tra("Add my signature to this reply")
tra("Add my signature to this post")
);
row2($x1, $x2, false, "20%");
row2($x1, $x2, false, FORUM_LH_PCT);
}
function quote_text($post) {

View File

@ -195,7 +195,8 @@ $posts = search_post_content(
if (count($posts)){
echo "<h3>" . tra("Messages matching your query:") . "</h3>";
start_table();
start_table('table-striped');
row_heading_array(['Info', 'Post'], ['', 'width=70%']);
$n = 1;
$options = get_output_options($logged_in_user);
$options->setHighlightTerms($search_list);

View File

@ -99,12 +99,10 @@ if ($temp_sort_style) {
}
}
page_head($title, 'onload="jumpToUnread();"');
page_head("Thread '$title'", 'onload="jumpToUnread();"');
$is_subscribed = $logged_in_user && BoincSubscription::lookup($logged_in_user->id, $thread->id);
show_forum_header($logged_in_user);
echo "<p>";
switch ($forum->parent_type) {
case 0:

View File

@ -78,6 +78,7 @@ page_head(tra("Posts by %1", $user->name));
$posts = BoincPost::enum("user=$userid order by id desc limit 10000");
$n = 0;
start_table('table-striped');
row_heading_array(['Info', 'Post'], ['', 'width=70%']);
$options = get_output_options($logged_in_user);
$show_next = false;
@ -117,7 +118,7 @@ foreach ($posts as $post) {
}
$n++;
}
echo "</table><br><br>\n";
end_table();
if ($offset) {
$x = $offset - $items_per_page;