Foren / Cotonti / Support / BBcode Thumb is not working

once OK, but twice NOT

pieter
#1 27. Februar 2009, 03:46
If I add a thumbnail like:


[thumb]bananaleaf_2col_64.jpg[/thumb]

I have no problems.

But if I do it twice i does not work.

[thumb]bananaleaf_2col_64.jpg[/thumb]
[thumb]bananaleaf_2col_64.jpg[/thumb]

He is not detecting the first [ /thumb], he takes the second one. Why?

bbcode:
\[thumb\](.*?[^"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/thumb\]
<a href="datas/users/$1"><img src="datas/thumbs/$1" /></a>

How can I solve this?
... can we help you ...
Trustmaster
#2 27. Februar 2009, 04:42
The same bug as we had with img bbcode. Try this pattern:
\[thumb\](.*?[^\]"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/thumb\]
May the Source be with you!
pieter
#3 27. Februar 2009, 13:53
This does not solve it.

Here at cotonti you have the same problem.
See my first post above.
You get a red cross If you use it twice.

EDIT: It is solved. Thank
... can we help you ...

Dieser Beitrag wurde von pieter (am 27. Februar 2009, 17:34, vor 15 Jahre) bearbeitet
Trustmaster
#4 28. Februar 2009, 03:50
Please add a ticket to Trac, this should be fixed in the SVN tree too.
May the Source be with you!
foxhound
#5 23. April 2009, 08:01
I have some troubles too on my test website. The new thumb creation from the PFS works, but on all my old pages the thumbs seem to show completely random if they even do show.
Sometimes it shows the thumb but most of the time it does not and than the link is completely fubar'ed.

For example check this page where none of the thumb show (created with the old seditio site):
http://www.armaholic.com/testers/armaholictest/page.php?id=5398

Now check this page, all of a sudden only one image decided to (this page too was created with the old seditio site):
http://www.armaholic.com/testers/armaholictest/page.php?id=5396


The code in the seditio compatibality plugin looks like this:
sed_bbcode_add('thumb', 'pcre', '\[thumb=((?:http://|https://|ftp://)?[^"\';:\?]+\.(?:jpg|jpeg|gif|png))\]([^"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/thumb\]','<a href="pfs.php?m=view&amp;v=$2"><img src="$1" alt="" /></a>', true, 128, 'seditio');
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
pieter
#6 23. April 2009, 14:17
# foxhound :
The code in the seditio compatibality plugin looks like this:
sed_bbcode_add('thumb', 'pcre', '\[thumb=((?:http://|https://|ftp://)?[^"\';:\?]+\.(?:jpg|jpeg|gif|png))\]([^"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/thumb\]','<a href="pfs.php?m=view&amp;v=$2"><img src="$1" alt="" /></a>', true, 128, 'seditio');

In the BBcodce you see ((?:http://|https://|ftp://
This means you need to put http:// before the picture, so the whole path. Not /datas/thumbs/...
... can we help you ...
foxhound
#7 23. April 2009, 19:00
Hmm, ok than I have a problem as I have 5000+ pages using the old seditio PFS way of creating a thumb on my pages.
So, I guess I need to add the full path to the above code:
sed_bbcode_add('thumb', 'pcre', '\[thumb=((?:http://www.armaholic.com/|https://www.armaholic.com/|ftp://www.armaholic.com/)?[^"\';:\?]+\.(?:jpg|jpeg|gif|png))\]([^"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/thumb\]','<a href="pfs.php?m=view&amp;v=$2"><img src="$1" alt="" /></a>', true, 128, 'seditio');

Now, it will display only the first picture:
http://www.armaholic.com/testers/armaholictest/page.php?id=5398

One picture works but if I add more pictures after it it no longer works:
http://www.armaholic.com/testers/armaholictest/page.php?id=5402

When you check the properties of the picture it seems to me it tries to put all links into the first picture, instead of understanding the next picture should show, look at the properties of this first picture:
http://www.armaholic.com/testers/armaholictest/datas/thumbs/4-arma2_preview_hry_sme_april_20.jpg]4-arma2_preview_hry_sme_april_20.jpg[/thumb]%20%3Ca%20href=
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
pieter
#8 23. April 2009, 19:20
indeed, I created today a ticket in trac to solve the problem.
... can we help you ...
foxhound
#9 23. April 2009, 19:58
Ahh ok thanks. :)
I hope they can solve this otherwise I will have a lot of DB changes to do manually, like a couple of thoussand :-))
For now I will leave this and continue working on other things.
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
biro
#10 24. April 2009, 00:40
actually i think it should be a problem in the parser
Be sure to check out<br /><br /><br />
My site-<a href="http://www.iso-center.co.cc">http://www.iso-center.co.cc</a><br />
My plugins;TPL Editior 1.2 &amp; Mobile site
Kingsley
#11 24. April 2009, 06:36
# Trustmaster : The same bug as we had with img bbcode. Try this pattern:
\[thumb\](.*?[^\]"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/thumb\]

well, this fixed it partially for me.. It now displays the image, but when you click it, nothing happens..
Will probably be some coding I do not have in my skin..
foxhound
#12 24. April 2009, 23:23
Kind of funny, I have replaced the code in the seditio compatibility plugin with the above code and I am also using the "Thumbnailviewer" plugin.
Although the picture does not show (when using multiple pictures) you can still click the displayed red cross and it will load the full image :-O

Try for yourself here:
http://www.armaholic.com/testers/armaholictest/page.php?id=5388

It should display 2 thumbs but as reported it can not do that, however when you click the not showing picture you can see the picture.
Please note it does show the last picture of the 2, not the first.

Any update one this?

When we move to Cotonti we will have to edit the DB to change the thoussands of links we use from the seditio thumb creation:
[thumb=datas/thumbs/8582-panthera_10k_view.jpg]8582-panthera_10k_view.jpg[/thumb][thumb=datas/thumbs/4-arma2_preview_april_pcdome_45.jpg]4-arma2_preview_april_pcdome_45.jpg[/thumb]

To this:
[thumb=http://www.armaholic.com/datas/thumbs/8582-panthera_10k_view.jpg]8582-panthera_10k_view.jpg[/thumb] [thumb=http://www.armaholic.com/datas/thumbs/8582-panthera_10k_view.jpg]8582-panthera_10k_view.jpg[/thumb]

That at least fixes the fact the pics will show again, but still does not fix the issue with the seditio compatibility plugin for thumb creation.
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />

Dieser Beitrag wurde von foxhound (am 13. Juni 2009, 20:57, vor 14 Jahre) bearbeitet