Jump to content

apeisa

Moderators
  • Posts

    4,632
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by apeisa

  1. Is there easy way to add more intelligence to cache? Meaning stuff like "if page with template news-post is saved, clear cache from page /news/"? Might be good for simple module, but these could be settings also on template -> cache tab? What you guys think? I think that most beneficial page to cache is homepage, but not sure how to do it now, since it usually pulls data from many other pages. PS: I really like the possibility to avoid cache with predefined post & get variables! Though it might be good idea to always disable cache, if there is "CommentForm_submit" POST variable available. Or does that open doors for DoS-attack?
  2. Ryan, thanks for your feedback and kind words! I haven't tested it with multiple words. It is tag search and I see no reason why it won't work with multiple words. I just need some separator or encoding to make it work. Thanks for letting me know this. I have few questions for you (these are not important and probably I can figure out myself later, but if you have quick answers that would be appreciated): I use this code to save images: <?php foreach($input as $key => $url_array) { if($key == $this->getAttribute('name') . '_flickr') { foreach($url_array as $url) { if (strlen($url) > 8) { $this->value->add($url); $this->message("Added new image: " . $url); } } } } Is there any way to save description also? Using normal InputfieldImages description is saved after file is uploaded, so I am not sure if there is any way of doing that in inputfield? Second question: If you look at source from line 108 and below you see lot's of copied code there. My OO skills came little short here There is probably better ways to handle this? EDIT: There are few things just awkward in my code snippet above, so I post here the better version: <?php $fieldname = $this->getAttribute('name') . '_flickr'; foreach($input->$fieldname as $flickr_image) { $img = explode(" ", $flickr_image, 2); // $image[0] is url, $image[1] is description if (strlen($img[0]) > 8) { $this->value->add($img[0]); $image = $this->value->last(); $image->set('description', $img[1]); $this->message("Added new image: " . $img[0]); } }
  3. Ryan, I developed your idea a little bit further: http://www.monoliitti.com/images/ You just need this in your html: <noscript data-large='Koala.jpg' data-small='Koala-small.jpg' data-alt='Koala'><img src='Koala.jpg' alt='Koala' /></noscript> Tiny jQuery snippet does the heavy lifting and creating all the img tags. EDIT: Tested only with high-end desktop browsers and with my android. My HTC Desire HD default browser fails to load small images, since it fakes it's resolution (same problem with other solutions that rely on screen.width). But other browsers work just fine.
  4. apeisa

    Need a new mouse

    Never had a mouse with more than 3 buttons on it This mouse is pretty close to mine: http://www.brillcom.com/products/Logitech-Optical-Mouse-PSII-or-USB%252dOEM.html I prefer keyboard whenever possible. I used to use mouse gestures on my browser, but I couldn't use any other computers after that, so I stopped using those.
  5. This Tarzan was thinking that clone should be in API, not just a tool.
  6. I splitted this topic and moved rwd part of it to: http://processwire.com/talk/index.php/topic,393.0.html
  7. Oh, I did stumble on that, but somehow missed noscript part of it. Just went to demo and wasn't impressed. I think that we have clear winner here
  8. At the same time I was testing also: http://www.monoliitti.com/images/ (With similar results also, although just testing with desktop browsers on Win7). Still amazed about elegance of this (and I really mean elegance, since all other solutions seems to be very very messy...). Usually it is that simplest solutions are hardest to find... --- Well... I think that the super nice thing about this is that you can even choose your default. You might as well serve small image inside <noscript> and serve high quality images only for js-enabled and big resolution browsers. Think about this: <script>img('Big.jpg', 'Small.jpg', 'Alt');</script> <noscript><img src='Small.jpg' /><p><a href='Big.jpg'>Click to see bigger image</a></p></noscript> [Edit by Adam] Gluing doubple posts together. Again
  9. Thanks Ryan. That probably is it, since we use Ubuntu (debian). Strange thing is that garbage collection seems to work now on one site. We manually removed most of the files about week ago, but now oldest ones are little bit over 24 hours ago... But others are not working... so maybe there is that probability at work. I'll follow how this progress few days without adding those lines, and will add those later to see better picture of what is going on.
  10. Thanks Ryan. I compared the settings and there are few differences: Registered save handlers = files user Registered serializer handlers = php php_binary wddx session.bug_compat_42 = Off session.bug_compat_warn = Off session.gc_divisor = 1000 session.hash_bits_per_character = 5 session.save_path = /var/lib/php5 session.use_only_cookies = On
  11. Ryan, looks like simplest solution I have seen so far! It might be that (some) browsers download images from noscript tags even with js enabled - this needs testing though. Or otherwise no-one has ever came with that solution (tried to google "responsive images noscript" with no success).
  12. As far as I know all the current solutions pretty much hacks and not clear winner here. See this for example: http://filamentgroup.com/lab/responsive_images_experimenting_with_context_aware_image_sizing/. For image heavy sites I would just go with separate mobile site and 100% freedom for markup.
  13. I really like responsive designs, but as Adam said they are not always ideal. Consider image heavy frontpage of news site for example. Loading that amount of big images and scaling them down (or hiding) in css is not ideal at all (when good mobile optimized site would be just news headers and maybe one or two featured images).
  14. I think there is one important question that you have to answer first: do you want/need to translate all content as it is (ie. webstore) or do you want to have at least something in different languages (most of the sites). If you have 1000 pages in English, 300 in German and only one for Spanish and Finnish, then best way to go is multiple tree structure. Changing language takes you to front page of that language, since you are not interested to have page-to-page translations. If you aim to have all pages translated, then I would go with duplicate fields solution. This allows you to have translations for every page and easy language switching in current page. It's rare to see normal site or blog to have this, but running application or webstore this would be the normal way. Although this (at least on the simplest form) doesn't allow multilingual urls, if that is needed.
  15. There are almost 6 months old session files. Not sure about my php settings, so need to check that also. And Ryan, welcome back!
  16. 2.1 (and version about month ago, should update).
  17. How does pw cleans session files or does it at all? I found out that I had few hundred megabytes of session files at /site/assets/sessions/ and oldest ones were from the day the site was build. Should I build custom session cleaning, is this a bug or am I maybe using sessions wrong?
  18. Very nice looking stuff Pete, congrats! I can clearly see the benefits - and I don't think that making news editing as easy as possible as "fancy" stuff. That will have good impact for making editors time more worth it. Which probably means more and better content for your site. I think what pw-admin needs is module that allows to add widgets to dashboard (hmm.. needs dashboard page too ). Ok, it is easy enough to build own admin and just put the code you want in there, but that isn't very modular way of doing that. There could be nice little analytics widget, latest comments widget, last edited pages, latest emails etc...
  19. I love the concept how you use those press releases, very clever.
  20. Good link Pete, Thanks for posting this. I have visited Flourish site few times and gotta say that project has been growing a lot. Huge amount of classes there! I have never had need to read emails from php, but glad to know that it will be pretty simple task if I have to.
  21. Adam: Thanks for cleaning my mess. I use forums from my mobile phone quite a often and there I tend to take shortest route. This reply area somehow goes all crazy on my android.
  22. Welcome to the forums Shane! I think you have wrong instructions here. Updating 2.0 to 2.1 requires running upgrade.php script which comes with 2.1. Never run that script myself so not sure how it works and if it.is stable yet, but it would be great if you try it. I'm not sure but here might be topic about that also. http://processwire.com/talk/index.php/topic,338.msg2071.html#msg2071 //Adamkiss: glued together this and the next topic.
  23. Sounds like a very useful inputfield, and not that difficult to implement, I think. Not so much different from asmSelect or any other multiselect field for page field, so there is not too much work. Doing tag cloud with html/css, tag selection with js and then allow for new input, which saves as a page in PW API. I might try to implement that at some point. Next I will try to finish my ProcessDataImport module and maybe try inline editing module (and integrating that to AdminBar).
  24. Oh man, our kids would go crazy on that board, that is sure
  25. Actually this works just like the others. InputfieldFlickr is mostly javascript, it just adds hidden fields to form which holds urls to images as their values. Then images are saved straight from those urls with simple $image->add($url). It was just me writing nonsense in my reply to slkwrm which changed approach here
×
×
  • Create New...