×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: BUG with [quote]

BUG with [quote] 14 years 11 months ago #7904

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0

DW wrote:

DW wrote: tests

testst

testst


Result :

BUG with [quote] 14 years 11 months ago #7905

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
works very well on the forum:)

BUG with [quote] 14 years 11 months ago #7906

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
[quote=DW][quote=DW]tests[/quote]testst[/quote]testst

BUG with [quote] 14 years 11 months ago #7907

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0

BUG with [quote] 14 years 11 months ago #7942

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I'm trying to find a php parser class for the next version. Will see how that goes.

BUG with [quote] 14 years 11 months ago #7944

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
Test this method if you want :
while( preg_match( '#\[quote(.*)\](.+)\[/quote\]#isU', $texte ) ){
        $texte= preg_replace('#\[quote(.*)\](.+)\[/quote\]#isU','<div class="Quote">$2</div>',$texte);
}

BUG with [quote] 14 years 11 months ago #7945

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081

BUG with [quote] 14 years 11 months ago #7946

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0

BUG with [quote] 14 years 10 months ago #8338

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I've added Christian Seiler's bbcode class and I've just fixed the problem with the qoutes. Next version should be bug free :)

BUG with [quote] 14 years 10 months ago #8339

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
Good news!
Could you tell us its implementation! because I can't wait until the new release :)
thx :silly:

BUG with [quote] 14 years 10 months ago #8340

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
It is complicated. and because not everything is working as it should I will not provide you with a copy of the JOSC_bbcode.php file

BUG with [quote] 14 years 7 months ago #9303

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
lack of time and I can't wait until the new version here is a solution to this bug (only for "[ quote ]"):

