Forum Grounds

The Violated BBS
It is currently Fri Sep 03, 2010 9:06 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Improves
PostPosted: Thu Jan 28, 2010 2:54 am 
Offline

Joined: Thu Jan 28, 2010 2:44 am
Posts: 3
Well, i was programming a page today and wanted to implement BBcode, i found this pack and i found it amazing.
But, i found some wormholes that i filled and i want to share it to improve it :)
The lines are aprox, cause i changed the code and some lines went a bit lower or upper

First
P: Im a spanish guy, so i do use "á" "é".. charsets, and whenever i used em with the parser it was awful (translated them to a awful code).
S: I had to change htmlentities adding 'UTF-8' , in parser (line ~500) and deparser (line ~905)
Code:
$s = htmlentities($s, ENT_QUOTES,'UTF-8');
$s = html_entity_decode($s, ENT_QUOTES,'UTF-8');


It was a successfull fix, so i suggest to make a way to change the char encoding in a easy way (as a parammeter in p and deparse function)

Second:
P: I was lacking Youtube :)
S: change parse (~line 573, below font block) deparse(~line 815) (inside the array, at last position)
Code:
$s = preg_replace("#\[youtube\](.*)\[\/youtube\]#Ui", "<object width=\"425\" height=\"350\"><embed src=\"http://www.youtube.com/v/$1\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"350\"></embed></object>", $s);

"[youtube]$1[/youtube]" => "\<object width\=\"425\" height\=\"350\"\>\<embed src\=\"http://www.youtube.com/v/(.*)\" type\=\"application/x-shockwave-flash\" width\=\"425\" height\=\"350\"\>\<\/embed\>\<\/object\>",
   );


I added a thir stuff but its my site specific.

pd: I wouldnt care to help you if u need more help ;) just send me a MP if u want some help.


Top
 Profile  
 
 Post subject: Re: Improves
PostPosted: Sat Jan 30, 2010 3:40 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 03, 2010 11:45 pm
Posts: 12
thanks, both changes will be implemented :)
if you have any more, feel free to post them.

I, however, did test the app with non-english charsets, but not spanish (i tested with Croatian), and it was fine.


Top
 Profile  
 
 Post subject: Re: Improves
PostPosted: Sat Jan 30, 2010 5:25 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 03, 2010 11:45 pm
Posts: 12
Both improves added in newest version 1.0.1-dev. However your youtube snippet is not okay. I mean, it works on like [youtube]ZeFXJeXvP5I[/youtube], but not on [youtube]http://www.youtube.com/watch?v=ZeFXJeXvP5I[/youtube]. Of course you know that, but I am just of opinion that most of users use the second way. So I'll add that too. You've been spotlighted, too (http://bbcparser.recgr.com/releases.php)


Top
 Profile  
 
 Post subject: Re: Improves
PostPosted: Tue Feb 02, 2010 8:11 pm 
Offline

Joined: Thu Jan 28, 2010 2:44 am
Posts: 3
About the youtoube, i always use that kind of way on forums, i didnt even thought to do it other way.

another bit of improves, i tested it lightly and worked, u should test em a bit more b4 adding em

Center and Spoiler
Line ~326, add to the $rep array
27 => '<div align="center">',
28 => '</div>',
29 => '<div><input type="button" value="Show" style="width:75px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.getElementsByTagName(\'div\')[0].style.display = \'\';this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"><div style="display: none;">',
30 => '</div></div>'
Line ~291, add to the $bbc array
27 => '[center]',
28 => '[/center]',
29 => '[spoiler]',
30 => '[/spoiler]'

Its not much, but is another cent.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group