Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. @flydev - this might save you some time: https://github.com/adrianbj/TracyDebugger/blob/c6335760db5467fe018a30c853abf7d4c1c6c967/panels/ProcesswireInfoPanel.php#L288-L306 It provides other options for detecting mod_rewrite, but might also be helpful for mod_userdir
  2. They are different beasts, but you can get the label like this: $page->table_name->getLabel('select_field_name');
  3. Select will return a string. Select Multiple will return an array. The label or title is part of the field definition, not the stored value for that field for the selected row. Does that make sense?
  4. @flydev - just noticed the order of local vs Google Drive packages is reversed. Would be nice to have them both in descending order. Should they maybe also blended together?
  5. If you're running AdminOnSteroids I think you can do it there as well.
  6. I guess I don't actually understand why $this->config->urls->admin . 'setup/' isn't working. It seems like a valid url and I don't understand why the full http:// url works. As for httpAdmin - any of the config->url options can have the http prefix and they will work - very handy!
  7. Regarding mod_userdir - I am curious about this - is this going to affect other PW modules, or the core even - it looks like might? Can you guys let us know what $this->config->urls->admin . 'setup/' returns when mod_userdir is installed? FYI - with that recent fix, you can avoid that str_replace by going for the option on line #3
  8. Not currently that was my thought of how to achieve it
  9. I am no expert, but I though the two key advantages to CDNs were: 1) Browser caching - if someone already has http:://wwwcdn.com/jquery.min.js cached in their browser they won't need to load it again - this is probably the biggest reason isn't it? 2) CDN servers might be faster than your cheap shared hosting?
  10. Does this help? http://modules.processwire.com/modules/import-external-images/ I feel like it would be nice to also have the option to paste in a URL to an image directly into the images field as well though - maybe it could be extended?
  11. Thinking about this a little more - is there any reason to actually instantiate a new HookEvent() ? The cronJob() method doesn't actually make use of the passed $event. Am I missing something?
  12. Good point - then simply do this: $e = class_exists("\ProcessWire\HookEvent") ? new \ProcessWire\HookEvent() : new HookEvent(); I know that feeling very well - rest up!
  13. The problem I see with your approach is that you need a new field for each question - I actually did this on my first ever PW site - it works, but it's a lot of fields to maintain and requires a dev to add new questions. If you make each question a page, then anyone can add new questions. I would also be worried about that lister view - won't there be a lot of horizontal scrolling if there are lots of questions?
  14. Hi @szabesz - if I understand correctly, I think you could make use of this module instead of your custom site_email_user_login_info() function. Via the API you can use: $u->sendEmail = true; If you need to adjust the body of the email (both via admin and frontent/API), you can hook into: EmailNewUser:: parseBody - you could add your own logic for dynamically building the http://example.com/?user={id}&token={login_token} link without hardcoding anything. https://processwire.com/talk/topic/7051-email-new-user/?do=findComment&comment=136252 Let me know how you go.
  15. It's late and I must be tired, because I think that is what my proposal will give you. I suppose it is the answers to a single question, rather than an entire questionnaire - maybe that is the difference you are referring to? But surely you need to look at one question at a time? I don't really understand how the response page reference field will help, but maybe I am just not getting it? Of course the other option is to build your own Process Module interface (instead of Lister Pro) which shows exactly what you want - still pulling questionnaires, questions and their answers from the page structure I suggested. This would be the most flexible option. This is where you could make use of a page reference field to choose a questionnaire - pass the selected option to the rendering of the questions and their results. Should be quite easy to set up and completely flexible - I think that is what I would do. If they are mostly yes/no answers you could even build a graph inline showing to visualize results.
  16. Sorry, I forgot that Duplicator of course also handles DB backup
  17. Hi @flydev and @kixe - I am using Duplicator and CronjobDatabaseBackup on a site and I would like Duplicator to also send the DB backups created by CronjobDatabaseBackup to Google Drive. The problem is that because by default they both store files in site/assets/backups My solution has been to move Duplicators backups to /site/assets/duplicator and then uncheck the "Backups" options under the "Files and folders excluded from the package" setting. This should work, but I think perhaps there could be a cleaner solution. Also @flydev - I think the warning about exponential size if unchecking "backups" should have the caveat that it is only relevant if backups are being stored under /sites/assets/backups. The other quick question - if I set the max number of packages to 10, but leave the "Remove backup packages older than" option to "never", what will happen. I assume that as the 11th is added, the 1st will be removed, but this seems to contradict the "Remove backup packages older than" option. Can you explain exactly what happens here?
  18. @flydev - I set up the system cron last night and didn't think too much about, but checking today I see that it didn't work. It turns out the issue is: $e = new HookEvent(); You just need to add the ProcessWire namespace to the top of the cron.php file and everything works as expected.
  19. Actually I think it could actually work really well. The predefined filters would be: template=answer - that would get you limited to all the answers. Now you just need to limit to the parent with the question they are interested in. You could add another ready filter for parent.name which they could use to enter the name of the question. The catch of course is that it's not friendly for the user, so what I think I would do is create a simple Process Module (or even an AdminAction) that lists all the questions and links to the Lister view that shows all the answers for the selected question. There are other ways to make links to Listers, but this module (https://modules.processwire.com/modules/process-page-lister-urls/) might make this really easy (I haven't tested it). Another option would be to add a custom page list action button (like edit, view, etc) that links to a lister view of all the answers for the clicked question. This won't help you right now, but I think I nice addition to Lister Pro would be to define a selector for providing a list of child pages to choose from, rather than having to manually type a name/title/id, etc
  20. I think the only issue you'll have with PW 2.5 and PHP 7 will be a few PHP notices. There shouldn't be any errors, but if you are not planning on upgrading that 2.5 to 3, then might be safer to stick with php 5.6.
  21. Why not do each question as a child page. And each answer as a grandchild. I have done this before and it works really well - it's infinitely scalable! Questions ---Question 1 -------Answer 1 -------Answer 2 -------Answer 3 ---Question 2 -------Answer 1 The question template would have just a title field. The answer template would have these fields: answer (select options): yes / no body (textarea): comments or even a real comments field type if you want, although probably not appropriate in the backend
  22. Glad you got it sorted, but while you are upgrading, I would really recommend PHP 7 if it's easily available on your host. If not, at least go for 5.6. If they don't have that, then look elsewhere
  23. Can you try disabling eccelerator in you php.ini to see if that helps?
  24. Thanks @flydev - it's awesome to have that option - not sure about using a "every 1 minute (*/1)" call as the example though
  25. Hey @flydev - I am finally getting around to trying this - everything works great, but I am wondering about triggering via a manual system cronjob. I expect Lazcron will result in quite a slowdown for whichever user is unlucky enough to trigger it. As for the PWCron module - I don't really like it at first glance because it looks like it is no longer being maintained.
×
×
  • Create New...