mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
fall back to bbcode-less quotes
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9835 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e90f25e9b4
commit
be51bbe42b
3 changed files with 63 additions and 3 deletions
|
@ -1187,7 +1187,15 @@ $message_parser->decode_message($post_data['bbcode_uid']);
|
|||
|
||||
if ($mode == 'quote' && !$submit && !$preview && !$refresh)
|
||||
{
|
||||
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
|
||||
if ($config['allow_bbcode'])
|
||||
{
|
||||
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '> ' . utf8_wordwrap(censor_text(trim($message_parser->message)), 75, "\n> ");
|
||||
$message_parser->message = $post_data['quote_username'] . " " . $user->lang['WROTE'] . " :\n" . $message . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
var imageTag = false;
|
||||
var theSelection = false;
|
||||
|
||||
var bbcodeEnabled = true;
|
||||
// Check for Browser & Platform for PC & IE specific bits
|
||||
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
|
||||
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
|
||||
|
@ -14,7 +15,6 @@ var clientVer = parseInt(navigator.appVersion); // Get browser version
|
|||
|
||||
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
|
||||
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
|
||||
|
||||
var baseHeight;
|
||||
|
||||
/**
|
||||
|
@ -250,12 +250,59 @@ function addquote(post_id, username)
|
|||
|
||||
if (theSelection)
|
||||
{
|
||||
insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
|
||||
if (bbcodeEnabled)
|
||||
{
|
||||
insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
|
||||
}
|
||||
else
|
||||
{
|
||||
var lines = split_lines(theSelection);
|
||||
for (i = 0; i < lines.length; i++)
|
||||
{
|
||||
insert_text('> ' + lines[i] + '\n')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function split_lines(text)
|
||||
{
|
||||
var lines = text.split('\n');
|
||||
var splitLines = new Array();
|
||||
var j = 0;
|
||||
for(i = 0; i < lines.length; i++)
|
||||
{
|
||||
if (lines[i].length <= 80)
|
||||
{
|
||||
splitLines[j] = lines[i];
|
||||
j++;
|
||||
}
|
||||
else
|
||||
{
|
||||
var line = lines[i];
|
||||
do
|
||||
{
|
||||
var splitAt = line.indexOf(' ', 80);
|
||||
|
||||
if (splitAt == -1)
|
||||
{
|
||||
splitLines[j] = line;
|
||||
j++
|
||||
}
|
||||
else
|
||||
{
|
||||
splitLines[j] = line.substring(0, splitAt);
|
||||
line = line.substring(splitAt);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
while(splitAt != -1)
|
||||
}
|
||||
}
|
||||
return splitLines;
|
||||
}
|
||||
/**
|
||||
* From http://www.massless.org/mozedit/
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
</h3>
|
||||
|
||||
<div id="topicreview">
|
||||
<script>
|
||||
// <![CDATA[
|
||||
bbcodeEnabled = {S_BBCODE_ALLOWED};
|
||||
// ]]>
|
||||
</script>
|
||||
<!-- BEGIN topic_review_row -->
|
||||
|
||||
<!-- IF topic_review_row.S_IGNORE_POST -->
|
||||
|
|
Loading…
Add table
Reference in a new issue