Jump to content

Pete

Administrators
  • Posts

    4,054
  • Joined

  • Last visited

  • Days Won

    67

Everything posted by Pete

  1. @Tom - Do you and Ryan remember that PM I sent a while back to achieve just that?
  2. To answer your last question, you can create whole new admin interfaces using the API with some work, however if you're in a hurry you can use ListerPro (single license is really cheap) to create your own admin pages with filtering capabilities. Depends how much code you want to write really
  3. I'm with you now - thanks Soma.
  4. I certainly won't be forgetting it in a hurry Just a quick one - is there any way/need to ever display the object equivalent of array_keys? Usually ends in recursion on objects in ProcessWire, but I can never remember when $page is $event->object or $event->arguments[0] etc etc. Is there an idiot's guide list to which one is available depending on where you're hooking? I mean basically the stuff like the $page object that isn't necessarily as obvious as a parameter as to how to access that data.
  5. Thanks guys, seems really obvious now
  6. Hi guys I want to hook and replace the output of InputfieldFile's renderItem function as I want to change the output in a module but only for one template (narrowing down the template is the easy part). The idea is I don't want to have a whole new module just for changing the output on one template in the admin. My problem is that I need the same 3 arguments the original funciton has and I'm just not sure how to go about it: protected function ___renderItem($pagefile, $id, $n) { Any ideas? I got as far as this: $this->addHookBefore("InputfieldFile::renderItem", $this, "renderFile"); and in my renderFile function I did this: public function renderField(HookEvent $event) { $inputfield = $event->object; if($this->page->template != 'admin' || !$inputfield instanceof InputfieldFile || $this->input->urlSegment1 != 'attach') return; // 'attach' is the urlsegment I'm looking out for in my ProcessModule as it's that particular page on the module I want to alter the file field's markup for ... } But then I don't know how to get $id and $n from the original function... any ideas?
  7. I just didn't want anyone to create unnecessary extra work for themselves unless they really wanted to
  8. You could use $fredi->renderAll($your-page-id); I think in Fredi to achieve similar? Either way, I am loving front-end editing whatever the method. Not sure why I'd not looked into it sooner myself.
  9. 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.
  10. 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
  11. 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!
  12. 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.
  13. I've fallen for this before myself - glad you worked it out.
  14. 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).
  15. 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.
  16. 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!
  17. 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.
  18. 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!
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. 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
  24. 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/
  25. Pete

    ProcessWire on the web

    Look at the last image and you can see who probably posted it too
×
×
  • Create New...