Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/18/2019 in all areas

  1. A simple module to enable easy navigation between the public and the admin side of the site. After installation a green bar will appear to the upper side of the screen, containing a few navigation elements and displaying the PW version number. Heavily inspired by @apeisa's great AdminBar (Thanks!). I needed a bit simpler tool for my projects and as a result, this was made. Available on GitHub .
    4 points
  2. Interesting read about "Golang vs PHP (Symfony4)". https://dannyvankooten.com/from-go-back-to-php-again/
    2 points
  3. So, yes, this method unzips all nested files. My use case, for anyone who may need: <? // hook into tutorial upload and unzip file into destination wire()->addHookAfter("InputfieldFile::processInputFile", function(HookEvent $event) { $pagefile = $event->argumentsByName('pagefile'); // limit to a specific field {file_tutorial}, restricted to zip uploads if($pagefile->field->name != 'file_tutorial') return; // full disk path to your custom uploads directory $tutorialsBaseDirectory = $this->wire('config')->paths->assets . 'tutorials/'; // extend path with custom directory nam corresponding to page id $pageIdDirectory = $tutorialsBaseDirectory . $pagefile->page->id . "/"; // extend path with custom directory name from the filenme without extention $tutorialDirectory = $pageIdDirectory . $pagefile->basename($ext = false); // use ProcessWire's $files API // @see: http://processwire.com/api/ref/files/ $files = $this->wire('files'); // Remove directory and its files after ensuring $pathname is somewhere within /site/assets/ $files->rmdir($pageIdDirectory, true, [ 'limitPath' => $tutorialsBaseDirectory ]); // make tutorials id directory correspondig to ressources id if($files->mkdir($tutorialDirectory, true)) { // directory created: /site/assets/tutorials/id/filenameWithoutExtension } // get zipfile and destination and unzip $zip = $pagefile->filename; $dst = $tutorialDirectory; $items = $files->unzip($zip, $dst); }); Adopted from The script takes an uploaded zip and unzips it into the destination folder. As it has an index.html I can point a link to it.
    2 points
  4. https://processwire.com/docs/start/install/troubleshooting/ I would delete my PW cookies, check allowedHosts in config if you switched domains, and delete the contents of site/assets/cache. Plus checking server and PW logs. Also, temporarily switch $config->debug to true to see errors you normally wouldn't see if set to false.
    2 points
  5. Visual Page Selector version 006 (released (18/02/2019) Happy to announce that the latest release of Visual Page Selector is now available for Download/Purchase. Thanks to suggestions by @Macrura, this version includes a number of improvements one of which will require clients to relearn one thing (sorry). Changelog Ajax vs Manual Save: You can now choose whether pages added to inputfield should be immediately saved to the pagefield (via Ajax) [the default behaviour] versus have them added in a sort of "pending state". If the latter, pages will be added to the inputfield (for visual purposes) but will not be saved to the pagefield until the page you are editing is manually saved. In the modal, visually, the pages are presented as if they are in the field (i.e. similar to pages saved in the field). In the inputfield, a pending page behaves like other pages saved in the field; they can be reordered, edited, etc. This feature has several advantages including the fact that changes can be made to the page without immediately being reflected in the frontend. Please note that reloading the page being edited without saving will discard pending pages! The setting is in the Input Tab (Modal Settings) when editing the field. Trash Icon: VPS Inputfield (Thumbs View) now behaves like a PW image field in relation to deleting pages in the page field. To delete an image from a PW image field, the process simply involves marking an image for deletion by clicking on its trash icon and saving the page. Previously, VPS (Thumbs View) has required two steps (in multi-page fields); first to mark an image for deletion by clicking on its trash icon and finally clicking on the remove icon (x). In single page fields, there was no icon altogether. It required clicking on the remove icon (x). Hence, these similar actions behaved differently from each other and from PW image fields (which VPS in Thumbs View seeks to emulate and enhance). With this update, VPS now behaves similar to PW image fields across the board. To remove pages from a pagefield using VPS, simply click on their trash icons and save the page. We have removed the remove icon (x). Unfortunately clients will have to be re-taught about this change but I think the benefits outweigh the inconvenience. Modal Lister View: We've improved the visibility of pages selected for adding to a VPS inputfield. The light grey background did not provide enough contrast. We've gone for a light red (pink?).
    2 points
  6. Some fresh sounds I discovered recently. I didn't know I'd like this Synthwave music but... can't get anything done without it. Whole YT Channel: https://www.youtube.com/channel/UCmYTgpKxd-QOJCPDrmaXuqQ Some more on Basecamp. If you loved Stranger Things (Netflix) you will probably like this too. https://synthwavecafe.bandcamp.com/album/stranger-things-tribute
    2 points
  7. Probably worth pointing out that currently the "safe thing to do" is going with 7.1 or 7.2: 7.0 is no longer officially supported, so it's no longer receiving security updates, and even 7.1 will stop receiving (security) updates near the end of this year. 7.3 is currently the "cutting edge" version, so you might want to wait a while before going there. In terms of security there are exceptions, such as Ubuntu, where distro maintainers have been backporting security-related fixes from new versions to old ones – but if you're already on 7.0, I would assume that it's not the one that you got with your operating system, and as such is likely that you're already using a (potentially) insecure version.
    2 points
  8. Hello gbball and welcome to the forum, WebGL is a browser technology, so everything happens on the client side and has nothing to do with ProcessWire. You just have to make sure your library gets loaded on your page. The docs of three.js show you how you do that: https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene This sounds good to me ? Did you do (DO, not READ ? ) the hello worlds tutorial? https://processwire.com/docs/tutorials/hello-worlds/ This might help you to understand the basics of PW and might make it easier to do the right things when going through the three.js docs.
    2 points
  9. Version 0.5.0 fixes two issues, please update: Fix wrong url in the <link rel="alternate" hreflang="x-default"> meta tag. Fix date formatting for the lastmod property in the XML sitemap. Cheers
    2 points
  10. I just wanted to share what I've just discovered after looking at Dragan's "CMS evaluation / checklist / usability (only in german for now)" article, even if I can't read german currently. https://animejs.com https://github.com/juliangarnier/anime
    2 points
  11. Relying on .htaccess is not really uncommon for php cms's out there. Some are more minimal on utilising apache, processwire is probably more on the "take what we can get"-side. Having php serve everything – especially static assets – is just not performant enough in any way. That's the reason for needing to rely on the webserver in front of php in the first place. The reason for apache specifically is because of .htaccess. Other webservers are usually only statically configurable, which is a deal-breaker for any shared-hoster, where a (global) webserver cannot be restarted whenever a single user needs to change his configuration. So if you only support one webserver, it better be apache.
    2 points
  12. Here is another progress report for development (early state) of my GroupMailer module: The dashboard and the message lister are nearly finished. Behind the scenes I created a custom field which holds all MessageMeta data. This special field can be attached to each template you like and will immediately make all corresponding pages a GroupMailer message. This allows to maintain the extreme flexibility of ProcessWire. More to come ...
    2 points
  13. Hello for all, ConfigurationForm fieldtype module is one my experiment from 2016. Main target to build this module was to store multiple setup and configuration values in just 1 field and avoid to use 1 db table to store just single "number of items on page", or another db table to store "layout type" etc. Thanks to JSON formatted storage this module can help you to reduce number of PW native fields in project, save DB space, and reduce number of queries at front-end. Install and setup: Download (at the bottom ), unzip and install like any other PW module (site/modules/...). Create some filed using this type of field (ConfigurationForm Fieldtype) Go to field setup Input tab and drag some subfields to container area (demo). Set "Name" and other params for subfields Save and place field to templates ("Action tab") How to use it: In my case, I use it to store setup and configurations values, but also for contact details, small content blocks... (eg. "widgets"). Basic usage example: ConfigForm fieldtype "setup" has subfields: "limit", type select, option values: 5, 10, 15, 20 "sort", type select, option values: "-date", "date", "-sort", "sort" // get page children (items) $limit = isset($page->setup->limit) ? $page->setup->limit : 10; $sort = isset($page->setup->sort) ? $page->setup->sort : '-sort'; $items = $page->children("limit=$limit, sort=$sort"); Screenshots: Notes: Provide option to search inside subfields Provide multilanguage inputs for text and textarea field types Provide option for different field layout per-template basis Do not place/use field type "Button" or "File input" because it won't works. Please read README file for more details and examples Module use JSON format to store values. Text and textarea field types are multilanguage compatible, but please note that main target for this module was to store setup values and small content blocks and save DB space. Search part inside JSON is still a relatively new in MySQL (>=5.77) and that's on you how and for what to use this module. Thanks: Initial point for this fieldtype was jQuery plugin FormBuiled and thanks to Kevin Chappel for this plugin. In field type "link" I use javascript part from @marcostoll module and thanks to him for that part. Download: FieldtypeConfigForm.zip Edit: 14. August 2018. please delete/uninstall previously downloaded zip Regards.
    1 point
  14. HELLO! I've been working on a user messaging module which I am nearly ready to release as version 1. Currently I have the below functionality and I'm looking for feedback to what other things may be useful for people looking to add user to user messaging on their sites. compose message to one or more users known to PW js to enable tag based UI display of user names input on compose message form display all message threads with reply forms reply to message thread displaying each user name by each message in the thread display "unread" when a thread has new content that hasnt been seen by current user delete or unpublish message thread (configurable) display total message thread count display total unread threads (threads that have new replies that the current user has not seen) delete all message threads and associated data (not meant for the users to have access to) road map send email to user on new message to a thread they are included in
    1 point
  15. This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new $page->if() method— https://processwire.com/blog/posts/pw-3.0.126/
    1 point
  16. I've introduced ProcessWire (gleefully) to quite a few devs I know. One, who is quite a bit more experienced than I am, raised a question that I couldn't answer: Does ProcessWire rely on .htaccess *too much*? I realize that .htaccess handles a lot of baseline security and routing issues within the ProcessWire ecosystem. Inevitably, this leads to a large reliance on Apache, unless one is willing to try to convert those rules to NGINX configurations. This has led me to wonder, is there a better way (PHP based?) of handling routing and security than .htaccess?
    1 point
  17. Not sure sorry, but it's working for me:
    1 point
  18. Ok, Thanks berhard, I'll give that a try. I think a blank profile might be more straightforward at this point. Then I'll see if I can figure out how to plug it into the other setup. Cheers, Gavin
    1 point
  19. Any updates on this? I've been occupied lately, but spotted some details too. A seperate repo would be awesome. I've referenced the Ember kind-of-way before (including their awesome RFC process), but I also like their approach to a volunteer based website on github. Also checkout the README with other public repositories too. All community / PR merge request based.
    1 point
  20. Have to take a look, but messaging sounds great! encrypted would be nice! What's with group messages oder push notifications (web push)?
    1 point
  21. +1 for dropping support. Maybe adding a check before upgrade and showing a warming/hint that older php versions can use the old tracy module (that is already great) with a link where to download it?
    1 point
  22. Hi mel47, sorry to hear that. Check your finder with RockFinderTester, maybe it is somehow broken. If that does not work you can write me a PM support request and maybe provide a login to your system so that I can check what is going on. You need to make sure that the response of the AJAX requests are valid JSON. Also check all your error logs, maybe you find some helpful information there.
    1 point
  23. Hi Robin, it's working now I've put my functions in the module file, not the config file. Apologies for the stupid question and thanks for your help!
    1 point
  24. @PhotoWebMax Are you on GD or ImageMagick? Second should produce better results. Also, try to set sharpening to 'soft' which is PW default.
    1 point
  25. I was pleasantly surprised this module still works on the latest dev PW version ? Well, with one exception: The search assumes there are two more fields present, but the readme doesn't mention them. This results in errors... https://github.com/somatonic/ImagesManager/blob/master/ImagesManager.module#L469 Are select_production + select_person page-references? I can't find them in the install instruction or module config. (I'm fully aware the module has never been officially declared as stable and is now 5 1/2 years old, but some files have been updates 4 months ago, so I thought maybe asking here wouldn't hurt...)
    1 point
  26. Many thanks. Slightly adapted that. This works: '<span style="display:none">' . $membership->modified . '</span>' . datetime('d/m/Y', $membership->modified) with the MarkupAdminDataTable method setEncodeEntities(false) BTW, I also tried '<span class="datetime">' . datetime('d/m/Y', $membership->modified) . '</span>', which is what seems to be used in ListerPro (and works), but that didn't work in my module for some reason. Shame, because I would prefer not to have the concatenated formatted date after the unix integer as part of the sort key (although it shouldn't be a problem with the chosen format).
    1 point
  27. I'm biased, and probably not the biggest user of Tracy either, but in my opinion support for PHP < 7.1 should be safe to drop by now. For the folks stuck with those versions, current Tracy version still works – right? That's what I've been doing with my modules and code recently: splitting a separate "legacy" branch for those who need it, but only focusing new development for current PHP versions. And by "current" I mean the officially supported ones.
    1 point
  28. Just another update to the Tracy core - apparently LIVE dumps now work more reliably and are now the default when calling barDump(), so it looks like we'll be able to ditch our custom bdl() method and probably even our bdb() and db() and integrate the LIVE option into standard d() and bd() calls. As you can tell, I am excited about the new version ?
    1 point
  29. @Robin S - I haven't ignored your request - it will be in the next version. Speaking of the next version, I have been looking at the poll from @teppo's PW Weekly and wondering what you guys would think about Tracy dropping support for PHP < 7.1 ? The new core Tracy 3.0-dev version requires PHP version 7.1 or newer and looking at the changes since the 2.5 version we are currently using, it won't be practical to support two versions of the core like I have done previously. So, the question is, can I make 7.1 a requirement for the new version? Not sure how to really get your feedback on this, but maybe a "like" means your OK with it, or a "sad" if you're not happy either sticking with the current version of this module (to maintain 5.x support), or otherwise don't want to lose 5.x support just yet. The new Tracy core comes with much faster rendering of dumped objects with a lot of depth, so we might be able to increase the default and big dump options significantly. There have also been improvements to live dumping that I still need to experiment with, but both sound very useful to have so I would like to upgrade. Thanks for your thoughts.
    1 point
  30. Using .htaccess is efficient. You could, in theory, handle (nearly) everything in PHP, but this would add serious overhead, both memory and speed wise. Others have adapted the rules for NGINX, a few like me use IIS with URL Rewrite to power PW, but in all cases, it makes sense to filter and rewrite requests in the web server itself. The topic of supporting more platforms than just Apache out of the box has been brought up a few times already here in the forums. Ryan himself is not opposed to it, but he lacks the time to develop and test the rule sets, and he is of course wary of including anything that hasn't been well tested or that might end up without active support (any changes he makes for .htaccess need to be quickly adapted for other platforms). So I guess it would need a team of knowledgeable volunteers who develop the rules, adapt the installer script, test everything well and provide quick support before he considers integration into the PW project.
    1 point
  31. @gebeer, glad it's been of help :-). I can't remember when this was introduced, but yeah, it's now a requirement. I'll add the method though. Thanks! Use this instead: /** * Per the WireArray interface, return a blank Matrix * * @return WireData $matrix A blank Matrix. * */ public function makeBlankItem() { $matrix = new Matrix(); return $matrix; }
    1 point
  32. Not sure if it gets exactly what you want, but I think @Robin S's Breadcrumb Dropdowns are the best thing ever ? http://modules.processwire.com/modules/breadcrumb-dropdowns/
    1 point
  33. Github is the bigger platform (potential for collaboration), it's interface is quite a bit faster and more productive than gitlabs and it has a better history in terms of availability. Also there are quite a lot of addons like linters, bots or CI options, which directly integrate with the github interface. All in all it's imho the more polished product in almost all areas. The only place I feel Gitlab is ahead is with it's integrated CI/CD tools.
    1 point
  34. You can Hook into InputfieldFile::processInputFile. There are other places in that Class you could also hook into, but I think processInputFile works best. Throw the code below in ready.php Please note: Starter code: not much validation going on other than checking if the field the file was uploaded to is 'course_file' You will have to implement other logic yourself. For instance, the code copies the file immediately it is uploaded by ProcessWire Ajax. It doesn't check if the page is actually saved. If a page is not saved and the page is reloaded, as you know, files in file fields are deleted from disk. This code does not delete the corresponding file in your custom directory You might want the Hook to only run if you are in admin. You can add that logic I've purposefully left in verbose and debugging code in there (Tracy stuff) to help you ( maybe and others) understand what's going on. I suggest you test using Tracy Debugger for a better grasp of the file upload process. Delete the debugging stuff when you've got this working as you want :-). wire()->addHookAfter("InputfieldFile::processInputFile", function(HookEvent $event) { // @note: here, events are $input, $pagefile, $n @see: the method // get event we are hooking into // get arguments by index {a bit faster, but less-readable} /* $input = $event->arguments[0]; $pagefile = $event->arguments[1]; $n = $event->arguments[2]; */ // get arguments by name #$input = $event->argumentsByName('input'); $pagefile = $event->argumentsByName('pagefile'); #$n = $event->argumentsByName('n'); // $pagefile->field: The Field object that this file is part of. // limit to a specific field {course_file} if($pagefile->field->name != 'course_files') return; # intercept file // Tracy Debugger calls to see what's going on. Also logs Ajax inputs! #bd($input, 'input'); #bd($n, 'input'); // @see: http://processwire.com/api/ref/pagefile/ // pagefile object bd($pagefile, 'pagefile'); // name of the field uploading to {your 'course_file'} bd($pagefile->field->name, 'field pagefile is part of'); // file-sanitized name of the file we've added, e.g. 'checklist_install.pdf' bd($pagefile->basename, 'name of added file'); // full disk path where the file has been uploaded in this page's files folder... //... in /site/assets/files/1234 where 1234 is this page's ID // ... e.g. "F:/www/mysite/site/assets/files/1234/checklist_install.pdf" bd($pagefile->filename, 'full disk path name of added file'); // $pagefile->page: The Page object that this file is part of bd($pagefile->page->id, 'id of the page file added to'); // full disk path to your custom uploads directory $customDirectory = $this->wire('config')->paths->assets . 'custom_directory/'; bd($customDirectory,'custom directory for files'); # copy file // use ProcessWire's $files API // @see: http://processwire.com/api/ref/files/ $files = $this->wire('files'); // copy the file(s) $files->copy($pagefile->filename,$customDirectory . $pagefile->basename); });
    1 point
  35. I am not giving you a checklist but a tool which can be helpful for "managing" the end of your project by writing tasks. Check out https://github.com/deployphp/deployer I personally use it in conjunction with Duplicator - but it can be used in any workflow, like rsync etc... - Once the package is created, you launch your task and the tool configure/deploy everything for you.
    1 point
  36. yes, we can help! you just need to add check_access=0 to your selector http://cheatsheet.processwire.com/selectors/built-in-page-selector-properties/check_access-0/
    1 point
  37. I think you're a spammer. If you were using ProcessWire, you would know where the configuration file is...
    0 points
×
×
  • Create New...