Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. not sure if this is right, and I'm on mobile. Have you tried to add them to the field? After all pages are created, something like $page->pagetablefield->add($childpage);
  2. Only thing I can imagine is that you will need sending special HTTP headers for those browser / os combination. So, I don't know which one(s). That you need to investigate by googling, maybe? If this is a way that turns out as a practicable workaround, we can show how to implement sending additional headers from within PW (templates). Sorry, that I'm not able to tell you more.
  3. Hi, and welcome to the forums. How do you have linked to the file? (code example) Where is the file hosted? (locally, remote)
  4. How do you or the customer can add pages to $page->custom_menu ? What are the settings for that. Are there hidden pages included, selectable?
  5. Yeah, now I'm thinking about to setup a radio or select with something like: "I am serious" "I like it funny" "I'm brave, surprise me" @apeisa: Yes, that was exactly what one customer said to me a month ago: "Oh, thats nice and not so serious. I like it. It is the same way like Mailchimp do."
  6. I'm thinking about to implement a "show historical label texts" module config checkbox. Antti, would this help to get over this a bit faster? (Some customers really liked that. "Oh, thats so positive! Fine.")
  7. How the new editor window looks like.
  8. Croppable Image 3 for PW 3.0.20+ Module Version 1.2.0 Sponsored by http://dreikon.de/, many thanks Timo & Niko! You can get it in the modules directory! Please refer to the readme on github for instructions. - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - There is a new Version in the pipe, that supports WebP too: - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - ------------------------------------------------------------------------- Updating from prior versions: Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step: In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates. ------------------------------------------------------------------------- For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here. -------------------------------------------------------------------------
  9. Just to clarify, I'm not working on the core image field, I only work on the CroppableImage Modules, to make them work with the new core Imagefield in PW3. It will inject a small section with buttons into the head of the edit area, like here, (predefined Crops) The buttons will open a modal editor window. The editor window should get some new styling. Thats it. And this only is possible because of the sponsoring through DREIKON, who are so kind to donate 500+ Euro for my work on this, what is much appreciated. Otherwise I wouldn't be able to invest the needed time for it, atm. Current state is: injection works, modal open and close works, rearanging / styling of the editor window needs to be done, testing needs to be done.
  10. Ryan said that we have had a chat, but I'm working on it.
  11. If you have a static IP, you may log UAs for this IP a short time. I assume, you then will find what causes the issue: <?php // somewhere in site/ready.php, for example $myPrivateSaticIP = '123.123.123.123'; if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ipAddress = $_SERVER['REMOTE_ADDR']; } if($ipAddress == $myPrivateSaticIP) { // log infos of IPs, user agent and more, ... $items = array(); $items[] = 'REMOTE_ADDR: ' . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'N/A'); $items[] = 'HTTP_X_FORWARDED_FOR: ' . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : 'N/A'); $items[] = 'HTTP_USER_AGENT: ' . (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'N/A'); // add more if needed ... $log->save('my_ip_useragents', implode(' || ', $items)); } https://processwire.com/api/ref/log/save/
  12. Alan, it will not mix up sessions, but it is less secure in regard of session steeling possibilities. If this is a special device with a known Useragent, I would suggest dynamicly disable sessionFingerprint only for that UA. something like that in the site/config.php: if(isset($_SERVER['HTTP_USER_AGENT']) && 'StringOfTheProblematicUserAgentHere' == $_SERVER['HTTP_USER_AGENT']) { $config->sessionFingerprint = 0; }
  13. To be a bit more secure or serious, you want to check if everything went ok, before you delete all images on the old page. If I undestood right, the new page images should be an exact copy of the old one. Therefore we can delete all (optionally) images on the new page first. Then, after adding all images to it, we compare both collections. When on PHP >= 5.6.0, we can compare the ->items(), what contains a list of all image basenames, what is fine! If we, unfortunately, on PHP lower then 5.6, we can at least compare the count of images, or have to loop through both collections and compare the basenames one by one. $pageNew->of(false); $pageNew->images->deleteAll(); $pageNew->save(); foreach($pageOld->images as $image) { $pageNew->images->add($image->filename); } $pageNew->save(); // now check for success or failures $success = version_compare(phpversion(), '5.6.0', '>=') ? $pageNew->images->items() === $pageOld->images->items() : $pageNew->images->count() === $pageOld->images->count(); if($success) { // delete images on old page $pageOld->of(false); $pageOld->images->deleteAll() $pageOld->save(); }
  14. Don't understand enough from the server responses, but it's clearly no PW issue. You may investigate more into max_upload sizes, max_memory, etc. This isn't apache, or?
  15. what is returned via the AJAX request? what is in the logs? have you turned $config->debug to true?
  16. @mscore: Cool! What type(s) are available today, what do you use? The last great improvement in B/W films I can remember, was Kodak T-max 100, 400, 3200 with its so called t-grain, that results in smaller grain grids. The 3200 could be used nearly without light. Also, which film developer do you use? Own receipt or default one(s)? (dilution, time, temperature)
  17. I think it is for security reasons too, that not everyone can read config settings.
  18. foreach($pageOld->images as $image) { $pageNew->images->add($image->filename); } $pageNew->save(); $pageOld->images->deleteAll(); see: http://cheatsheet.processwire.com/files/page-files-multiple-wirearray/files-deleteall/
  19. Endless saving events are a sign that the ajax upload resulted in returning some PHP notice, warning, error via AJAX. That prevents the imagefield from updating correctly. You need to use the browsers Webtools and see what you get returned from the AJAX upload. ALso useful is to check manually in the assets/files/{12345}/ folder what files are there. (Your original file? A thumbnail? Nothing?)
  20. Hi, looks good. Only additional suggestion from me would be to use another upload path ($config->uploadTmpDir) if is set in your environment, but not really necessary. And you better should remove the temporary file after it got added to the image field. ... $i = 0; foreach($item_images as $data) { $name = $image_fileNames[$i++]; // fortunately i can pass this from ajax myImageExtract($p, $data, $name, $upload_path); } $p->save(); } function myImageExtract(&$p, $imgData, $imgName, $uploadPath) { $base64img = str_replace('data:image/png;base64,', '', $imgData); // TODO - must be dynamic - could be jpg, gif ... $data = base64_decode($base64img); $file = $uploadPath . $imgName; file_put_contents($file, $data); $p->item_images->add($file); unlink($file); // delete temp file after adding it to image field }
  21. Like Bitpoet and netcarver said, you need to save the page before you are able to add images. ALso you should do a check if the page already exists, maybe. If you are not able to provide (HTTP) URLs to the images, and no filepathes, but those strings of data:image/png strings, you need two things: a wrapper function that extracts the image data into a temporary file and an imagename! A wrapper function is easy, but from where do you get a filename, ...? <?php require_once('../index.php'); $input = wire('input'); $sanitizer = wire('sanitizer'); $pages = wire('pages'); $item_titel = $sanitizer->text($input->get("item_titel")); $item_client = $sanitizer->text($input->get("item_client")); $item_usecase = $sanitizer->text($input->get("item_usecase")); $item_text = $sanitizer->textarea($input->get("item_text")); $item_date = $input->get("item_date"); $item_images = $_GET["item_images"]; // don't know if we can use $input->get("item_images") to get an array, // writing in browser only(!) $parentPage = $pages->get("/items/"); $templatePage = wire('templates')->get("item"); $pageName = $sanitizer->pageName($item_titel); $p = $pages->get("name={$pageName}, parent={$parentPage}, template={$templatePage}"); if(0 == $p->id) { // or: if($p InstanceOf NullPage) // only create a new page if no one exists, // otherwise you would create pages with same content but automaticly incremented pagename !! $p = new Page(); $p->of(false); $p->template = $templatePage; $p->parent = $parentPage; $p->title = $item_titel; $p->item_titel = $item_titel; $p->item_client = $item_client; $p->item_date = $item_date; $p->item_text = $item_text; $p->save(); foreach($item_images as $data) { // $data looks like: data:image/png;base64,iVBORw0KGgo... $basename = '???'; $filename = myImageExtract($data, $basename); $p->images->add($filename); } $p->save(); } function myImageExtract($data, $basename = '') { // extract the imagetype / extension and the imagedata part from the string $imagedata = ... ; $extension = ... ; // write it into a temporary file and return the filename // see: https://processwire.com/talk/topic/11843-file-upload-images-pdfs-from-base64-value/#comment-110113 $tmpDir = new WireTempDir('someName'); $fileBasename = $basename . '.' . $extension'; $filename = $tmpDir->get() . $fileBasename; file_put_contents($filename, base64_decode($imagedata)); return $filename; }
  22. The more I use it, the more I love it. It simply is CSS: /*****************************************************************************************/ /** Transparent-Images Background **/ li.InputfieldImage div.gridImage__overflow, li.InputfieldImage .InputfieldImageEdit__imagewrapper > div > img { background: transparent; background-color: rgba(196,196,196,.7); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADFlJREFUeNo8lwl4jWcahu+TlUQkdrIJ0dgSDUKKMBI0toPWpKWlbRBMizJVpcxIOzpqacdQtUVoqdqiQpQQIvZYgyQqiIgkosgiEiRpzjz/Ob3mXNd/rnO+//+/9/ve93mf5/lMlotjzXTfxtf8wdwyC3h8zu+E0ZyueOFDIX9+qnU56cr5AAI228YSILYsgfmjcznnEYM/aXheGgkl12BKJmS9A49fQEsTVDhTqekLm9imqeMqjliwe67gcJS5XOGSR5F+D1XwEZCo4Pnw/k54+A9b8KVchAwjeCrbkmHV8V3EThyNY7E/T35z4bunT8D7VRjUBXIVvP48Knzs+eWJgj+G7xXcq3Qj95ZCE17F56dXsG83M6z9ueQ6NndYx3vXorE/mgZBZ8CvB3kNbhP9amNuROQrGwuUjUl0rs3nUnEwkc8gdIaHFtOQoqYN6BGfyIAbEyDcjvuE4G5NUQHOCtTieRHdfBuyY2AuK8s9qHr7GSeeNcEpzAmTpXKhGZdYPVxKpZKfuTad0KnvoVmsaX/sv5JNB6YzIcKEQ/2tuDCOi9pBsNM6UoOnMLSJHgr6QQmNwaKsBwfaAifleePkAq12gFvoFvx6RrHgu3rETIPWx6A8IkmLPIN9rOOW9vTXelPr49TmIo1DRvMVyzXUmzq97OoVSp/utZx1sKejKQB7YcVnuwOOX4bg9AfcrCvF27UveY4QckKxO1nYud+dnO7lOCtgRDQ0amdkqim9Ko/StM19Tt0+TMDzsZxrPgD7N/uOa//Xtq24f2gV/f3u4hjUj/7Te4N2Y/L+mty8MBr52+NlesA7NMJS85SXB+tz+fEpcq74MqTlegr8yuhU9xA6+yqQic7tIwmbOolAZcrUoYozs5oJV3CrZVtaOPqxTYC0b5fF7sMNMCXtizcPM0dbK1Z5/mdW9DQ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TRI54ecGwrecKlN7EekyHApK5GpzBgu9ng52MAo/xNgAN8tgFKi3lETAAAAAElFTkSuQmCC"); background-size: 32px 32px; background-position: 0 0, 16px 16px; } li.InputfieldImage div.gridImage__overflow:hover, li.InputfieldImage .InputfieldImageEdit__imagewrapper > div > img:hover { background-color: rgba(55,55,55,.9); } /*****************************************************************************************/
  23. @LostKobrakai where must this be called? AFAIK, you define and / or add an array with (default) values and every thing else is done by PW. MyModule.module: MyModuleConfig.php:
×
×
  • Create New...