Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Chaching and personalized pages are not the best friends. I'm not really sure where are the differences with this caching methods, but I think there is no way around some clientside action (JS! + ajax?). What comes into my mind is: does you serve the complete page from cache, like with ProCache? Or do you serve a little part with uncached output? If the latter one, you may store a JS-var that flags if a user is loggedin, and regardless if in the cached or uncached part a JS function that do a ajax call only if the user is logged in to fetch unpixelated content.
  2. @julbr: And after that you get the error: thumbnail_4_copiar.jpg is not a recognized image. Please have a look into /home/bts003/public_html/site/assets/files/1012/ for the files: 4_copiar.jpg, thumbnail_4_copiar.jpg and 4_copiar.0x100.jpg. Can you please any of them you find pack into a zip and upload here? At least the first two should be there, maybe that the 4_copiar.0x100.jpg is missing.
  3. looking at Timestamp.php method get: /** * Retrieve a value from the timestamp: date, location or notes * */ public function get($key) { $value = parent::get($key); // if the page's output formatting is on, then we'll return formatted values <<< !!! if($this->page && $this->page->of()) { if($key == 'date') { // format a unix timestamp to a date string $value = date(self::dateFormat, $value); } ...
  4. I think your $timestamp->date should be not the formatted one, but needs to be an integer because it gets compared > 0 what is an numeric / integer comparision. The formatted finally goes into $date, but it needs the integer timestamp to build it from. (php.net date) I would try to get the integer (UnixTimestamp) into $t in your foreach loop. foreach ($times as $t) { ... $timestamp = new Timestamp();//this is the Class Timestamp found in Timestamp.php. Included via FieldtypeTimestamps. $timestamp->date = $t; // $t should be integer here
  5. You should know I'm not very familiar with CSS / JS. I run into an issue when I have developed a responsive site that should show different designs for phones, tablets and desktops. Also the site uses infinite scrolling, loading image thumbs. The number of loaded images at once and the dimensions of the requested images needs to be very different regarding to the device type a visitor uses. (for phones it should load 2 thumbs at once, for tablets 12 and for desktops 36) I have used a serverside UA-Sniffer (PHP) and have set a class in the body tag to represent the found devicetype "<body class='tablet' ..", This way all the CSS for the different device types could be derived from there. After the site was nearly finished, one of the last things to implement was ProCache. This was planned from the beginning, but I haven't used it before. After installing and configuring ProCache, the first device-type entering an URL was written into the cached page-version. Uhh! It is very important to build the caching strategy at an early point. (Now I know this too) I came around my issue with the caching with changing from the serverside UA-Sniffer to a JS-UA-Sniffer and adding a JS snippet right after the body tag that adds the relevant device-type-class to the body. var md = new MobileDetect(window.navigator.userAgent); if(md.phone()) { document.body.className += (' phone'); } if(md.tablet()) { document.body.className += (' tablet'); } The code is called directly after the opening body-tag. Also the small JS-lib does not depend on jQuery, it is the only one that needs to be called in the head. All other JS files can be called after the body content. I used this PHP UA-Sniffer: https://github.com/serbanghita/Mobile-Detect and this JS-Port of the above: http://hgoebl.github.io/mobile-detect.js/
  6. http://processwire.tv/downloads/ https://processwire.com/talk/topic/6642-processwire-logo-vector/
  7. Since February 2013 there were some changes with PW and thirdparty modules. Now you can use PageImageManipulator for this.
  8. Ok, now I got it. It is a bug. For now you can A) set the value for memory_limit to 512M or 1024M or 1G (but not greater than 2G!!) if this is possible for you. or B) If this is not possible for you, you can change this line to be: if($phpMaxMem <= 0) return null; // we couldn't read the MaxMemorySetting, so we do not know if there is enough or not I will file an issue at Github that fixes the setting with -1. Sorry for the inconvenience, I haven't recognized that setting to -1 in the post above:
  9. can you enable the multilanguage description option an dfill out the default-language with the text you want use for the single-description field? Just for testing?
  10. Good! Don't know for what it is good in this regard, but it also do not bother. Now the final question: How much memory is available for PHP?
  11. Did you have deleted the images from the previous Errors? (Where you have no Thumbnail but the Message "Not enough memory to load/resize"?) You need to delete those in your EditPage-Screen, save the Page and upload them again. If this doesn't work, then you definitely need to bump up memory for PHP.
  12. Can you bump up the available memory for PHP? It is explained here in detail: https://processwire.com/talk/topic/7749-max-image-dimensions-not-a-recognized-image-bug/ So as the factor setting actually in PW is 2.5, I will ask Ryan to set it to 2.2 by default. Edit: have sent a question to Ryan: https://github.com/ryancramerdesign/ProcessWire/issues/739
  13. +1 for hookable compared against extending!
  14. I try to sum up what I have read from your posts: You have uploaded an image named "4_copiar.jpg" into a CropImage field: Did you get errors during upload? How looks the Default-Thumbnail in Backend (the 4_copiar.0x100.jpg)? How do you go to the editor? Is there a link under a Thumb? How is the name of the Link? What is it's exact content, (the Link-URL with query)? What are the settings for 'thumbnail' in the Imagefield-InputTab under ThumbSettings?
  15. EDIT: Attention, changed the code because have overlooked the $params variable! Tom, you can get the information from PiM with this code: // create 4 variables that need to be passed by reference and set them initially to 0; $x = $y = $w = $h = 0; // create an empty array variable named params, it is needed to pass by reference to the method $params = array(); // now call the public static methode fileThumbnailModuleCoordsRead, what additionally to the above variables needs the pageimage and the name of your thumb, (prefix) if (ImageManipulator::fileThumbnailModuleCoordsRead( $pageimage, $x, $y, $w, $h, $params, 'thumb') { // it returns true if could get permanent settings, and now you can do what you want with it ... // does this work:?? $large = $pageimage->size($w, $h, array("quality" => 25, "cropping" => "{$x},{$y}" )); } else { // to bad, no permanent settings available ... do you have a fallback? } ----- If you want to use this with PW 2.5.+, you can use a new option together with ImageSizer. It is called cropExtra and takes an array with the 4 dimensions for a crop. You can use it like this: $x = $y = $w = $h = 0; $params = array(); if (ImageManipulator::fileThumbnailModuleCoordsRead( $image, $x, $y, $w, $h, $params, 'thumb') { $large = $image->size($w, $h, array('quality' => 25, 'cropExtra' => array($x, $y, $w +1, $h))); // * } * we need the 'w +1' actually, because there is an issue with this new functionallity in ImageSizer
  16. Happy Birthday Ryan, this is the only year where you are exactly 10 times that old than ProcessWire. So, one of the big future milestones will be when you are "really official" old. It's when PW reaches your actual age. (this will be in 2050 when PW has age 40 and you are one year older then 75)
  17. @Joss: you should not use the PHP 5.5.9 - it has a buggy GD-lib, (if has a installed one ) You should use one greater than 5.5.11! You should run processdiagnostics when starting with new server setups. This one would have told you everything at once.
  18. He uses a CropImagefield, and the Error is explainend exactly! in the link I have posted in my first answer. And it is not another error, it is exactly the same, because there is only one place in PW pageimage / imagesizer where this is done, (writing Errormessages into a image-variation.). So please, @julbr, read the explanation in the thread I have linked too. There is also described that you can open the image-variation and or the original image in a simple Texteditor to see what the error was when trying to resize / upload the image. Can you tell me what there is to read. Also the filesize is only a few Bytes.
  19. @adrian: I have found a workaround for me. I set it up like this: parent installs: child1, child2 parent requires: child1 requires: parent child1 installs: child2 requires: parent child2 installs: I would not need this with my workaround but found it to be usefull to display all those infos about requires and installs in the modules admin. In the Parent uninstall method I use this code: public function ___uninstall() { $GLOBALS['UNINSTALLROUTINE_RUNNING_PARENTNAME'] = array(); foreach(array('ModuleNameChild1', 'ModuleNameChild2') as $mod) { $this->modules->resetCache(); if (!$this->modules->isInstalled($mod)) continue; $GLOBALS['UNINSTALLROUTINE_RUNNING_PARENTNAME'][] = $mod; $m = $this->modules->get($mod); $m->uninstall(); } parent::___uninstall(); } and in the Children uninstall methods: public function ___uninstall() { if (!isset($GLOBALS['UNINSTALLROUTINE_RUNNING_PARENTNAME']) || !in_array(__CLASS__, $GLOBALS['UNINSTALLROUTINE_RUNNING_PARENTNAME'])) { throw new WireException("Please only use the ParentModulesName to uninstall the complete ModulesPackage!"); } parent::___uninstall(); ... This way you can use the ParentModule to uninstall all, but you cannot uninstall one of the Children. A bit weird is, that the children modules get uninstalled two times, , this is because of the auto-install / auto-uninstall routine of PW modules dependencies. But if one would not specify dependencies, this could be avoided, but also the dependency messages will not be displayed then.
  20. I saw I little typo in the config description: "Supply a custom port separated by a column" ... should be colon I believe.
  21. I don't understand what caching issues you mean. Do you use ProCache or other Caching methods?
  22. Thanks Adrian! Now I know what was going on. I have had this code, what was working before: $p = $this->pages->get(3)->children()->get('name=image-crop'); and then I have broken it at the children() part, because in the install-routine when the adminPage gets created, I have set the page to hidden. So a simple 'include=all' or 'include=hidden' as selector for the children() will make it work again. Hhm, I love it when I get to know why / how things do work the way they do. PS: yes it seems there is much similarity between our works at the moment.
  23. I have done a fresh install of PW 2.5.3 Classic-Profile, copied and installed 3 modules (that belong together) into the site/modules directory and installed them. I haven't done anything other, only refresh the modules cache by hitting a few times the refresh button in the modules section. After that I have deinstalled those modules and hitted the refresh a few times. Now after that, when I want to install them again, I get that error for the third of it: The module want to install a process admin page called 'image-crop' but without the '-3' suffix. ?? I have dumped the DB after the install and the uninstall of the modules, the only difference showing are here: with modules, in table modules: (155, 'ProcessRecentPages', 1, '', '2014-10-06 15:39:35'), (165, 'FieldtypeCropImage', 0, '', '2014-10-06 16:18:15'), (166, 'InputfieldCropImage', 0, '', '2014-10-06 16:18:15'), (167, 'ProcessCropImage', 1, '', '2014-10-06 16:18:15'); /*!40000 ALTER TABLE `modules` ENABLE KEYS */; without modules, in table modules (155, 'ProcessRecentPages', 1, '', '2014-10-06 15:39:35'); /*!40000 ALTER TABLE `modules` ENABLE KEYS */; Also the table 'caches' is different. But everything looks ok. Also I cannot find the string 'image-crop-3' in the dump(s). I can provide the dumps or informations of the modules if necessary or do further investigation, but actually I have no clue how and what I should do with it.
  24. https://processwire.com/talk/topic/7749-max-image-dimensions-not-a-recognized-image-bug/
×
×
  • Create New...