[phpBB3 3.0.8 MOD] Kill Extra Quote (english)
Moderatore: MODERATORE
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta:
[phpBB3 3.0.8 MOD] Kill Extra Quote (english)
Modification Name: Kill Extra quote Mod
Author: Rombo di Tuono
Modification Description: "Kill Extra Quote" Mod ERASES from the posting form (textarea) the nested quote that exceed the limit set in ACP.
Modification Version: 1.0 RC1
Requirements: phpBB 3.0.x
Features:
How it works:
Instead of blocking user from posting a message with too many nested quote, the Kill Extra Quote Mod erases the exceeding quotes at the moment the user presses the "quote" button.
So the user finds in the textarea form posting the correct numebr of nested quotes, because the mod has taken away the oldest.
Demos and instructions follow.
Eugy ROMBO di TUONO
Author: Rombo di Tuono
Modification Description: "Kill Extra Quote" Mod ERASES from the posting form (textarea) the nested quote that exceed the limit set in ACP.
Modification Version: 1.0 RC1
Requirements: phpBB 3.0.x
Features:
How it works:
Instead of blocking user from posting a message with too many nested quote, the Kill Extra Quote Mod erases the exceeding quotes at the moment the user presses the "quote" button.
So the user finds in the textarea form posting the correct numebr of nested quotes, because the mod has taken away the oldest.
Demos and instructions follow.
Eugy ROMBO di TUONO
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta:
INSTRUCTIONS
Instructions:
Whole MOD is in three steps
STEP 1
OPEN phpbb root/includes/function_posting.php
FIND
BEFORE-ADD
Eugy ROMBO di TUONO
Whole MOD is in three steps
STEP 1
OPEN phpbb root/includes/function_posting.php
FIND
Codice: Seleziona tutto
?>
Codice: Seleziona tutto
// begin MOD Kill Extra Quote
function remove_quote($quoted_text, $max_quote_nest)
{
/*
$max_quote_nest is set in ACP, and passed to the funcion
*/
if ($max_quote_nest > 0) {
// constants for begin and end tag quote
$beginquote = "[quote=";
$endquote = "[/quote";
// better they have same lenght
$ctrl_len = 7;
$quote_to_kill = $max_quote_nest -1;
$output = "";
$purged_text = "";
$nest_count = 0;
$killing = false; // determines if that part of quoted text must be taken away
for ($i = 0; $i<=strlen($quoted_text); $i++)
{
$char = substr($quoted_text, $i, 1);
if ($char == "[")
{
$control = substr($quoted_text, $i, $ctrl_len);
if ($control == $beginquote ) {
$nest_count++;
}
if ($control == $endquote ) {
$nest_count--;
if ($killing) { // if you find an end quote while in 'killing mode' you CAN stripe it at this point
$i = $i + $ctrl_len +1;
$char = substr($quoted_text, $i, 1);
}
}
if ($nest_count > $quote_to_kill ) {
$killing = true;
} else {
$killing = false;
}
} // end of bracket check
if (!$killing) {
$output = $output . $char;
}
}
return $output;
} else {
return $quoted_text;
}
} // END MOD Kill Extra Quote
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta:
Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)
STEP 2
OPEN phpbb root/posting.php
FIND
REPLACE WITH
STEP 3
FIND (few rows below)
REPLACE WITH
Eugy ROMBO di TUONO
OPEN phpbb root/posting.php
FIND
Codice: Seleziona tutto
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
Codice: Seleziona tutto
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . remove_quote(censor_text(trim($message_parser->message)), $config['max_quote_depth']) . "[/quote]\n";
FIND (few rows below)
Codice: Seleziona tutto
$message = censor_text(trim($message_parser->message));
Codice: Seleziona tutto
$message = remove_quote(censor_text(trim($message_parser->message)), $config['max_quote_depth']);
Eugy ROMBO di TUONO
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta:
Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)
example text 1
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta:
Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)
example 2Rombo di Tuono ha scritto:example text 1
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta:
Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)
example text 3Rombo di Tuono ha scritto:example 2Rombo di Tuono ha scritto:example text 1
My forum allows TWO nested quote:
try to quote this message and you'll find NOT, in the message area, the inner quote "example text 1"
- Rombo di Tuono
- Site Admin
- Messaggi: 7135
- Iscritto il: 04 lug 2007, 18:07
- Località: Seconda stella a DESTRA...
- Contatta: