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


 
Page Index Toggle Pages: 1
Topic Tools
 
[Standard] [noparse] also for Smilies (Read 6,642 times)
 Jul 16th, 2009 at 10:56pm
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
[Standard] [noparse] also for Smilies
deti wrote on May 26th, 2009 at 11:00am:
- The [ noparse ]-tag disables only UBBC between his tags.

I wonder if we shouldn't change this so that actually will disable smilies, as well.  Why?  Look at Matt Siegman's signature... YaBB3::DataSource.

In cases like that and in regular discussions that may involve some code, it's not always proper or beneficial to use [code] tags (because you don't want to use a [code] box for one word), and it might not be correct to disable smilies within the whole post, either, when you just want to disable them in a certain word (to prevent parsing problems like above).

In fact, is it even possible to disable smilies within signatures?  I don't recall that even being an option.  Of course, if [noparse] were modified to ignore smilies, that would provide the option automatically.
« Last Edit: Mar 25th, 2010 at 3:02am by N/A »  
WWW  
IP Logged  
 Reply #1 - Jul 17th, 2009 at 10:30am
There are no actions to perform.  

deti 
Legacy Dev Team
Development Team
****
Offline
Posts: 2,650
Prien am Chiemsee, Germany


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
cepheid wrote on Jul 16th, 2009 at 10:56pm:
In fact, is it even possible to disable smilies within signatures?

If ubbc-tags are allowed the signature runs through YaBBC.pl and therefore smilies are also parsed.

Try this to prevent this:
In YaBBC.pl
Code Select All
	sub noparse {
		my $noubbc = $_[0];
		$noubbc =~ s~([;!\(\)\-\.\/:\?\[\\\]\^D])~$killhash{$1}~g;
		$noubbc;
	} 



and in yabbc.js
Code Select All
	while( a=ubbcstr.match(/\[noparse\]\n*(.*?)\n*\[\/noparse\]/i) ) {
		var npmessage=a[1];
		npmessage=npmessage.replace(/\;/g, "&#59;");
		npmessage=npmessage.replace(/\./g, ".");
		npmessage=npmessage.replace(/\//g, "/");
		npmessage=npmessage.replace(/\[/g, "[");
		npmessage=npmessage.replace(/\]/g, "]");
		npmessage=npmessage.replace(/\!/g, "!");
		npmessage=npmessage.replace(/\(/g, "(");
		npmessage=npmessage.replace(/\)/g, ")");
		npmessage=npmessage.replace(/\-/g, "-");
		npmessage=npmessage.replace(/\./g, ".");
		npmessage=npmessage.replace(/\//g, "/");
		npmessage=npmessage.replace(/\:/g, ":");
		npmessage=npmessage.replace(/\?/g, "?");
		npmessage=npmessage.replace(/\\/g, "\");
		npmessage=npmessage.replace(/\^/g, "^");
		npmessage=npmessage.replace(/D/g,  "D");
		ubbcstr=ubbcstr.replace(/\[noparse\]\n*(.*?)\n*\[\/noparse\]/i, npmessage);
	} 

« Last Edit: Jul 17th, 2009 at 11:04am by deti »  
Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
WWW  
IP Logged  
 Reply #2 - Jul 17th, 2009 at 11:23am
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
deti wrote on Jul 17th, 2009 at 10:30am:
If ubbc-tags are allowed the signature runs through YaBBC.pl and therefore smilies are also parsed.

Ack, that is a lot of replacement code.  That also doesn't solve the smiley problem within messages (e.g. Module:Cheesyata).  If we expand to also ignore smileys, that also solves the signature problem (since the user can simply [noparse] their signature).
 
WWW  
IP Logged  
 Reply #3 - Jul 17th, 2009 at 1:05pm
There are no actions to perform.  

deti 
Legacy Dev Team
Development Team
****
Offline
Posts: 2,650
Prien am Chiemsee, Germany


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
cepheid wrote on Jul 17th, 2009 at 11:23am:
That also doesn't solve the smiley problem within messages

Huh Why not? For me it does!

[quote author=5553465E535F52360 link=1242670230/35#35 date=1247829795]If we expand to also ignore smileys, that also solves the signature problem (since the user can simply [noparse] their signature).[/quote]
The code does exactly this!!! :-?
« Last Edit: Jul 17th, 2009 at 1:07pm by deti »  
Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
WWW  
IP Logged  
 Reply #4 - Jul 17th, 2009 at 7:05pm
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
deti wrote on Jul 17th, 2009 at 1:05pm:
he code does exactly this!!!

No, it doesn't... noparse only turns off YaBBC, it does not turn off smilies.  The checkbox at the bottom turns off smilies as well as YaBBC, but the noparse tag turns off UBBC only.  Try the following:
Code Select All
[ noparse ]Method::Data[ /noparse ] 


It renders like this:
Method::Data

Even though YaBBC is turned off for that line, the smileys are not, leading to this display problem.  It is not always convenient to enclose things in [code] boxes, like when discussing things in regular English.  Also, I might not want to turn smilies or code off for the whole message, because I might want to actually use smilies or code... I just don't want certain things like Method::Data to render with smilies.  Surrounding them with doesn't help at the moment.

(Also, a bug: the [noparse] tags within a [code] block are interpreted and removed by YaBB.  ;This should not happen.  ;[code] blocks should interpret [highlight] only...)
« Last Edit: Jul 17th, 2009 at 7:07pm by cepheid »  
WWW  
IP Logged  
 Reply #5 - Jul 17th, 2009 at 8:34pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
There is a undocumented way of not parsing smilies using "# nosmileys" (no space):

Method::Data
« Last Edit: Jul 17th, 2009 at 8:36pm by N/A »  
 
IP Logged  
 Reply #6 - Jul 17th, 2009 at 9:48pm
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Quote:
There is a undocumented way of not parsing smilies using "# nosmileys" (no space):

But that turns smilies off for the whole post, the same as the checkbox.  I'm talking about turning it off locally for individual words/phrases.
 
WWW  
IP Logged  
 Reply #7 - Jul 18th, 2009 at 3:01pm
There are no actions to perform.  

deti 
Legacy Dev Team
Development Team
****
Offline
Posts: 2,650
Prien am Chiemsee, Germany


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
@
cepheid
Did you apply my code from post #34 on your testforum before you wrote your last posts? Doesn't look so for me because on my testforum with this code it works!
« Last Edit: Jul 18th, 2009 at 3:02pm by deti »  
Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
WWW  
IP Logged  
 Reply #8 - Jul 18th, 2009 at 7:52pm
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Re: Add [noparse] to YaBBC and "don't parse" checkbox
deti wrote on Jul 18th, 2009 at 3:01pm:
Did you apply my code from post #34 on your testforum before you wrote your last posts?

Oh, whoops.  No, I did not.  I'll try that again, sorry.  I'm wondering if there's a better way to do it than to replace all the punctuation characters with HTML entities, though... that seems inefficient.

I'll look into the smiley code and see if I can find a better way.  Maybe there isn't one...
 
WWW  
IP Logged  
 Reply #9 - Jul 20th, 2009 at 3:27pm
There are no actions to perform.  

deti 
Legacy Dev Team
Development Team
****
Offline
Posts: 2,650
Prien am Chiemsee, Germany


None
Re: Re: Add [noparse] to YaBBC and "don't parse" checkbox
This Topic was moved here from YaBB 2 - Bugs [Fixed] by deti.
 
Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
WWW  
IP Logged  
 Reply #10 - May 8th, 2010 at 11:08pm
There are no actions to perform.  

Matt Siegman 
YaBB Legends (Inactive)
*
Offline
Posts: 3,380
Wichita, KS


None
Re: [Standard] [noparse] also for Smilies
I changed how some things work, this should be fixed in the Perl now.

I moved the bulk of the code to a "private" function _do_ubbc with actual parameters and returns. DoUBBC is just a wrapper for it. I've changed some other code to cope with this.

It's semi-recursive. I'm sure there could be a better way to do it, but this was the quickest.

Please test this. Once we've confirmed everything works right, we can call this fixed.
« Last Edit: May 8th, 2010 at 11:44pm by Matt Siegman »  
-- Matt Siegman 8) Wish List
 
IP Logged  
 Reply #11 - May 8th, 2010 at 11:40pm
There are no actions to perform.  

Matt Siegman 
YaBB Legends (Inactive)
*
Offline
Posts: 3,380
Wichita, KS


None
Re: [Standard] [noparse] also for Smilies
I'm having trouble with CVS. Here's the patch for the Perl code.

I have to attach it since it's smiley code and gets a bit.... mangled....

And I had to change the extension....
« Last Edit: May 8th, 2010 at 11:43pm by Matt Siegman »  
yabb_diff.txt (2 KB | 134 )
-- Matt Siegman 8) Wish List
 
IP Logged  
 Reply #12 - May 9th, 2010 at 5:57am
There are no actions to perform.  

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


None
Re: [Standard] [noparse] also for Smilies
I upload to my testforum. But Smiley still there.
http://www.yabbworld.com/cgi-bin/yabbcvs/YaBB.pl?num=1273384065
 
...
PM me for YaBB Installation Service
WWW Jet Li 100000788351637  
IP Logged  
 Reply #13 - May 9th, 2010 at 10:05pm
There are no actions to perform.  

Matt Siegman 
YaBB Legends (Inactive)
*
Offline
Posts: 3,380
Wichita, KS


None
Re: [Standard] [noparse] also for Smilies
Works for me?

http://www.yabbworld.com/cgi-bin/yabbcvs/YaBB.pl?num=1273384065/0#1

That captcha is damn hard to use!

We'd obviously need to test this more, but it looks like it may just work.
 
-- Matt Siegman 8) Wish List
 
IP Logged  
 Reply #14 - May 9th, 2010 at 10:09pm
There are no actions to perform.  

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


None
Re: [Standard] [noparse] also for Smilies
aha. Just add [ noparse]...[/noparse] tag. Then works fine. Smiley

New
Sources/YaBBC.pl
in CVS.
« Last Edit: May 9th, 2010 at 10:09pm by Jet Li »  
...
PM me for YaBB Installation Service
WWW Jet Li 100000788351637  
IP Logged  
Page Index Toggle Pages: 1
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.