benbyf

Members
  • Content count

    445
  • Joined

  • Last visited

  • Days Won

    3

benbyf last won the day on July 18 2016

benbyf had the most liked content!

Community Reputation

427 Excellent

About benbyf

Contact Methods

  • Website URL
    http://www.benbyford.com

Profile Information

  • Gender
    Not Telling
  • Location
    London / Bristol, UK

Recent Profile Visitors

10,493 profile views
  1. getting this error after submitting a new module to the processwire.com site. The module is called PostProcessUrl. Unable to complete this request due to an error. - Error has been logged.
  2. I've created a quick module implementation of @Can's work. https://github.com/benbyford/PostProcessUrl Hard Truncates any page name / url to a max length if exceeded.
  3. or write some CSS and don't rely on frameworks
  4. ok that was hard work. I finally managed to upgrade from 2.4 - 3.0 without SQL errors, not sure how i did it to be honest. However, when on 3.x. I ran into a few Internal Server Errors: 2017-04-20 15:48:04 ? http://shortunsserver.nicegrp.com/?/ Error: Class 'InputfieldText' not found (line 7 of /srv/users/serverpilot/apps/shortuns/public/wire/modules/Inputfield/InputfieldPassword.module) 2017-04-20 15:44:46 ? http://shortunsserver.nicegrp.com/?/ Error: Class 'ModuleJS' not found (line 3 of /srv/users/serverpilot/apps/shortuns/public/wire/modules/Jquery/JqueryFancybox/JqueryFancybox.module) and 2017-04-20 15:38:34 ? http://shortunsserver.nicegrp.com/?/ Error: Class 'ModuleJS' not found (line 3 of /srv/users/serverpilot/apps/shortuns/public/wire/modules/Jquery/JqueryFancybox/JqueryFancybox.module) I was able to fix each one of these by adding the <?php namespace ProcessWire; at the top of each file... now works but still a bit confused.
  5. errors in system-updater.txt 2017-04-19 17:10:37 ERROR: Update #SystemUpdate12 ERROR: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created' 2017-04-19 17:10:37 ERROR: Update #SystemUpdate12 ERROR: Failed to apply update 12
  6. yep that gist solves it. I just kept the wireSendFile() if the file isn't a partial content reponse and works well. Thanks @abdus! new games podcast with my friends www.threepointspodcast.com/
  7. think maybe my Headers are still wrong as it has a problem when seeking - gives me a "video or MIME type not supported" error
  8. cooooooooool, will try and amend. Your 2 cents is super useful but seems your code was a mix of your suggestions and code needing amending no? bit confusing sorry
  9. please see this post if your having issues with byte-range request validation on itunes:
  10. That anwser did the trick i think, i managed to make the implementation below. It must have been a new itunes requirement for byte-range headers. $filesize = filesize($page->mp3->httpUrl); $offset = 0; $length = $filesize; if ( isset($_SERVER['HTTP_RANGE']) ) { // if the HTTP_RANGE header is set we're dealing with partial content $partialContent = true; // find the requested range // this might be too simplistic, apparently the client can request // multiple ranges, which can become pretty complex, so ignore it for now preg_match('/bytes=(\d+)-(\d+)?/', $_SERVER['HTTP_RANGE'], $matches); $offset = intval($matches[1]); $length = intval($matches[2]) - $offset; } else { $partialContent = false; } $file = fopen($page->mp3->httpUrl, 'r'); // seek to the requested offset, this is 0 if it's not a partial content request fseek($page->mp3->httpUrl, $offset); $data = fread($page->mp3->httpUrl, $length); fclose($page->mp3->httpUrl); if ( $partialContent ) { // output the right headers for partial content $headers = array( 'HTTP/1.1 206 Partial Content' => true, 'Content-Type' => 'audio/mp3', 'Content-Length' => $filesize, 'Content-Disposition' => 'attachment; filename="' . $fileName . '"', 'Content-Range' => 'bytes ' . $offset . '-' . ($offset + $length) . '/' . $filesize, 'Accept-Ranges' => 'bytes', ); // send partial file wireSendFile($page->mp3->filename, $options, $headers); }else{ // send file wireSendFile($page->mp3->filename, $options); }
  11. could be the case.
  12. im still puzzled why it works on the same infustructure but different versions of PW.
  13. not sure how to do that in PW. But also it's mega strange it works on my v2.7 install but not on v3.
  14. related to this topic on wireSendFile(). I've been trying to create a RSS feed for a podcast which i've done previously using PW 2.7.2 with no trouble (e.g. http://machine-ethics.net/), however sitting on the same infustructure a new site (http://www.threepointspodcast.com/) on PW 3.0.42 is having issues validating with itunes with this error from them: Can’t submit your feed. Your episodes are hosted on a server which does not support byte-range requests. Enable byte-range requests and try again. Which is obviously untrue as the other podcast works fine. Just wondering if there's something I need to add in the template settings etc to make it work, I'm currently running the .mp3 file out using wireSendFile() and setting the type to application/mp3 in template settings but with no avail. I'm running nginx. Any help would be appreciated.
  15. working now including the <?php namespace ProcessWire; Thanks!