Author: Kellanved
Date: Wed Jul 22 16:39:26 2009
New Revision: 9835
Log:
fall back to bbcode-less quotes
Modified:
branches/phpBB-3_0_0/phpBB/posting.php
branches/phpBB-3_0_0/phpBB/styles/prosilver/template/editor.js
branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_topic_review.html
Modified: branches/phpBB-3_0_0/phpBB/posting.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/posting.php (original)
--- branches/phpBB-3_0_0/phpBB/posting.php Wed Jul 22 16:39:26 2009
***************
*** 1187,1193 ****
if ($mode == 'quote' && !$submit && !$preview && !$refresh)
{
! $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
--- 1187,1201 ----
if ($mode == 'quote' && !$submit && !$preview && !$refresh)
{
! 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)
Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/editor.js
==============================================================================
*** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/editor.js (original)
--- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/editor.js Wed Jul 22 16:39:26 2009
***************
*** 7,12 ****
--- 7,13 ----
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,20 ****
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
-
var baseHeight;
/**
--- 15,20 ----
***************
*** 250,261 ****
if (theSelection)
{
! insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
}
return;
}
/**
* From http://www.massless.org/mozedit/
*/
--- 250,308 ----
if (theSelection)
{
! 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/
*/
Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_topic_review.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_topic_review.html (original)
--- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_topic_review.html Wed Jul 22 16:39:26 2009
***************
*** 5,10 ****
--- 5,15 ----
</h3>
<div id="topicreview">
+ <script>
+ // <![CDATA[
+ bbcodeEnabled = {S_BBCODE_ALLOWED};
+ // ]]>
+ </script>
<!-- BEGIN topic_review_row -->
<!-- IF topic_review_row.S_IGNORE_POST -->
|