File: com_comment/com_comment/joscomment/comment.class.php
Line: 2469
And replace this function by :
function parseUBB_recurse( $matches )
	{
 
		$split 	 	= $this->_splitTag;
		$limittext 	= $this->_limittextTag;
		$TO 		= $this->_TO;
		$TC 		= $this->_TC;
 
		/* other recurse : #\[img]((?:[^[]|\[(?!/?img])|(?R))+)\[/img]#i*/
		/* ?: => group but do not capture
		 * change ...)*)\[/x...  in   )+)\[/x  if empty inside not authorized
		 *
		 * always :  $split+start+$split    text       $split.end.$split
		 */
        $patterns = array(
			'#\[b]((?:[^[]|\[(?!/?b])|(?R))*)\[/b]#i',
            '#\[u]((?:[^[]|\[(?!/?u])|(?R))*)\[/u]#i',
            '#\[i]((?:[^[]|\[(?!/?i])|(?R))*)\[/i]#i',
 
            '#\[url=(.*?)]((?:[^[]|\[(?!/?url])|(?R))*)\[/url]#i',
            '#\[url]((?:[^[]|\[(?!/?url])|(?R))*)\[/url]#i',
 
            '#\[email]((?:[^[]|\[(?!/?email])|(?R))*)\[/email]#i',
            '#\[email=(.*?)]((?:[^[]|\[(?!/?email])|(?R))*)\[/email]#i',
 
            '#\[font=(.*?)]((?:[^[]|\[(?!/?font])|(?R))*)\[/font]#i',
            '#\[size=(.*?)]((?:[^[]|\[(?!/?size])|(?R))*)\[/size]#i',
            '#\[color=(.*?)]((?:[^[]|\[(?!/?color])|(?R))*)\[/color]#i',
 
            '#\[quote]((?:[^[]|\[(?!/?quote])|(?R))*)\[/quote]#i',
            '#\[quote=(.*?)]((?:[^[]|\[(?!/?quote])|(?R))*)\[/quote]#i',
 
            '#\[code]((?:[^[]|\[(?!/?code])|(?R))*)\
#i',

'#\((?:[^[]|\[(?!/?img])|(?R))*)\#i',
'#\((?:[^[]|\[(?!/?img])|(?R))*)\#i',
);

/*
* replacements
*/
$replacements = array();

if ($this->_support_UBBcode) {
$replacements[] = $split.'b' .$TO.'b'.$TC.$split.'\\1'. $split.'b'.$TO.'/b'.$TC.$split;
$replacements[] = $split.'u' .$TO.'u'.$TC.$split.'\\1'. $split.'u'.$TO.'/u'.$TC.$split;
$replacements[] = $split.'i' .$TO.'i'.$TC.$split.'\\1'. $split.'i'.$TO.'/i'.$TC.$split;

if ($this->_support_link) {
$replacements[] = $split.'a' .$TO.'a target=\'_blank\' rel=\'external nofollow\' href=\'\\1\' title=\'Visit \\1\''.$TC.$split.$limittext.'\\2'. $split.'a'.$TO.'/a'.$TC.$split;
$replacements[] = $split.'a' .$TO.'a target=\'_blank\' rel=\'external nofollow\' href=\'\\1\' title=\'Visit \\1\''.$TC.$split.$limittext.'\\1'. $split.'a'.$TO.'/a'.$TC.$split;

$replacements[] = $split.'a' .$TO.'a href=\'mailto:\\1\''.$TC.$split.$limittext.'\\1'. $split.'a'.$TO.'/a'.$TC.$split;
$replacements[] = $split.'a' .$TO.'a href=\'mailto:\\1\''.$TC.$split.$limittext.'\\2'. $split.'a'.$TO.'/a'.$TC.$split;
} else {
$replacements[] = $split.' link:\\1';
$replacements[] = $split.' link:\\1';
$replacements[] = $split.' \\1';
$replacements[] = $split.' \\1';
}

$replacements[] = $split.'span' .$TO.'span style=\'font-family: \\1\''.$TC.$split.'\\2'. $split.'span'.$TO.'/span'.$TC.$split;
$replacements[] = $split.'span' .$TO.'span style=\'font-size: \\1\''.$TC.$split.'\\2'. $split.'span'.$TO.'/span'.$TC.$split;

if ($this->_hide) {
$replacements[] = $split.'\\2';
} else {
$replacements[] = $split.$TO.'span style=\'color: \\1\''.$TC.$split.'\\2'.$split.$TO.'/span'.$TC.$split;
}
} else {
$replacements[] = $split.' \\1';
$replacements[] = $split.' \\1';
$replacements[] = $split.' \\1';

$replacements[] = $split.' link:\\1';
$replacements[] = $split.' link:\\1';

$replacements[] = $split.' \\1';
$replacements[] = $split.' \\1';

$replacements[] = $split.' \\2';
$replacements[] = $split.' \\2';
$replacements[] = $split.' \\2';
}


/*
* quotes
*/

// $patterns = array("/\[quote\](.+?)\[\/quote\]/is",
// "/\

(.+?)\ wrote: (.+?)\[\/quote\]/is");
// $replacements = array("<div class='quote'><div class='genmed'><b>" . _JOOMLACOMMENT_UBB_QUOTE . "</b></div><div class='quotebody'>\\1</div></div>",
// "<div class='quote'><div class='genmed'><b>\\1 " . _JOOMLACOMMENT_UBB_WROTE . "</b></div><div class='quotebody'>\\2</div></div>");

if ($this->_support_quotecode) {

$replacements[] = $split.'div' .$TO.'div class=\'quote\''.$TC. $split
.$split.'div' .$TO.'div class=\'genmed\''.$TC.$split
.$split.'b' .$TO.'b'.$TC.$split. _JOOMLACOMMENT_UBB_QUOTE
.$split.'b' .$TO.'/b'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split
.$split.'div' .$TO.'div class=\'quotebody\''.$TC.$split.'\\1'
.$split.'div' .$TO.'/div'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split;

$replacements[] = $split.'div' .$TO.'div class=\'quote\''.$TC. $split
.$split.'div' .$TO.'div class=\'genmed\''.$TC.$split
.$split.'b' .$TO.'b'.$TC.$split.'\\1 '._JOOMLACOMMENT_UBB_WROTE
.$split.'b' .$TO.'/b'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split
.$split.'div' .$TO.'div class=\'quotebody\''.$TC.$split.'\\2'
.$split.'div' .$TO.'/div'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split;
} else {
$replacements[] = $split.' \\1';
$replacements[] = $split.' \\2';
}


/*
* code
*/
if ($this->_support_quotecode) {
$replacements[] = $split.'div' .$TO.'div class=\'code\''.$TC. $split
.$split.'div' .$TO.'div class=\'genmed\''.$TC.$split
.$split.'b' .$TO.'b'.$TC.$split. _JOOMLACOMMENT_UBB_CODE
.$split.'b' .$TO.'/b'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split
.$split.'div' .$TO.'div class=\'quotebody\''.$TC.$split
.$split.'pre' .$TO.'pre'.$TC.$split.'\\1'
.$split.'pre' .$TO.'/pre'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split
.$split.'div' .$TO.'/div'.$TC.$split;
} else {
$replacements[] = $split.' \\1';
}

/*
* images
*/
if ($this->_support_pictures) {
$maxwidthpictures = (int) $this->_pictures_maxwidth;
if ($maxwidthpictures>0) {
$divO = $split.'div' .$TO.'div style=\'width:'.$maxwidthpictures.'px;overflow:hidden;\''.$TC. $split;
$divC = $split.'div' .$TO.'/div'.$TC.$split;
} else {
$divO = $divC = '';
}
$replacements[] = $divO. $split .$TO.'img src=\'\\1\' alt=\'Posted image\' /'.$TC.$split.$divC;
$replacements[] = $divO. $split .$TO.'img src=\'\\1\' alt=\'Posted image\' /'.$TC.$split.$divC;
} else {
/* no image = link */
if ($this->_support_link) {
$replacements[] = $split.'a' .$TO.'a target=\'_blank\' rel=\'external nofollow\' href=\'\\1\' title=\'Visit \\1\''.$TC.$split.$limittext.'\\1'. $split.'a'.$TO.'/a'.$TC.$split;
$replacements[] = $split.'a' .$TO.'a target=\'_blank\' rel=\'external nofollow\' href=\'\\1\' title=\'Visit \\1\''.$TC.$split.$limittext.'\\2'. $split.'a'.$TO.'/a'.$TC.$split;
} else {
$replacements[] = $split.' image:\\1';
$replacements[] = $split.' image:\\1';
}
}


if (is_array($matches)) {
$html = preg_replace($patterns, $replacements, $matches[0]);
$matches = $html;
}

/* *
* By Wass
*/
if ($this->_support_quotecode){
while( preg_match( '#\

(.*)\ wrote: (.+)\[/quote\]#isU', $matches ) ){
$matches= preg_replace('#\

(.*)\ wrote: (.+)\[/quote\]#isU','<div class="quote"><div class="genmed"><b>$1 '._JOOMLACOMMENT_UBB_WROTE.'</b></div><div class="quotebody">$2</div></div>',$matches);
}

while( preg_match( '#\[quote(.*)\](.+)\[/quote\]#isU', $matches ) ){
$matches= preg_replace('#\[quote(.*)\](.+)\[/quote\]#isU','<div class="quote"><div class="genmed"><b>$1 '._JOOMLACOMMENT_UBB_QUOTE.'</b></div><div class="quotebody">$2</div></div>',$matches);
}
}

return preg_replace_callback($patterns, array(&$this, 'parseUBB_recurse'), $matches );
}[/code]
;)

BUG with [quote] 14 years 7 months ago #9304

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I don't understand you - the new RC1 has fixed this bug.

BUG with [quote] 14 years 7 months ago #9305

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
Daniel Dimitrov wrote:

I don't understand you - the new RC1 has fixed this bug.

Sorry!
Please the template "modern" has not changed in the new rc1 ?

BUG with [quote] 14 years 7 months ago #9306

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
there are minor changes to the template in rc1.

BUG with [quote] 14 years 7 months ago #9313

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
Daniel Dimitrov wrote:

there are minor changes to the template in rc1.

Many thanks!
bug: the problem of editing ip is fixed on the frontend but not in backend ;)

