Page Index Toggle Pages: [1] 2 
Topic Tools
Hot Topic (More than 10 Replies) GreyBox images bugs (Read 10,257 times)
Fduch
Junior Member
**
Offline



Posts: 59
Location: .
GreyBox images bugs
Aug 17th, 2010 at 7:55am
Post Tools


For example, see the source code of this message:

<img src="http://www.yabbforum.com/img/header2_left.png" name="signat_img_resize_1" alt="..." title="..." border="0" style="display: inline; " width="400" height="152">

but must be:

<img src="http://www.yabbforum.com/img/header2_left.png" name="post_img_resize_1" alt="..." title="..." border="0" style="display: inline; " width="400" height="152">
« Last Edit: Aug 17th, 2010 at 7:55am by Fduch »  
Back to top
WWW  
IP Logged
 
Captain John
Ex Member


Re: GreyBox images bugs
Reply #1 - Aug 17th, 2010 at 2:09pm
Post Tools
confirmed ........
  
Back to top
 
IP Logged
 
Carsten
Ex Member


Re: GreyBox images bugs
Reply #2 - Aug 17th, 2010 at 3:22pm
Post Tools
The problem is caused by this code - i don't have the faintest idea why the 'extra' sub routine was added in 2.5 - so i've asked in the proper place?? My suggestion is to remove the highlighted code - but better wait for any answer from the dev. in question Wink

Code
Select All
sub DoUBBC {
  my $msg = _do_ubbc($message);
	$message = $msg;
}

sub _do_ubbc {
  my $message = join "", @_; 




Edited:
Having had a closer look at the code i see it has to do with the 'noparse' tag - still causes a bug though
« Last Edit: Aug 17th, 2010 at 3:40pm by »  
Back to top
 
IP Logged
 
Carsten
Ex Member


Re: GreyBox images bugs
Reply #3 - Aug 17th, 2010 at 3:53pm
Post Tools
Guess the fix would be:

In YaBBC.pl find
Code
Select All
sub DoUBBC { 


and add after
Code
Select All
	$image_type = $_[0]; 


then find and remove
Code
Select All
	my $image_type = $_[0]; 

  
Back to top
 
IP Logged
 
Fduch
Junior Member
**
Offline



Posts: 59
Location: .
Re: GreyBox images bugs
Reply #4 - Aug 18th, 2010 at 4:02am
Post Tools
@ Carsten

Thanks!
  
Back to top
WWW  
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: GreyBox images bugs
Reply #5 - Aug 22nd, 2010 at 9:11am
Post Tools
New
Sources/YaBBC.pl
in CVS.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Carsten
Ex Member


Re: GreyBox images bugs
Reply #6 - Aug 22nd, 2010 at 10:59am
Post Tools
Had a even closer look at the 'noparse' code now. No offence, but that piece of code is one of the strangest and most complicated ways i've seen so far to solve a very simple regex case. Causing unnecessary sub routine recursion. And the 'noparse' tags are not working inside 'quote' and 'edit' tags ('external' quote and edit tags appear as code).

This should do the same without all the splitting and recursion and make the 'noparse' tags work inside 'quote' and 'edit' tags too (and of course still fixing the resize bug):

In YaBBC.pl find
Code
Select All
		$noubbc =~ s~([\/\]\[\.])~$killhash{$1}~g;
 


and replace it with
Code
Select All
		$noubbc =~ s~([;!\(\)\-\.\/:\?\[\\\]\^D])~$killhash{$1}~g;
 



then find
Code
Select All
sub DoUBBC {
  my $msg = _do_ubbc($message);
	$message = $msg;
}

sub _do_ubbc {
  my $message = join "", @_;
	return $message if $ns eq "NS" || $message =~ s/# nosmileys//isg;

	my $image_type = $_[0];

	if($message =~ m{(.*?)\[noparse\](.*)}) {
		my ($beginning, $temp, $middle, $end) = (undef, undef, undef, undef);
		($beginning, $temp) = ($1, $2);
		if($temp =~ m{(.*?)\[/noparse\](.*)}) {
			my ($middle, $end) = ($1, $2);
			return _do_ubbc($beginning).noparse($middle)._do_ubbc($end);
		}
		else {
			return _do_ubbc($beginning).noparse($temp);
		}
	}
 


and replace it with
Code
Select All
sub DoUBBC {
	return $message if $ns eq "NS" || $message =~ s/# nosmileys//isg;

	my $image_type = $_[0];

	$message =~ s~\[noparse\](.*?)(\[/noparse\]|$)~noparse($1)~eisg; 



OBSERVE! - I had to add a space between '#' and 'nosmileys' (twice) to make code tags work in this post - the space should of course not be there in the code

Edited:
Just to clearify: I do understand that the current code will return the 'noparse' text without running it through 'DoUBBC conversion' - what i do not understand is why, when you can simply 'kill' the smilies and avoid recursion.
« Last Edit: Aug 22nd, 2010 at 12:13pm by »  
Back to top
 
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: GreyBox images bugs
Reply #7 - Aug 22nd, 2010 at 11:35am
Post Tools
New
Sources/YaBBC.pl
in CVS again.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Captain John
Ex Member


Re: GreyBox images bugs
Reply #8 - Nov 29th, 2010 at 4:41am
Post Tools
Quote:
OBSERVE! - I had to add a space between '#' and 'nosmileys' (twice) to make code tags work in this post - the space should of course not be there in the code


  The space is in the CVS code YaBB_2_6_x branch; YaBBC.pl
  
Back to top
 
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: GreyBox images bugs
Reply #9 - Jan 8th, 2011 at 2:03pm
Post Tools
New
cgi-bin/yabb3/Sources/YaBBC.pl
in SVN.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,397
Location: Earth

YaBB 2.6.1
Re: GreyBox images bugs
Reply #10 - Jan 28th, 2012 at 12:38am
Post Tools
The actual fix if you want to maintain your 2.5 files is to find
Code
Select All
sub DoUBBC {
    my $msg = _do_ubbc($message);
	$message = $msg;
}

sub _do_ubbc {
 


in YaBBC.pl and replace it with
Code
Select All
sub DoUBBC { 



This fix was documented a while back but seems to have disappeared.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,932
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: GreyBox images bugs
Reply #11 - Feb 3rd, 2012 at 4:57pm
Post Tools
Dandello -

What you are saying (if I understand correctly) is that the only 'fix' needed for YaBBC.pl ver 1.4 as distributed in the YaBB2.5AE SourceForge downloads is the code substitution in your last post???

Do I have that right???
Cool
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,397
Location: Earth

YaBB 2.6.1
Re: GreyBox images bugs
Reply #12 - Feb 3rd, 2012 at 5:51pm
Post Tools
Um, I may have forgotten another fix. I know there was a fix and I know I've used it and it works. And it was simple... Let me look over my other versions of YaBBC.pl. I know this one is working: http://www.shadolibrary.org/cgi-bin/yabb2/YaBB.pl?num=1305323498

And I've attached a copy of the YaBBC.pl file that I know for a fact works.
Note that it does use a an extra Perl module that should be standard. If it isn't - open the file in a text editor and replace 'croak' with 'die'.
« Last Edit: Feb 3rd, 2012 at 6:12pm by Dandello »  

YaBBC.zip ( 7 KB | 88 Downloads )

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,397
Location: Earth

YaBB 2.6.1
Re: GreyBox images bugs
Reply #13 - Feb 3rd, 2012 at 6:28pm
Post Tools
GOT IT Grin in YaBBC.pl find:
Code
Select All
sub DoUBBC {
  my $msg = _do_ubbc($message);
	$message = $msg;
}

sub _do_ubbc {
  my $message = join "", @_;
	return $message if $ns eq "NS" || $message =~ s/# nosmileys//isg;

	my $image_type = $_[0];
 



and replace it with:
Code
Select All
sub DoUBBC {
	my $image_type = $_[0];

	return $message if $ns eq "NS" || $message =~ s/# nosmileys//isg; 



remember to take out the space between the '#' and 'nosmileys'

I knew it was simple.   Smiley
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,932
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: GreyBox images bugs
Reply #14 - Feb 3rd, 2012 at 6:58pm
Post Tools
OTAY !!!

Cheesy
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Topic Tools
 
  « Board Index ‹ Board  ^Top