[phpBB3 3.0.8 MOD] Kill Extra Quote (english)

Rispondi al messaggio


Questa domanda serve a prevenire iscrizioni automatiche.
Emoticon
:rolling: :shock: :chupa: 8-) :oops: :twisted: :roll: ;) :becky: :2frown: :2picche: :acc: :alcesso: :alien: :popcorn: :angel: :angry: :applause: :banana: :berluska: :D :birra: :bleurgh: :boxing: :brindisi: :bugia: :capocc: :china: :clacool: :coffee: :computer: :confused: :contract: :uhm: :upset: :withstup: :yawn: :zitt: :zzz: :lele: :gero: :andy: :urk: :rip: :crazy: :cry: :dottor: :facciada: :fart: :freak: :ghhhhh: :handy: :parsi: :loda: :sisi: :martello: :mucca: :nasega: :pirate: :frank: :abb1: :abb2: XD
Visualizza tutte le emoticon

BBCode attivo
[img] non attivo
[url] attivo
Emoticon attive

Revisione argomento
   

Espandi visuale Revisione argomento: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)

Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)

da Rombo di Tuono » 04 gen 2011, 01:20

Here's the result of quoting the above post:

Immagine

Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)

da Rombo di Tuono » 04 gen 2011, 01:17

Rombo di Tuono ha scritto:
Rombo di Tuono ha scritto:example text 1
example 2
example text 3

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"

Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)

da Rombo di Tuono » 04 gen 2011, 01:15

Rombo di Tuono ha scritto:example text 1
example 2

Re: [phpBB3 3.0.8 MOD] Kill Extra Quote (english)

da Rombo di Tuono » 04 gen 2011, 01:09

STEP 2

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";
REPLACE WITH

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";
STEP 3

FIND (few rows below)

Codice: Seleziona tutto

$message = censor_text(trim($message_parser->message));
REPLACE WITH

Codice: Seleziona tutto

$message = remove_quote(censor_text(trim($message_parser->message)), $config['max_quote_depth']);

Eugy ROMBO di TUONO

INSTRUCTIONS

da Rombo di Tuono » 04 gen 2011, 01:04

Instructions:

Whole MOD is in three steps
STEP 1
OPEN phpbb root/includes/function_posting.php

FIND

Codice: Seleziona tutto

?>
BEFORE-ADD

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

Eugy ROMBO di TUONO

[phpBB3 3.0.8 MOD] Kill Extra Quote (english)

da Rombo di Tuono » 04 gen 2011, 00:51

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

Top