cotonti.com : BBcode help https://www.cotonti.com Son konu mesajları Cotonti en Sat, 25 Oct 2025 23:43:51 -0000 Trustmaster To allow empty alt contents, replace

alt=(.*?[^"\';:\?])

with

alt=(.*?[^"\';:\?]?)
]]>
Paz, 13 Kas 2011 10:03:38 -0000
tensh ... good idea :) I'll be back in half an hour.

Added 24 minutes later:

... I can't reproduce O_O Now it works nice...

BUT... the bbcodes don't work if alt is empty (it happens). What would you recommend to make it always work? Always put a space there...?

Added 14 minutes later:

yes, it's something about the alt attribute. If the bbcode ends with alt=] , then errors appear.

How to prevent it?

Added 1 hour later:

OK, I found a way... I just made it required in fckeditor >_> I'll get back when I stumble upon more problems.

Generally I'm glad with my progress, I edited (ekhm... hacked >_> but we all know how it looks like: no proper tpls) Genoa pfs a little to make the standalone version compatible with fckeditor. :) So when I click "image" and then "browse", PFS standalone pops up and I can chose images from PFS. :) Yay! Then fckeditor calculates width and height and I can start playing with it.

Just now I have to add hundreds of image bbcodes to handle all that vspace hspace border etc crap ^_^ (excuse my french). But I think it will be worth it.

]]>
Cmt, 12 Kas 2011 19:14:10 -0000
Trustmaster It would help a lot if you first found which one of them (or if any of them) causes this problem using the method of exclusion (adding those bbcodes one by one). It's a suicide checking all these regexps at once for consistency.

]]>
Cmt, 12 Kas 2011 18:51:34 -0000
tensh Hi,

I want to add the following bbcodes to my site:

	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) vspace=(\d*) border=(\d*) align=(\w*) hspace=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" vspace="$2" border="$3" align="$4" hspace="$5" height="$6" alt="$7" src="https://www.cotonti.com/$8">', true, 128, 'fckeditor');	
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) vspace=(\d*) align=(\w*) hspace=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" vspace="$2" align="$3" hspace="$4" height="$5" alt="$6" src="https://www.cotonti.com/$7">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) vspace=(\d*) border=(\d*) hspace=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" vspace="$2" border="$3" hspace="$4" height="$5" alt="$6" src="https://www.cotonti.com/$7">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) border=(\d*) hspace=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" border="$2" hspace="$3" height="$4" alt="$5" src="https://www.cotonti.com/$6">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) vspace=(\d*) border=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" vspace="$2" border="$3" height="$4" alt="$5" src="https://www.cotonti.com/$6">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) border=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" border="$2" height="$3" alt="$4" src="https://www.cotonti.com/$5">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) align=(\w*) hspace=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" align="$2" hspace="$3" height="$4" alt="$5" src="https://www.cotonti.com/$6">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) vspace=(\d*) align=(\w*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" vspace="$2" align="$3" height="$4" alt="$5" src="https://www.cotonti.com/$6">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) align=(\w*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" align="$2" height="$3" alt="$4" src="https://www.cotonti.com/$5">', true, 128, 'fckeditor');	
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) border=(\d*) align=(\w*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" border="$2" align="$3" height="$4" alt="$5" src="https://www.cotonti.com/$6">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) border=(\d*) align=(\w*) hspace=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" border="$2" align="$3" hspace="$4" height="$5" alt="$6" src="https://www.cotonti.com/$7">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) vspace=(\d*) border=(\d*) align=(\w*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" vspace="$2" border="$3" align="$4" height="$5" alt="$6" src="https://www.cotonti.com/$7">', true, 128, 'fckeditor');
	sed_bbcode_add('img', 'pcre', '\[img width=(\d*) height=(\d*) alt=(.*?[^"\';:\?])\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]', '<img width="$1" height="$2" src="https://www.cotonti.com/$4" alt="$3" />', true, 128, 'fckeditor');

I'm trying to make it work because I want a better image support with bbcode fckeditor for Genoa. The only thing is that Cotonti doesn't like these codes. The result is that page_html doesn't want to get parsed at all (during page edit) and even though page_text has some text in it, the page on site is blank (parser protests)

I can't really tell where I made a mistake... I don't like all that regexes. Please help, I'm fighting with it for a long time already :)

]]>
Cmt, 12 Kas 2011 17:30:59 -0000