Jump to content

PWaddict

Members
  • Posts

    908
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by PWaddict

  1. I don't know If I can do it but I will try.
  2. I have an image field inside repeater along with some text fields. Is it possible to rename the image using 1 of those text fields?
  3. A dot must be used between fields to work properly and yes about the php date underscores inside the brackets is the solution: $page->title.[Y_m_d_H_i_s] $page->title.$file->mtime Don't forget to update the module with the proper version you posted above and also add the above examples in Rename Rules description. THANKS A LOT ?
  4. I asked my hosting company to install the timezone tables and they said it's not possible on shared server and changing manually the offset is bad but then I found about the capital "I" on date format where we can easily detect if the DST changes. So here is the best solution: if (date('I', time())) { $config->dbInitCommand = "SET NAMES '{charset}', time_zone = '+03:00' "; } else { $config->dbInitCommand = "SET NAMES '{charset}', time_zone = '+02:00' "; }
  5. Query strings are no longer work on Facebook. Page url or filename must be renamed in order for Facebook to fetch the new image.
  6. Ok on the Crop Settings of a "Croppable Image 3" field I have "thumbnail,1200,600" so when I upload an image to that field I'm getting the following files inside site/assets/files folder: myimage.jpg (original) myimage.0x260.jpg (original variation) myimage.-thumbnail.jpg (crop) myimage.-thumbnail.0x48n.jpg (crop variation) All I want is the cropped images with the ".-thumbnail" to include a timestamp of their modification time (mtime) so the site/assets/files folder should contain ONLY the following files: myimage.jpg (original) myimage.0x260.jpg (original variation) myimage.-thumbnail-1543078585.jpg (crop) myimage.-thumbnail-1543078585.0x48n.jpg (crop variation) Everytime the crop is modified the timestamp on the filename should renamed with the new one. I hope you understand now.
  7. Using the options array it creates another variation file with the manual suffix I mention below. It doesn't rename the main variation image. $og_image->getCrop('thumbnail', "width=1200, suffix=test")->httpUrl;
  8. Can you show me an example how can I do that? On Crop Settings I have "thumbnail,1200,600" so the main variation image is like myimage.-thumbnail.jpg. How can I rename it to myimage.-thumbnail-1543078585.jpg with the options array?
  9. Maybe you should allow the date format [Y-m-d_H-i-s] & $file->mtime starting with underscore "_" instead of dash "-".
  10. @adrian If I use this: [Y-m-d_H-i-s]-$page->title the filename ALWAYS renamed on save but if I use this $page->title-[Y-m-d_H-i-s] or this [Y-m-d_H-i-s] it doesn't.
  11. I don't know. I tried to modified CroppableImage3 because it seems easier since it only renames the cropped variations.
  12. The reason I want to add timestamps in the cropped variations is because I'm also using them as og:image and Facebook will not refresh the image if I changed the crop unless the filename or page url are renamed. So, adding timestamps inside filename is the perfect solution for this. @adrian's module renames all image variations (normal & cropped ones) and It doesn't affect CroppableImage3's suffixes.
  13. Replacing the 221 line of ProcessCroppableImage3.module with this: $basename = basename($img->basename, '.' . $img->ext) . '.-' . strtolower($suffix) . '-' . $img->mtime . '.' . $img->ext; and the 224 line of FieldtypeCroppableImage3.module with this: $basename = basename($img->basename, '.' . $img->ext) . ".-$suffix" . '-' . $img->mtime . "." . $img->ext; it adds the current timestamp everytime the cropped has changed but the problem is that variations with previous timestamps are not deleted. @horst can you please help?
  14. No. I reinstalled the unreleased version again and it's working now but I've noticed that it doesn't always rename the filename when I save the page. On Filename format I'm using this $page->title-[Y-m-d_H-i-s] so I would know if image is renamed. Keep saving the page again and again and you'll notice the issue.
  15. On this version if the image and the textarea are on the same page the image links are not updated. On the 1.0.13 it works ok.
  16. I've temporarily disabled the rule just to test with PW core function on image linking and it doesn't update image links even if the image and the textarea are on the same page. EDIT: Should I open issue on GitHub?
  17. @horst How can I add a current timestamp at the end of the suffix everytime a crop is saved? With @adrian's module ProcessCustomUploadNames it renames all image variations so I'm wondering if it's possible to only rename the variations with the suffix we're having in Crop Settings: So instead of: my_image.jpg my_image.-suffix.jpg We should have something like this: my_image.jpg my_image.-suffix-1543078585.jpg
  18. It's almost perfect. There is only 1 small issue: Assuming that you have 2 tabs open in your browser. The 1st tab has the page where you renaming the image and the 2nd tab has the page with the textarea field where you inserting the image link. If I save the page on the 1st tab and then save the page on the 2nd tab without refreshing it then the old link will be saved and it will never gets updated again until I manually go and select the link via "Insert Link > Select File".
  19. Yep although adding image links on a textarea field that belongs to another page it doesn't update them.
  20. If I understand correctly you've updated the part of the module that searches img tags inside textarea. The problem I'm having has nothing to do with img tags cause I do NOT add the images inside textarea. I only add their LINKS via "Insert Link" and then "Select File".
  21. I just tried it on a multi-language textarea field with the latest version (1.0.11) and it has the same problem. Nope
  22. I was testing it in a NON multi-language textarea field.
  23. @adrian Checking "Rename on Save" and inserting the image link inside textarea field via "Insert Link" and then "Select File" and finally saving the page it doesn't update the link. It always lead to the previous filename. Can you please fix it?
  24. I'm on LiteSpeed server and recently the hosting company installed LiteSpeed Cache. Any ideas how to use it with ProcessWire?
×
×
  • Create New...