News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Reparse img bbcode? Remove height and width.

Started by Black Tiger, November 04, 2017, 07:54:53 PM

Previous topic - Next topic

Black Tiger

I had configured a max of 300 as max. width and height of posted images.
Now I would like to disable that, which is no problem.

But can I reparse the bbcode or imgcode some how to the height and width tags get cleared from older post?

Due to the former configuration the code in old post now look like:
[img width=xxx height=xxx]http://i64.tinypic.com/somepic.jpg[/img]
which creates small images. This should become:
[img]http://i64.tinypic.com/somepic.jpg[/img]
so the same but without the leading space and the width and height tags.

The width and height are not all the same that's why I put xxx there.
Is this possible some way?
Greetings, Black Tiger

Kindred

You would have to edit it directly in the databae
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Black Tiger

That's a pity. Any clue on a database query which fixes this? If possible without having to put in every value seperately?
Greetings, Black Tiger

Arantor

There is no database query that can do it one-off because while find/replace is possible, you can't do a regex-like replace to match various kinds.

Black Tiger

I was afraid of that. Luckily it are not too many different sizes in only a couple of forums.
Can you give me the correct query to remove the space, width and height then? Would this be correct or do I need do change something?
update smf_messages set post_text = replace(post_text, ' width=168 height=300', '');
and then the same for every other existing value.
Greetings, Black Tiger

Arantor


Black Tiger

Greetings, Black Tiger

Advertisement: