Jump to content

Custom Upload Names


adrian

Recommended Posts

Hi @LAPS - I just tested here and even though currently it's not possible to select the user template, if you don't select any, the module does work on the user template. BTW - it would be trivial for me to allow selecting the user template - for now you can enable by changing line #736 to:

if($currtemplate->name != 'user' && ($currtemplate->flags & Template::flagSystem)) continue;

I don't have access to LoginRegisterPro so I am not sure about that but the module does work with uploads via the API so I would have thought it worked. Does the "Rename on Save" option help?

Link to comment
Share on other sites

Hi @adrian, thanks for the support.

  1. I (and I think almost any developer) am a bit reluctant to change the source code directly. It should work as-it-is.
  2. The enablement of the "Rename on Save" option helps with LoginRegisterPro (LRP). However, I find it a bit negative for performance reasons in addition to breaking file links.

Can we expect in a future release of the module to allow selecting the user template and renaming LRP profile image just on upload?

Link to comment
Share on other sites

6 hours ago, LAPS said:

Hi @adrian, thanks for the support.

  1. I (and I think almost any developer) am a bit reluctant to change the source code directly. It should work as-it-is.
  2. The enablement of the "Rename on Save" option helps with LoginRegisterPro (LRP). However, I find it a bit negative for performance reasons in addition to breaking file links.

Can we expect in a future release of the module to allow selecting the user template and renaming LRP profile image just on upload?

1) That was just to get you going - I'll make the change but I was hoping to hear back about LRP to see if I could fix that for you at the same time before committing a new version.

2) Because I don't have LRP I can't test with it to figure out why it's not working, but if someone who does have it can figure out the issue and provide a fix I'd be happy to include it.

Link to comment
Share on other sites

  • 1 year later...

Hi,

i'm wondering, it may seem a curious question.. but is it possible with this module to condition the renaming of an image to its original name?
for exemple, rename only if the name contains seom strings like screenshot (or capture_decran for frenchies :)) or dcsc and so on, you know those image not renamed from the cameras sd cards or screenshot tools
this only to help some lazy customers or friends not to ruin their SEO forgetting the good practices they have been told because even if it is in my nature i feel a bit harsh renaming images even if they have made some namig effort, some of them do 😄

just a funny idea 🙂

have a nice day

Link to comment
Share on other sites

Hi @virtualgadjo - I see where you're coming from, but I am wondering whether this would be a system wide setting or if it would need to be a setting on each rule?

I am tempted to think that your suggestion for hooking into customRenameUploads() might be the best option though, but if you feel like adding a setting for your needs, I'd be happy to accept a PR.

 

Link to comment
Share on other sites

Hi @adrian

thanks a lot for your answer
i think that in the case i'm on iwill go for the simple solution but as soon as i've got a little more time to dive into the code and add a field, sort of a "replace incase the name contains" array field, if ever i do it clean, i'll of course get back to you with what i will have done 🙂

have a nice day

Link to comment
Share on other sites

Hi again @adrian

i had a little respite this morning and couldn't help having a closer look at your module
eventually, i ended up with this
https://waitandcie.com/down/ProcessCustomUploadNames.zip
that fits my needs, one more input to fill with comma separated strings if needes, if the filename doesn't contain one of them, i do not rename, if it does, i rename according to the rule in the filenameFormat input
this will avoid those screenshot_date..., captrure_decran_date... and the names straight out from the camera that make my eyes bleed 🙂

Edited to say, i forgot to add this... screenshot 😄 of course it works on adding a new rule too
image.thumb.png.3676bce35c093d1c3dba31b28ec7a724.png

thanks a lot again for your time and for this great module i will probably use even more to persecute friends and customers 😄

have a nice day

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...