open detail elements if all pages are displayed
parent
b1301475ed
commit
9f022d46db
|
@ -327,7 +327,13 @@ function print_overboard($db, $css, $settings, $page)
|
|||
|
||||
echo "$html_string";
|
||||
|
||||
print_replies($db, $sub, $post_id, $org_id, $settings, $css);
|
||||
if ($page == 'all') {
|
||||
print_replies($db, $sub, $post_id, $org_id,
|
||||
$settings, $css, 'open');
|
||||
} else {
|
||||
print_replies($db, $sub, $post_id, $org_id,
|
||||
$settings, $css, 'closed');
|
||||
}
|
||||
|
||||
echo "<br></div><br>";
|
||||
}
|
||||
|
@ -441,7 +447,7 @@ function print_individual_feed($db, $css, $settings, $ex_subs, $in_subs)
|
|||
|
||||
echo "$html_string";
|
||||
|
||||
print_replies($db, $sub, $post_id, $org_id, $settings, $css);
|
||||
print_replies($db, $sub, $post_id, $org_id, $settings, $css, 'closed');
|
||||
|
||||
echo "<br></div><br>";
|
||||
}
|
||||
|
@ -656,7 +662,7 @@ function print_header($css)
|
|||
}
|
||||
|
||||
// Show all replies to a given post
|
||||
function print_replies($db, $sub, $post_id, $org_id, $settings, $css)
|
||||
function print_replies($db, $sub, $post_id, $org_id, $settings, $css, $state)
|
||||
{
|
||||
$sub_statement = $db->prepare("SELECT post_id, org_id,
|
||||
sub, text, timestamp,
|
||||
|
@ -720,8 +726,13 @@ function print_replies($db, $sub, $post_id, $org_id, $settings, $css)
|
|||
|
||||
if ($counter > 1) {
|
||||
// we have at least one reply
|
||||
$html_string .= "<details>"
|
||||
. "<summary>Show $display_number more replies</summary>";
|
||||
if ($state == 'open') {
|
||||
$html_string .= "<details open>";
|
||||
} else {
|
||||
$html_string .= "<details>";
|
||||
}
|
||||
|
||||
$html_string .= "<summary>Show $display_number more replies</summary>";
|
||||
|
||||
foreach ($answers as $display_msg) {
|
||||
$answer_post_id = $display_msg[0];
|
||||
|
@ -1005,7 +1016,13 @@ function print_sub($db, $sub, $css, $settings, $page)
|
|||
|
||||
echo "$html_string";
|
||||
|
||||
print_replies($db, $sub, $post_id, $org_id, $settings, $css);
|
||||
if ($page == 'all') {
|
||||
print_replies($db, $sub, $post_id, $org_id,
|
||||
$settings, $css, 'open');
|
||||
} else {
|
||||
print_replies($db, $sub, $post_id, $org_id,
|
||||
$settings, $css, 'closed');
|
||||
}
|
||||
|
||||
echo "<br></div><br>";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue