YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Pages: 1 2 
Topic Tools
 
GreyBox images bugs (Read 8,751 times)
 Aug 17th, 2010 at 7:55am
There are no actions to perform.  

Fduch 
Junior Member
**
Offline
Posts: 57
.


None
GreyBox images bugs
...

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 »  
WWW  
IP Logged  
 Reply #1 - Aug 17th, 2010 at 2:09pm
There are no actions to perform.  
Captain John 
Ex Member


None
Re: GreyBox images bugs
confirmed ........
 
 
IP Logged  
 Reply #2 - Aug 17th, 2010 at 3:22pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: GreyBox images bugs
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 N/A »  
 
IP Logged  
 Reply #3 - Aug 17th, 2010 at 3:53pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: GreyBox images bugs
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]; 

 
 
IP Logged  
 Reply #4 - Aug 18th, 2010 at 4:02am
There are no actions to perform.  

Fduch 
Junior Member
**
Offline
Posts: 57
.


None
Re: GreyBox images bugs
@
Carsten

Thanks!
 
WWW  
IP Logged  
 Reply #5 - Aug 22nd, 2010 at 9:11am
There are no actions to perform.  

Jet Li 
Legacy Dev Team
Development Team
****
Offline
Posts: 6,588
Hong Kong


None
Re: GreyBox images bugs
New
Sources/YaBBC.pl
in CVS.
 
...
PM me for YaBB Installation Service
WWW Jet Li 100000788351637  
IP Logged  
 Reply #6 - Aug 22nd, 2010 at 10:59am
There are no actions to perform.  
Carsten 
Ex Member


None
Re: GreyBox images bugs
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 N/A »  
 
IP Logged  
 Reply #7 - Aug 22nd, 2010 at 11:35am
There are no actions to perform.  

Jet Li 
Legacy Dev Team
Development Team
****
Offline
Posts: 6,588
Hong Kong


None
Re: GreyBox images bugs
New
Sources/YaBBC.pl
in CVS again.
 
...
PM me for YaBB Installation Service
WWW Jet Li 100000788351637  
IP Logged  
 Reply #8 - Nov 29th, 2010 at 4:41am
There are no actions to perform.  
Captain John 
Ex Member


None
Re: GreyBox images bugs
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
 
 
IP Logged  
 Reply #9 - Jan 8th, 2011 at 2:03pm
There are no actions to perform.  

Jet Li 
Legacy Dev Team
Development Team
****
Offline
Posts: 6,588
Hong Kong


None
Re: GreyBox images bugs
New
cgi-bin/yabb3/Sources/YaBBC.pl
in SVN.
 
...
PM me for YaBB Installation Service
WWW Jet Li 100000788351637  
IP Logged  
 Reply #10 - Jan 28th, 2012 at 12:38am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,852
Earth


YaBB 2.5
Re: GreyBox images bugs
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.
 
WWW  
IP Logged  
 Reply #11 - Feb 3rd, 2012 at 4:57pm
There are no actions to perform.  

JonB 
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 3,614
Land of the Blazing Sun!


None
Re: GreyBox images bugs
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.
 
IP Logged  
 Reply #12 - Feb 3rd, 2012 at 5:51pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,852
Earth


YaBB 2.5
Re: GreyBox images bugs
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 | 85 )
WWW  
IP Logged  
 Reply #13 - Feb 3rd, 2012 at 6:28pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,852
Earth


YaBB 2.5
Re: GreyBox images bugs
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
 
WWW  
IP Logged  
 Reply #14 - Feb 3rd, 2012 at 6:58pm
There are no actions to perform.  

JonB 
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 3,614
Land of the Blazing Sun!


None
Re: GreyBox images bugs
OTAY !!!

Cheesy
 
I find your lack of faith disturbing.
 
IP Logged  
Pages: 1 2 
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.