2015-02-06, 05:05 AM
Pages: 1 2
2015-02-06, 07:47 AM
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.
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.
2015-02-06, 10:30 AM
where is it located please
2015-02-06, 10:46 AM
Sorry, typing error:
AdminCP->Configuration->MyCode->Add New MyCode
AdminCP->Configuration->MyCode->Add New MyCode
2015-02-06, 11:46 AM
(2015-02-06, 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.
2015-02-06, 12:03 PM
does it use the RTE settings of height and width?
2015-02-06, 12:12 PM
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
EDIT I think I didn't understood "the RTE", if you mean adding the =WIDTHxHEIGHT parameter, it didn't
2015-02-06, 12:17 PM
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?
SO how do i specify the $2, $3 etc for the width, height, caption etc?
2015-02-06, 12:18 PM
(2015-02-06, 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 . Good to know this also works!!
2015-02-06, 12:46 PM
(2015-02-06, 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.
Pages: 1 2