-
Posts
2,233 -
Joined
-
Last visited
-
Days Won
47
Everything posted by netcarver
-
Is it possible to show a page table only if there are items in it?
netcarver replied to Juergen's topic in General Support
Does using this test work? if (count($wrapper->singleeventtable->attr("value")) === 0) { It may not, just guessing at the moment. -
Is it possible to show a page table only if there are items in it?
netcarver replied to Juergen's topic in General Support
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. -
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.
-
FieldsetTabOpen not visible for non-super user
netcarver replied to kiennguyen1101's topic in General Support
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? -
PW 3.0.15: New quick-tree, debug, view panels and more
netcarver replied to ryan's topic in News & Announcements
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. -
FieldsetTabOpen not visible for non-super user
netcarver replied to kiennguyen1101's topic in General Support
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 -
Module Lumberjack - Simple IP / User Agent logger
netcarver replied to GuruMeditation's topic in Modules/Plugins
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. -
PW 3.0.15: New quick-tree, debug, view panels and more
netcarver replied to ryan's topic in News & Announcements
@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. -
Module Lumberjack - Simple IP / User Agent logger
netcarver replied to GuruMeditation's topic in Modules/Plugins
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. -
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.
-
Module Lumberjack - Simple IP / User Agent logger
netcarver replied to GuruMeditation's topic in Modules/Plugins
@GuruMeditation Thank you for the module - and welcome to the wonderful world of "official" module authorship! -
My replace Textformatter does not work. Please help
netcarver replied to dotnetic's topic in General Support
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. -
Nice try, tpr!
-
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
-
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.
-
how could i send to different receipent on same enquiry form
netcarver replied to adrianmak's topic in General Support
Whitelisting the allowed email addresses sounds like a good approach to take here. -
Merged. Thanks tpr
-
Looks like we have a working solution to Bram's FormBuilder issue.
- 8 replies
-
- 8
-
- FormBuilder
- textarea
- (and 8 more)
-
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
- 8 replies
-
- FormBuilder
- textarea
- (and 8 more)
-
@Bram, Are either of these issues solved yet?
- 8 replies
-
- FormBuilder
- textarea
- (and 8 more)
-
Like this?
-
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
-
Which is the easiest way to setup an simple contact form?
netcarver replied to tires's topic in General Support
@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.