e107
e107 copied to clipboard
theme installation - authomatic images upload
Hi,
I have never noticed this before, maybe it's there long time. But when you install new theme, it scans the folder and upload to media manager all images.
Nice feature but why it doesnt scan only images or install folder? I have theme with a lof of assets and it uploaded maybe 200 images when in fact I need to use maybe 5.
Where to put those images to avoid automatic upload during theme installation?
Thanks
Have you tried to create another folder inside your theme, named like, for instance, images.tmp?
@rica-carv I checked code before this issue. There is regex for this, so renaming folder will not help.
Fresh installation, there is folder with assets called inset.
This is great future for install folder. I should have a way to control what is uploaded.
$med = e107::getMedia();
$med->import('_common_image', e_THEME.$name, "^.*?logo.*?(\.png|\.jpeg|\.jpg|\.JPG|\.GIF|\.PNG)$");
$med->import('_common_image', e_THEME.$name, '', 'min-size=20000');
default for second import:
[a-zA-z0-9_-]+\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF)
It imports every image in the theme folder. Could you explain to me reason for this? I understand folders install, images, img, but not everything.
Where to put theme assets if I don't want to upload them to media manager?
Thanks
@Jimmi08 The first one imports any files marked containing 'logo' in the filename. The 2nd imports any images over 20000 kb (or it could be bytes, I don't remember) I believe the 2nd one needs to be fixed so that it looks only inside the 'install' folder.
Not sure if this is correct fix, tested on windows only.
$med->import('_common_image', e_THEME.$name."/install/", '', 'min-size=20000');
Either close this issue as not planned or fix it, please. Thanks.