Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. @Martijn: do you know this format "<picture>"? I have thought about a little module that supports creating retina images and that at least need to add a property to pageimage to provide the retina url. I haven't wrote a line of code, just collecting informations. Would be fit perfectly to it to also create adaptive image variations and provide the markup. Which one would be better regarding browser support, the <picture> or your <img data- one? And do you have some lines of JavaScript for that? If yes, - can we put it together, collaborating on a module?
  2. Pete, that's a good way to go. With the creation of different sized images, I would do it at uploading images through the images inputfield, the most common way I think. And if someone add images through the API somehow, he simply can add some more line of code to craete the images. It can go like this: public function init() { $this->addHookBefore('InputfieldFile::fileAdded', $this, 'createImages'); } public function createImages($event) { $inputfield = $event->object; if('images' != $inputfield->name) return; // we assume images field !! name of the field is: images !! otherwise change it $p = $inputfield->value['page']; // get the page if('gallery'!=$p->template) return; // don't do it on other pages than galleries $image = $event->argumentsByName("pagefile"); // get the image $image->width(400); $image->width(800); $image->width(1200); $image->size(200, 200); } This hooks into before the image gets added and creates the additional variations. It does not replace the event. After that the admin thumb is created. It is very basic and could be made a bit comfortable with checking the images filedname itself, etc. But it works fine for an individual single site.
  3. Hi, you need to go and read how to call thumbnails with the Thumbnails Module. It is explained on the Modulespage. SOmething like $cropfield->getThumb('nameOfYourThumbsetting') In the above code you simply request a Pageimage of 100 x 100 (centered autocropping)
  4. Never say never! - but it is rather secure Welcome to the forums, qlex
  5. DiagnoseAndRepairDatabase.module
  6. Uups, have copied the latest version over my previous installed one, where a file of Diagnose Modules exists but is not installed! After login, when trying to go to the Modules-Tab of the Backend, I get this: Fatal error: Can't use method return value in write context in DOC_ROOT\site\modules\ProcessDiagnostics\DiagnoseModules.module on line 102 Makes my Modules Backend unusable (PW 2.4.2) - Haven't investigated further. @Nico: Do you need more infos? ----------- DiagnoseDatabase module works fine! I have some of these Warnings: 'Repair table to reclaim space.' What's about a Button that lets the user directly execute an optimize / repair? $query = 'OPTIMIZE NO_WRITE_TO_BINLOG TABLE ' . implode(', ', $tableNames);
  7. OMG, Ryan! Then I need for sure a seat belt at the office chair, avoiding liftoff.
  8. http://www.php.net/manual/en/language.operators.string.php
  9. @videokid: ok that with readability is personal. agread but what trick does it? if($upload_path.$filename !== $upload_path . $filename) echo 'Horst is wrong!'; else echo 'This is nonsense!';
  10. I don't know if I'm right here, but isn't this the way to call static methods? (and only static methods regarding to strict mode?) Strict Standards: Non-static method MyClass::myMethod() should not be called statically
  11. @videokid: Sorry, but this is nonsense. And for better readability you should use the first one with spaces.
  12. @Nico: I can't follow in full, but simply stay to what I have said before: PS: Well, I remember a day back (or two), you have said it would be really useful to have this, regardless of the existence of somas modules. And well, others have agreed with you. So, now we want to have a functional module. That's all.
  13. Hi and welcome mosravo, what have you done before? Have you copied pw files into the webroot or into a subfolder? Have you started the installer routine? ... what more ? Edit: So I'm not very well with this server stuff, but I know that some more information is needed / maybe useful for people who knows about it. And sooner or later they will come in here.
  14. @steve: with the new version 0.2.0 I get an fatal error becuase of a missing method in ProcessDiagnostic. The missing function is this (from @adrian): /** * returns if function is disabled in php * * @return boolean: true, false */ static protected function isDisabled($function) { $disabled_functions = explode(',' , str_replace(' ', '', strtolower(ini_get('disable_functions')))); return in_array(strtolower($function), $disabled_functions); } @steve & @Nico: I have a question with the modules module: I don't want it to query all versions every time I call the diagnostics page. So, yes, I can uninstall it and only install it on demand. But would it not be better if this module has a button that I can press to execute the query and an option that lets select a time period (e.g. 1 week) that let run it via lazy cron at least once in the given time period?
  15. Great, if you have this, you only need to check your actual url for the string /page and if it matches, append a / and a ?sort= to it, and if not, only append ?sort= to it. Ready. Done! Happy coding!
  16. @bwakad: yes you mentioned it, but I cannot follow your code. Also if I try to understand your answer to @Mindfull's post, I don't get it. I cannot find the link you mention there. Where is it, what does it looks like, why does it looks this way vs from where is it generated / created this way? Questions over questions for me. Sorry I cannot follow.
  17. @bwakad: I don't understand what you are after in full, but here is a post / thread that may cover a part of it or may show an alternative way: https://processwire.com/talk/topic/5749-question-about-input-pagenum/#entry56191
  18. @adrian: thanks for the link But I don't want support uploading of those files, nor would want the user has to manually update his htaccess file. I only hook into Pageimage::size to create the retina variation and append the '@2x' to the variations filename. Second hook is into Pageimage::isVariation to take care that these retina image variatiions are detected on image deletion. @Macrura: I don't think that there will be an issue with 'having' such filenames in the assets folder, but only if you want try to upload files with that name. But we do not need to upload them. At least I think it's that easy. We will see
  19. @Macrura: what would be a good & descriptive name for such a module? - PageimageRetina ?
  20. I am with Soma here, modules stuff belongs into the Modules Manager. Redundancy is not good. ( https://processwire.com/talk/topic/6480-processdiagnostics/page-2#entry63539 )
  21. @Macrura & @Mats: please can you guys test if your js framework(s) also accept a - as first char of the appended string? file 1 = basename.400x0.jpg file 2 = basename.400x0-x2.jpg or basename.400x0-@x2.jpg
  22. I think it would be much better if you could do this, for example: $options = array('crop'=>false, 'upscaling'=>false, 'withretina'=>true); $image = $image->width(400, $options); and it creates an image with width = 400 and one with width = 800 and add a @x2 or a x2 to the filename of the latter one. Also I think this is actually possible with the latest dev version and a little module.
  23. "in my function ..." see scope! you need wire('input') not $input
  24. @dazzyweb: you should not use this quick fix anymore but use the dev version of PW. Speaking about image issues is hard to understand, best would be if you could create 2 or 3 thumbs of same dimensions from the same image and name the files according to it's used pw version. Different PHP versions aren't necessary. Would just see / compare a 2.3.1 and a 2.4.2. You can PM me or upload them as zip here to that thread.
×
×
  • Create New...