Hi all,
Can anyone with knowledge of php help?
Using v9 this is a problem when trying to use the php image resize method commonly used here: http://community.actinic.com/showthread.php?t=34654
If you need it to apply to an Extend Info Image it produces errors in actinic particularly if images aren't directly in the site1 folder but in sub folders.
Sometimes it outputs when you upload but this hasn't happened for me this time so I looked into the way ExtendedInfoImage and ProductImageFileName are handled.
ExtendedInfoImage ouput example: ../folder/eximagehere.jpg
ProductImageFilename (same image) example: folder\eximagehere.jpg
So I guess to stop the error we need to create a version of the extendedinfoimage that removes the ../ and replaces any / (forward slash) with a \ (back slash).
Does anyone know how to do this using php?
I though something like this (but I don't know anything about php):
That strips the sub folders as well.
If it could be done you could then apply it direct to the image resize php or create another custom layout and refer to it instead of the standard filename inside the php resize script.
Sounds complicated but all i really need to know if how to remove ../ and replace / with \ using php.
Really would appreciate the help.
Regards
bangers
Can anyone with knowledge of php help?
Using v9 this is a problem when trying to use the php image resize method commonly used here: http://community.actinic.com/showthread.php?t=34654
If you need it to apply to an Extend Info Image it produces errors in actinic particularly if images aren't directly in the site1 folder but in sub folders.
Sometimes it outputs when you upload but this hasn't happened for me this time so I looked into the way ExtendedInfoImage and ProductImageFileName are handled.
ExtendedInfoImage ouput example: ../folder/eximagehere.jpg
ProductImageFilename (same image) example: folder\eximagehere.jpg
So I guess to stop the error we need to create a version of the extendedinfoimage that removes the ../ and replaces any / (forward slash) with a \ (back slash).
Does anyone know how to do this using php?
I though something like this (but I don't know anything about php):
<actinic:block php="true">echo basename(str_replace('/','\\', '<actinic:variable name="ExtendedInfoImage" encoding="perl" selectable="false" />'));</actinic:block>
If it could be done you could then apply it direct to the image resize php or create another custom layout and refer to it instead of the standard filename inside the php resize script.
Sounds complicated but all i really need to know if how to remove ../ and replace / with \ using php.
Really would appreciate the help.
Regards
bangers
Comment