Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Reformat the [img] tag?
#1
Not Solved
Reformat the [img] tag?

where can i reformat this tag or any of the standard tags

thanks
Reply
#2
Not Solved
AdminPHP->Configuration->MyCode->Add New MyCode

There you can set a new MyCode. I'm not sure whether it is possible to change existing basic built-in MyCodes without making core changes. I did try it, and it was accepted. But the changes were not effectuated.
Regards, Ad Bakker (NL)
Reply
#3
Not Solved
where is it located please Toungue
Reply
#4
Not Solved
Sorry, typing error:

AdminCP->Configuration->MyCode->Add New MyCode
Regards, Ad Bakker (NL)
Reply
#5
Not Solved
(02-06-2015, 07:47 AM)Ad Bakker Wrote: AdminPHP->Configuration->MyCode->Add New MyCode

There you can set a new MyCode. I'm not sure whether it is possible to change existing basic built-in MyCodes without making core changes. I did try it, and it was accepted. But the changes were not effectuated.

Adding the same MyCode than a built-in one will override the definition.

I've tested with the IMG code:
regexp:
\[img\](.*?)\[/img\]

Replacement:
<img src="$1" style="border: 2px dotted red;" />

When activated, all the pictures in posts are bordered.
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
#6
Not Solved
does it use the RTE settings of height and width?
Reply
#7
Not Solved
It does. The .scaleimages class is applyed on the div of the post, so all images have a max-width at 100% (of the container)

EDIT I think I didn't understood "the RTE", if you mean adding the =WIDTHxHEIGHT parameter, it didn't
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
#8
Not Solved
it doesnt actually replace, if you you use the RTE , the old IMG tag is used

SO how do i specify the $2, $3 etc for the width, height, caption etc?
Reply
#9
Not Solved
(02-06-2015, 11:46 AM)Crazycat Wrote: Adding the same MyCode than a built-in one will override the definition.

I suspect I made an error in the test then Sad . Good to know this also works!!
Regards, Ad Bakker (NL)
Reply
#10
Not Solved
(02-06-2015, 12:17 PM)expat Wrote: it doesnt actually replace, if you you use the RTE , the old IMG tag is used

SO how do i specify the $2, $3 etc for the width, height, caption etc?

You need several MyCode, like:
Regexp : \[img width=([0-9]{1,3})\](.*?)\[/img\]
Replacement: <img style="width: $1px;" src="$2" />

Regexp : \[img height=([0-9]{1,3})\](.*?)\[/img\]
Replacement: <img style="height: $1px;" src="$2" />

Regexp : \[img width=([0-9]{1,3}) height=([0-9]{1,3})\](.*?)\[/img\]
Replacement: <img style="width: $1px; height: $2px;" src="$3" />

And so long.

NB: the height parameter is dummy, on a board the width is more important.

NB2: I think (I'm sure) there is a better way to have optionnal parameters than multiplying the MyCode, but I didn't look a lot at how to do that.
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)