Foren / Cotonti / Support / BBcode help

tensh
#31390 12. November 2011, 17:30

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="$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="$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="$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="$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="$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="$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="$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="$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="$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="$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="$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="$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="$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 :)