fixed bbcode (greedy to lazy), took out linebreak to properly display long links
parent
bab0dc8c62
commit
86f48f26a9
|
@ -991,8 +991,7 @@ function show_shadowed($db, $css, $settings, $token)
|
|||
$org_id = "{$row[1]}";
|
||||
$sub = "{$row[2]}";
|
||||
$text = "{$row[3]}";
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub));
|
||||
|
||||
$html_string .= "<div class='post'>"
|
||||
. "<tr>"
|
||||
|
|
|
@ -57,14 +57,14 @@ function bbcode_to_html($text, $settings, $sub)
|
|||
}
|
||||
|
||||
$search = array (
|
||||
'/(\[b\ )(.*)(\])/',
|
||||
'/(\[i\ )(.*)(\])/',
|
||||
'/(\[u\ )(.*)(\])/',
|
||||
'/(\[s\ )(.*)(\])/',
|
||||
'/(\[h\ )(.*)(\])/',
|
||||
'/(\[sp\ )(.*)(\])/',
|
||||
'/(\[li\ )(.*)(\])/',
|
||||
'/(\[url\ )(.*)(\])/',
|
||||
'/(\[b\ )(.*?)(\])/',
|
||||
'/(\[i\ )(.*?)(\])/',
|
||||
'/(\[u\ )(.*?)(\])/',
|
||||
'/(\[s\ )(.*?)(\])/',
|
||||
'/(\[h\ )(.*?)(\])/',
|
||||
'/(\[sp\ )(.*?)(\])/',
|
||||
'/(\[li\ )(.*?)(\])/',
|
||||
'/(\[url\ )(.*?)(\])/',
|
||||
'/ s\/(.+)\/([0-9]+)/',
|
||||
'/>> ([0-9]+)\r\n/',
|
||||
'/>>(.*)\r\n/'
|
||||
|
@ -89,12 +89,11 @@ function bbcode_to_html($text, $settings, $sub)
|
|||
}
|
||||
|
||||
// Break text according to config.php, also transform \r\n to <br>
|
||||
function break_text($text, $settings)
|
||||
function break_text($text)
|
||||
{
|
||||
|
||||
$post_text = wordwrap($text, $settings['line_break'], "\n", TRUE);
|
||||
$post_text = nl2br($post_text, FALSE);
|
||||
return $post_text;
|
||||
$post_text = nl2br($text, FALSE);
|
||||
return $post_text;
|
||||
|
||||
}
|
||||
|
||||
|
@ -166,8 +165,7 @@ function print_thread($db, $sub, $css, $settings, $org_id, $link_to_reply)
|
|||
$post_id = "{$row[0]}";
|
||||
$org_id = "{$row[1]}";
|
||||
$post_text = "{$row[3]}";
|
||||
$post_text = break_text(bbcode_to_html($post_text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($post_text, $settings, $sub));
|
||||
$id_text = make_id_text($post_id);
|
||||
$timestamp = "{$row[4]}";
|
||||
$name = "{$row[5]}";
|
||||
|
@ -183,7 +181,6 @@ function print_thread($db, $sub, $css, $settings, $org_id, $link_to_reply)
|
|||
$html_string .= "<small>:$timestamp</small>";
|
||||
}
|
||||
|
||||
// $html_string .= "<br><br><code>$post_text</code><br><br>";
|
||||
$html_string .= "<br><br>$post_text<br><br>";
|
||||
|
||||
if ( !empty($name) &&
|
||||
|
@ -278,8 +275,7 @@ function print_overboard($db, $css, $settings, $page)
|
|||
$org_id = "{$row[1]}";
|
||||
$sub = "{$row[2]}";
|
||||
$text = "{$row[3]}";
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub));
|
||||
$timestamp = "{$row[4]}";
|
||||
$name = "{$row[5]}";
|
||||
$tripcode = "{$row[6]}";
|
||||
|
@ -397,8 +393,7 @@ function print_individual_feed($db, $css, $settings, $ex_subs, $in_subs)
|
|||
$org_id = "{$row[1]}";
|
||||
$sub = "{$row[2]}";
|
||||
$text = "{$row[3]}";
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub));
|
||||
$timestamp = "{$row[4]}";
|
||||
$name = "{$row[5]}";
|
||||
$tripcode = "{$row[6]}";
|
||||
|
@ -692,8 +687,7 @@ function print_replies($db, $sub, $post_id, $org_id, $settings, $css, $state)
|
|||
$counter++;
|
||||
$post = array();
|
||||
$sub_post_text = break_text(bbcode_to_html
|
||||
($sub_text, $settings, $sub),
|
||||
$settings);
|
||||
($sub_text, $settings, $sub));
|
||||
array_push($post, $sub_post_id);
|
||||
array_push($post, $sub_org_id);
|
||||
array_push($post, $sub_post_text);
|
||||
|
@ -969,8 +963,7 @@ function print_sub($db, $sub, $css, $settings, $page)
|
|||
$tripcode = "{$row[6]}";
|
||||
$move_message = "{$row[7]}";
|
||||
$edit_message = "{$row[8]}";
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub));
|
||||
|
||||
$html_string .= "<div>";
|
||||
|
||||
|
@ -1063,8 +1056,7 @@ function print_user($db, $name, $css, $settings)
|
|||
$timestamp = "{$row[4]}";
|
||||
$name = "{$row[5]}";
|
||||
$tripcode = "{$row[6]}";
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($text, $settings, $sub));
|
||||
|
||||
$html_string .= "<div>";
|
||||
|
||||
|
@ -1081,7 +1073,6 @@ function print_user($db, $name, $css, $settings)
|
|||
$html_string .= "<small>:$timestamp</small>";
|
||||
}
|
||||
|
||||
// $html_string .= "<br><br><code>$post_text</code><br><br>"
|
||||
$html_string .= "<br><br>$post_text<br><br>"
|
||||
. "<a href='$link_string_2'>reply</a> ";
|
||||
|
||||
|
|
|
@ -289,8 +289,7 @@ function show_post_history($db, $sub, $post_id, $settings)
|
|||
$post_id = "{$row[0]}";
|
||||
$org_id = "{$row[1]}";
|
||||
$post_text = "{$row[3]}";
|
||||
$post_text = break_text(bbcode_to_html($post_text, $settings, $sub),
|
||||
$settings);
|
||||
$post_text = break_text(bbcode_to_html($post_text, $settings, $sub));
|
||||
$id_text = make_id_text($post_id);
|
||||
$timestamp = "{$row[4]}";
|
||||
$name = "{$row[5]}";
|
||||
|
|
Loading…
Reference in New Issue