Jump to content

netcarver

PW-Moderators
  • Posts

    2,233
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by netcarver

  1. Does using this test work? if (count($wrapper->singleeventtable->attr("value")) === 0) { It may not, just guessing at the moment.
  2. Have you tried hooking ProcessPageEdit::buildFormContent? Like this; $pages->addHookAfter("ProcessPageEdit::buildFormContent", function($event) { $wrapper = $event->return; $wrapper->YOUR_FIELD->collapsed = Inputfield::collapsedHidden; }); If that works, you can add conditional logic to only apply it as needed. I usually apply this kind of hook in site/ready.php.
  3. None that I know of. Are you sure you have that file in the right place? Edit the template for your order pages in PW. Click on the title (invoice number) field and, on the input tab, set the visibility to whatever you need.
  4. Ok, so forget my previous post as that only acts on the profile pages. On a PW 2.7.3 install I setup a FieldsetTabOpen (and _END) and added them to my user template and threw a couple of extra fields in between them and saved the template. Next, I added the 'user-edit' permission to my 'editor' role (that role also has page-view, profile-edit and page-edit permissions set.) Now, when I log in as an editor and look at the user pages, I get the tab and can edit the fields within. Just to be clear; I did not have to setup any additional permission requirements on the field. Do you have any additional permission requirements setup on your FieldsetTabOpen field?
  5. I like InnoDB, it has row-level locking and is ACID compliant - so I'm biased. That said, I'm not really making a call one way or the other (I know nothing about your application) I was just trying to provide the only performance data I have.
  6. Are you talking about allowing the fieldset to show up when users visit their profile page? If you are, then try this; Log back in as superuser Edit the configuration for the core module ProcessProfile Select all your new fields, including the fieldset, by checking the box next to them Save the module settings Now log back in as a non-superuser and visit your profile page. Untested - YMMV
  7. I'd probably just use the built-in text sanitiser; $ua_string = wire('sanitizer')->text($ua_string); Your code looks good enough though. It strips tags, limits length and culls newlines and tabs.
  8. @Ivan, Back in 2012, I decided to compare access times of a locally hosted site both before and after I switched it over to InnoDB. At the time I was in a dialog with Ryan about the benefits of, at least, allowing InnoDB as one of the DB engine choices during install. After all these years, I am delighted to see it finally arrive. Here's a screenshot of the side-by-side results of running 500 requests vs a, then standard, PW install - one using MyISAM and one using InnoDB. In general, MyISAM was faster than InnoDB - but it also had a larger standard deviation in the delivery times. Don't worry about the "failures" reported above - remember that the default install back then would serve one of a set of random images and the test tool looks to see which responses matched the first response - a non-match counts as a "failure". InnoDB did have a slightly higher throughput in terms of requests served per second.
  9. Perhaps sanitise the user-agent string you pull from the $_SERVER variable? I don't know how much of a risk it really represents in this case, but it is possible to overwrite these headers with certain browser extensions, meaning they can be crafted by cunning minds, to supply certain strings to applications. At the very least I'd think about stripping tags from that value before you store it.
  10. Looks great, Benjamin, thank you! I have not tried this yet, but look forward to doing so. Could your module check if ProcessDatabaseBackups is installed? If it is perhaps it could take care of either backing up the DB or at least reminding the user to do so, before it performs a migration.
  11. @GuruMeditation Thank you for the module - and welcome to the wonderful world of "official" module authorship!
  12. For such a simple replacement, using a regex engine is total overkill. Have a look at PHPs str_replace() function; it's simple and should be faster too.
  13. biber, Here's an idea for you. I haven't tried this myself, so no guarantees: Install the TextformatterNewlineBR module. Go to your image field's settings and switch to the "Details" tab. Scroll down and find the textformatters box. Add "Newlines to XHTML Line Breaks" formatter to the image - and make sure it is listed after "HTML Entity Encoder" (if you have that setup on your field.) View your page. Hope that helps. Steve
  14. Try the multiplier fieldtype: https://youtu.be/xahmOuhec-o. It is one of Ryan's ProFields.
  15. Bookmarking: How to setup cloudflare on non www. domains here, as this may come in useful for someone. I haven't tried this out yet, but may soon as my hosting provider only allows cloudflare support on www. domains - something that I'm moving away from.
  16. Whitelisting the allowed email addresses sounds like a good approach to take here.
  17. Bram, I've sent you a PM. I can certainly take a look at your first issue. I've no experience of fredi - so I'll pass on that one, for now. Regards, Steve
  18. Function Following tpr's request here, this module allows Radio Buttons in the admin interface to be deselected. Links Github Module Repository (once moderation has taken place) Version History 1.0.1 Merged tpr's mods 1.0.0 Initial Release
  19. @tewdin, Easy, yes - but not that easy. Please add input sanitisation and return value checks to your code posted above. I think you should also be getting the values from Post input, not from request input. If you have live code like the example you posted, you should probably revise it.
×
×
  • Create New...