Jump to content

Pete

Administrators
  • Posts

    4,043
  • Joined

  • Last visited

  • Days Won

    67

Everything posted by Pete

  1. I'm not sure if this is the way BernhardB did it, but you could achieve those edit links for specific fields with Fredi (watch the video for examples of how to only have a popup for certain fields etc). Also allows for editing of content not specifically on that page, so useful for a widget approach too.
  2. Pete

    MySQL Replace

    Hmm... why didn't I think of the text editor option? I know it will be a few hundred MB but my PC can handle it
  3. Pete

    MySQL Replace

    Hi guys I've been trying to work out how to replace empty <p> tags via mySQL. Sometimes they look like this: <p> </p> and other times like this: <p> </p> Using this query doesn't work for some reason: UPDATE table SET field = REPLACE(field, "<p> </p>", ""); No matter what I do it seems to return zero results, whichever version of the empty tags I try and replace. The scenario is actually that after a test forum upgrade (the ProcessWire forums actually) extra <p> tags are in the DB as the spacing in this stupid editor has zero padding, so what we all thought were linebreaks are extra paragraphs (well, everyone except those who looked at the source code ). Ideally, a more foolproof way of doing this would be to only remove the first empty paragraph following a paragraph with content in, so that we are not also deleting extra spacing people may have intentionally added. I think that would be a regex though and I'm not even sure you can do those in MySQL directly? I'm basically looking for a solution that will work on >90,000 rows without taking all day Thanks in advance guys!
  4. That's a good point Dave - you can get homeplug network devices, so it should be possible for someone with the right skills to place a hidden device into a power line to be able to access via the USB (talking well-equipped people, but still possibly do-able). At least a normal power socket on a laptop doesn't have a chance of exposing data.
  5. I've fallen for this before myself - glad you worked it out.
  6. I know there are other options with Plupload, but I was looking for something that required no other browser plugins (yes, I know Flash and silverlight are optional, but I believe they are also declining in popularity quite rapidly).
  7. Oh it gets better, try this one with huge images and video too: http://www.screencast.com/t/OsrLgSs4hlDk The only thing slowing it down was the video - those 3 images were massive as you saw, and the thumbnails appeared in the browser instantly because it's client-side. So that was ~50mb of image files there too resized before upload.
  8. Thanks teppo - changed loadImageMaxFileSize to 100mb and it worked with a 19.5mb image. The thumbnail only took a second to display on the uploader @mr-fan - that's a much larger job unfortunately, but hopefully this proves impressive enough that it will be considered for the backend. Here's a screencast for those wondering what the fuss is about: http://www.screencast.com/t/CuAwqAc8G (ignore the white rectangle that appears when browsing files to upload, that's just me hiding stuff ) That's about 26mb worth of images resized to max width or height of 800px. So 26mb becomes 1.37mb prior to upload. My jaw is somewhere near the floor right now that this is all just JS, HTML canvas etc with fallbacks for even really old browsers No sound on the audio clip at the end but use your imagination - it plays direct from your PC before upload. That's probably more useful for videos to make sure you're uploading the right one!
  9. There does also seem to be a limit to what you can throw at it and I'm not sure why. I can't get anything above 7mb to work which could be a problem with larger photos, but it does fall back to the old faithful way of simply uploading the huge file and letting the server process it which is nice I guess. I'm probably just missing a setting somewhere.
  10. Just tested this and it works really well. I'm sure there's a more elegant way of changing the settings, but if you put this package on your server, edit js/main.js and change this near the top: $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'server/php/' }); to this: $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'server/php/', disableImageResize: /Android(?!.*Chrome)|Opera/ .test(window.navigator && navigator.userAgent), imageMaxWidth: 800, imageMaxHeight: 800, imageCrop: false // Force cropped images }); Then open the "Basic plus ui" tab on that package with Firebug on in Firefox then you can see it's sending image data rather than a file, so is resizing client-side really nicely. I just tested it on a massive image from my PC and the upload was really quick - I added a 3.5mb photo to the upload queue, it generated a tiny thumbnail instantly and told me it was going to upload just 171.24kb and it did EDIT: 7mb file worked just as quickly. This is like magic!
  11. Hi Sasa I think I've used that one in the past. It has Flash fallback etc, but the one I linked to (same one that mr-fan linked to ) seems to be pure javascript so compatible with most browsers without needing to rely on a client's device having anything else installed other than javascript - I think that's where it stands out against other solutions.
  12. The other thing I liked about this particular plugin is that it suggests support for reaaaaally old browsers too, so whilst we don't need to support older than the PW admin itself supports, it could be very useful for front-end upload implementations too where similar issues crop up. I really need to free up time to test this.
  13. This is a topic I check out every now and again because, especially on photo-heavy websites, some "seamless" way of resizing images before they are uploaded is something I've always wanted. You know the scenario - someone shoots a bunch of images with their 21 megapixel camera, tries to upload them not thinking about file sizes and the page hangs for ages whilst the image is resized. Or, worse, it times out because you didn't give PHP enough memory or increase the max execution time. I've tried a few PC-based tools to make like easier for clients - some in Windows are part of the right-click menu even, so they just need to remember to right-click and resize. But wouldn't it be nice to have something that does it automatically? Well this might just be the answer: https://github.com/blueimp/jQuery-File-Upload/wiki/Client-side-Image-Resizing - which is part of a larger library: https://github.com/blueimp/jQuery-File-Upload My question, because I just don't have time right now (lame excuse, but I've got a lot on and this may be of interest to you guys anyway), is whether anyone else has tried this particular set of scripts out, or if the image manipulation gurus amongst us (I'm looking at you Horst ) have considered something like this (canvas to blob conversion on-the-fly before upload seems to be what's happening here) or whether something like that seems simply too volatile - I imagine on huge images it could consume a lot of memory on the person's PC, which is still quicker as a smaller file is uploaded, but may have other side-effects. I have used a Java applet in the past primarily to handle huge files, but that also had some client-side image manipulation built-in, but Java is such a security issue nowadays it's unbelievable. Plus it requires Java to be installed in the first place, so something JavaScript-based, using browser features like canvas if they're available seems ideal, with fallback to simply uploading the large file and letting the server resize the image. One to think about anyway. I'm sure the W3C will eventually roll out a recommendation for browser-side manipulation, but as we know update and implementations are always guaranteed to come quickly or work consistently.
  14. I do like the Google Trends graphs, but be careful because if you put any of the "big 3" on the same chart with ProcessWire then PW doesn't even get above the bottom line. This is useful in highlighting a decline in two of the largest, and you can see that their share isn't necessarily translating into gains for Wordpress either. And though ProcessWire is a low line on this one compared to the others, there's a decline on the other three on this graph. I think these two graphs help highlight a change is already taking place and Wordpress seems to be staying steady(ish), but be aware that if they were all on the same graph then the lines on the second one wouldpretty mjuch flatline against those on the first one. I also looked around a few other sites that claim to be able to show usage stats for CMS' and they seem incapable of detecting ProcessWire (one site said there were only 17 detected installations last year or something like that - pretty sure there are more than that in the showcase ). I guess what I'm saying is that any figures should be taken with a pinch of salt, but the ones above do look pretty. If it helps anyone with this sort of argument, the ProcessWire site and forums attract on average over 2,200 users per day on weekdays according to Google Analytics. That's not to be confused with sessions, which is more like 3,200 per day. The Google Analytics graph for the last 4 years shows a healthy boost year on year.
  15. Pete

    Forum Software

    I liked the speed of FluxBB but the thing with forums is that you need a software that is ideally going to be around in several years' time. With FluxBB's slow progress (due to understandable stuff with the main dev) and the recent change of direction, I wouldn't get onboard with Flarum until it has been out there a while. Stay away from vB, get away from PHPBB (the purpose of this thread)... maybe try Xenforo? Personally I'm sticking with Invision Power Board. Partly because it's what I know, but version 4 has just been released and has responsive UI, trimmed down admin interfaces etc and so on. Still, I'm not planning on upgrading the ProcessWire forums for a few more versions whilst the early upgraders work more of the bugs out with the devs I am left feeling the same as you though Joshua - there is a massive hole in the forum market waiting to be filled and I've also been unable to find anything "simpler" written in PHP to fill that void. Unfortunately Ryan doesn't have a clone or we'd have a forum that's easy to integrate into the rest of your site with an awesome API
  16. Hey Nico The solution to the preview URL wrapping over the text below for your module is this code below: span.SEO_google_link { position: relative; overflow: hidden; white-space: nowrap; background-color: #fff; } span.SEO_google_link:after { content: ""; pointer-events: none; position: absolute; width: 50px; height: 100%; top: 0; right: 0; background-image: -webkit-linear-gradient(right, #ffffff, rgba(255, 255, 255, 0)); background-image: -moz-linear-gradient(right, #ffffff, rgba(255, 255, 255, 0)); background-image: -ms-linear-gradient(right, #ffffff, rgba(255, 255, 255, 0)); background-image: -o-linear-gradient(right, #ffffff, rgba(255, 255, 255, 0)); background-image: linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)); } All credit to this guy who I've been working with for a while: https://processwire.com/talk/user/2562-jw/
  17. Pete

    ProcessWire on the web

    Look at the last image and you can see who probably posted it too
  18. I think it's funnier that he's supermom (I think that word filter is a leftover from when someone was posting links to all sorts of illegal film downloads a year or two ago).
  19. What is the reason you need this? If it's for the admin and it would be handy to be able to add links on either page A or B then that makes sense. However if you only need it in a frontend template there are other ways to find what page B is linked to without the need for having the field in both templates. EDIT: Martijn's code looks like it would do what you want though
  20. I've changed it so anyone can set the first tag as a prefix, however staff will need to be vigilant and see that it is being used properly (I believe the original use case was to clearly define the different types of topic in the module forum, which may not be a problem in future with some restructuring anyway).
  21. Nope, just one video link (I actually applied it to a text field in my case that is solely for the video URL), so I set my image field to only allow 1 image. Soemtimes I want to set my own thumbnail though, so in those cases when I've uploaded an image of my own the module grabs a thumbnail anyway and saves it to the image field I've set to only allow one image, so I end up with two images which shouldn't be possible. You're right, expected would be to replace the image already in there, but it would be nice (albeit tricky) to allow per-image field to somehow say "if a single image field and there is already an image in there, don't overwrite". Now there's a challenge I guess the obvious way around it for my somewhat unique use case would be to have another image field and just tell my template "if manual thumbnail field has an image in it, ignore the thumbnail grabbed by the module in the other field". I'll probably go that route since I'm not sure anyone else has this need.
  22. Hi Adrian This is a really great module that's helped on two sites recently. My only issue (not a huge one) is that I'm using a single image field. It, possibly unexpectedly, adds a second image (ignoring the fact that the field is set to only allow one image) whereas it might be nice for it to have the option somehow of detecting an image in that field already and not bothering adding another one. Certainly it having 2 when it's set to only allow 1 is a little confusing
  23. Pete

    jQuery Not

    I guess what I need is something like this (which is untested as I need to leave the house now and probably doesn't work): Basically for each hidden input, if the parent is hidden then remove it. That should capture everything I need it to then. $("#myform *:hidden").parent(":hidden").remove(); All suggestions are very welcome.
  24. Pete

    jQuery Not

    Hi guys For various complicated reasons I have fields re-used in a form with text around them, and various conditions show one set of text with the fields inline and hide the others. As such, it's a mess when I submit What I need to do is, on submit, remove all hidden fields (hidden by their parent containers not being visible, not fields with type=hidden) and exclude asmSelects from being removed since the field the ASMSelect data is stored in is always hidden. I had come up with something like this: $("#myform *:hidden").not("[type=hidden], name*='[]").remove(); But it's not idiot-proof really as 1) it doesn't work and 2) even if it did, I'm detecting ASMSelect's by searching for [] in the field name. These latter fields could be in a hidden section and should therefore be skipped. What I really need is to iterate all fields, remove all where the PARENT element is hidden and never remove input type=hidden and I think that would work, however my brain certainly doesn't work right now Any ideas? I know it's going to be a simple one-liner that I kick myself over.
  25. I've known people in large organisations (not saying which) turn down quotes because the price seemed suspiciously low. No follow-up discussion to ask why it was low, just discarded the quote in favour of a higher one.
×
×
  • Create New...