Can you please add the possibility to choose a skin by the user in frontend? (example: forums-ipb)

BUG with [quote] 14 years 7 months ago #9316

  • was
  • was's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 44
  • Thank you received: 0
!the bug is still not solved!
[quote=David]...[quote=Chauviniste ]...[quote=David]...[quote=Anonyme]
Test
[/quote][/quote][/quote][/quote]new text

??

BUG with [quote] 14 years 7 months ago #9319

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I just tested it on my local machine - your code is working with RC1

BUG with [quote] 14 years 7 months ago #9442

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Was I think that I found the problem.
In RC1 the bug was let us say 50% fixed.

if you have the following
[quote=someone]some quote [quote=someone]somequote[/quote][/quote]
 

everything is working fine. But if you have
[quote]some quote [quote]somequote[/quote][/quote]
 

then this doesn't produce the desired effect.

first update the do_bbcode_quote function:
	public static function do_bbcode_quote($action, $attributes, $content, $params, $node_object) {
		$name = '';
		if (isset($attributes['default'])) {
			$name = $attributes['default'];
			$wrote = JText::_('JOOMLACOMMENT_UBB_WROTE');
		} else {
			$wrote = JText::_('JOOMLACOMMENT_UBB_QUOTE');
		}
 
		$quote = "<div class='quote'><div class='genmed'><b>" . $name . ' ' . $wrote . "</b></div><div class='quotebody'>".$content.'</div></div>';
		return $quote;
	}
 

and then in initUbbParsing replace the $bbcode->addcode for quote with this:
		$bbcode->addCode ('quote', 'callback_replace', 'JOSC_ubbcode::do_bbcode_quote', array ('usecontent_param' => 'default'),
				'block', array ('block'), array('inline'));
 

This should do the work.
  • Page:
  • 1
Time to create page: 0.216 seconds