Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Yes, webp only is an output format, not a source image or master image format. If you want to use only webp as original image and output image (WITHOUT resize methods) you can use it within a files field. Within image fields is not supported and doesn't make much sense.
  2. Hi @Zeka I see, the DB data isn't updated by this method. Also when calling the ->width and ->height properties on image objects it returns the correct new values. But nevertheless we need to update the data in the DB too. (Also I don't know where or for what it is used ATM. ? ) I don't know any API method for updating this via page images or page files. The only thing I know is to alter it via the database object directly: $TABLE = "field_images"; $WHERE = "data='{$image->name}' AND pages_id={$page->id}"; $SET = "filesize=" . filesize($image->filename) . ", width={$image->width}, height={$image->height}"; $statement = "UPDATE {$TABLE} SET {$SET} WHERE {$WHERE};"; $pdoStatement = $database->prepare($statement); $res = $database->exec($pdoStatement); We need to update the filesize, width and height. Ratio is unchanged and can be kept. So depending on your route you already have the fieldname(s) and page id(s) stored in params. The above is a bare example that works but better should / can be used as a function. (?)
  3. Only things that seems possible are time limits or memory limits. Are there also logs from imagesizer when adding 10 images. Do you get the 500 when adding the images or only when calling the frontend page?
  4. horst

    Page fingerprint

    Im not sure, are you speaking about form and formsubmission? Than have a look at pw $session. It has a method exactly for that (xrss validation). You find it in the API docs. Im on mobile sorry.
  5. Is it possible for the hook you want to skip to add a line of code that checks your conditions and act according to it? I mean, not to interact with the hook chain from within other hooks but acting within the system notification hook: if self registered user login stop logging, else proceed as default.
  6. The minimum you would need is not a local emailserver but an email account somewhere by a hoster. Then you can setup one of the WireMail modules to connect and send through your (online) account.
  7. You can resize the original image like this: // max width for landscape or max height for portrait $maxSize = 900; // then loop through images // get an image $image = $page->images->first(); // is it portrait or landscape? $portrait = $image->height > $image->width; // set properties according to image orientation $property = $portrait ? 'height' : 'width'; $width = $portrait ? 0 : $maxSize; $height = $portrait ? $maxSize : 0; // if the current size exceeds the max, proceed a resize if($image->$property > $maxSize) { $is = new ImageSizer($image->filename, ['quality' => 100]); // do not crucnch quality for original jpeg images !! $is->resize($width, $height); // resizes the original image, Attention: also wipes out EXIF data, XMP etc. - only IPTC is kept! } // DONE! // end of loop EDIT: @Zeka If you have any further questions, maybe in regard of CLI script processing, please ask. https://github.com/rolandtoth/PageimageRemoveVariations/blob/master/PageimageRemoveVariationsConfig.php#L121-L159
  8. Hey, many many thanks! Works fine! Your support is extraordinary! ? ? ?
  9. This is a PDF-link to the public accessible Master thesis in the course of studies Computer Science and Media submitted by Gisela Andrea Kollotzek at the Stuttgart Media University on 06 May 2021 to obtain the academic degree of Master of Sicence (It is in german only): https://hdms.bsz-bw.de/frontdoor/deliver/index/docId/6650/file/Ausarbeitung.pdf
  10. I have the following situation: in my initial html markup there is a PrivacyWire-ShowOptions link that gets initiated by the PrivacyWire module on content loaded. Every thing works fine, as expected. After that, I update a part of the html markup (with the PrivacyWire-ShowOptions link included) via AJAX. The initial link is gone now, and the new link is not bound to the PrivacyWire event. How can I bind it to the PrivacyWire event to show the options banner? A line of code or a keyword hint would be of great help. ?
  11. @Didjee Ah, now I see. My bad. The part C) explains how to (optionally) pass individual options for the rezising. And in the github readme the second param is described wrong. Its an obsolete function from the CAI3 for creating intermediate AND final images in one go, (what seemed nobody really has understand or used this). Now with CAI4 it behaves more like the core image field. But instead of passing the size|width|height as first argument, you pass the crop name. The second argument can be an individual options array (or for your convenience, a selectorstring representing the individual options). The irritation comes from the old readme. I need to update it to CAI4 changes! Sorry!
  12. Not sure I understand correctly, but do you only need to have the width-200 image? You would need to call it like this: $page->images->first()->getCrop('portrait')->width(200)->webp->url; ALSO: If you already have called it once before, without the setting of "width=200", you have to forceNew=true or to removeVariations() before you call that. QUOTE: Is resizing still not working as mentioned in the first post of this topic? Will it work in a future release of CAI4? I don't understand this. Cannot find the post you mentioned also I'm not aware of resizing issues in general? All versions of CAI, (CAI2, CAI3, CAI4) have created resized variations. ??
  13. Do you have a correct namespace set in top of your _main.php? Otherwise you may test in your testpage the following: <?php var_dump(function_exists('page')); var_dump(function_exists('ProcessWire\page'));
  14. We do not remove regular questions, also not when we have found a solution. We do share the solutions with the community.
  15. I do it very similar. I use a settings page with a unique template name where the family settings are restricted to use it only once (for a single page). Then I can connect to the content by using a selector with the template name. This way it is save, even if later the page gets deleted (by accident) and recreated. Also the user is free to rename its title and URL without interfering the content pickup in my initial codes. (Selector without ID, path, name, title, etc) For contact information I used a Pro Field of type Textareas some years, that was named contact. It subfields have names like company, phone, email, address or street zip city, etc. Including links of social platforms etc. Now I use the newer Pro Field type Combo(!) for this, as it allows more flexibility. In the site/templates/_init.php I use a snippet like this to serve a shortcut for the use in my templates to this content: // object: firstname, lastname, phone, mobile, email, ... $contact = (object) $pages->get('template=my-unique-templatename')->contact->data;
  16. @mr-fan there is a method to send test email while debugging from within the modules page. Not the simple connection test. Have you used the verbose method and if so, what says the debug out? If you like, you can PM me that.
  17. You can precede every desired module directory with a dot (.) to make it ignored by PWs module parsing. Example: site/modules/WiremailSmtp/ is picked up by PW, site/modules/.WiremailSmtp/ is ignored.
  18. According to the specs it should work like this (not tested) $results = $pages->find("title~=word1|word2|word3, title~=word4"); title=x, title=y is AND AND selectors: matching more than one value in the same field There will be instances where you need to say that a specific field matches more than one selector. This is simple, just specify all the conditions you need to match as separate selectors in the same string. For example: height>500, height<=1000 This AND selector matches all pages that have a "height" field greater than 500, and less than or equal to 1000. title=a|b|c, title=y should be the right combination https://processwire.com/docs/selectors/#and-selectors
  19. There seems to be NO (functional) Github link. For me the link opens the demo again. ??
  20. +1001 (for permanent visible reputation count and for individual member titles like: captain earth, manager of expectations, ... etc.) ??
  21. You should inspect what the bots tried to find. Maybe this will shed some light? You can use the jumplinks module for this, for example.
  22. Have you checked write access rights for parent, itself and children? Are all proper set? (Should be, even if it exist)
  23. I think it can be done with language alternate fields.
  24. Hey, you are using mediamanager and your tweaks have changed that the item passed into the function isn't a pageimage. Maybe a mediamanager object or a url string. I'm on mobile ATM, I'll come back to you. ?
  25. Scope? When in the template file are you in Namespace\Processwire Have you tried to call it with a backslash in front? new \mysqli ... ? EDIT: Yes it is the missing backslash. (downloaded and looked into your php file) ?
×
×
  • Create New...