Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by strandoo

  1. Hi @flydev My, that was quick! I did put this in my ready.php file, but don't see a captcha. Do I need to include your '$captcha = $modules->get("MarkupGoogleRecaptcha");' on the page? (I've tried it both ways). I've also tried this $f->markupText = 'Foobar'; (instead of your module) and 'Foobar' appears above the submit button, as expected.
  2. Hi @flydev. Great module. I'm using it on a custom form. I'd like to add it to an existing site where I've used Ryan's Form Template Processor module. (It's a long form; I'd rather not start from scratch). I've had a look at what you did with the log in form above; would I take a similar approach? Is there an easy way to slot the Captcha form in before the submit button (instead of outside the generated form)? I'm pretty new to hooks, if that's what's needed. Any suggestions appreciated.
  3. @kixe Thanks for the update. I'll check it out. @Can I'll pass for now, but thanks for the module.
  4. Hi. Nice module, seems to work pretty well. A few suggestions about configuring/customising. I like to keep my css files to a minimum, so I'd like to move the styles to my site css file (rather than inserting it after the first <link>). But when I untick the 'inject modules stylesheet?' option, it removes classes from the markup and hides the top/bottom, dark/light options. How about keeping these options available and just letting the user know that the css must then be manually added to a stylesheet? I've done modified my installation to do that and it works well. Also, when I've changed the class prefix in the config file, I had to still manually change one class: I changed Line 104 of the module.php file from $cookieConsentForm .= "<p class='mCCF__message'>"; to $cookieConsentForm .= "<p class='{$classPrefix}__message'>"; You may want to update that. Thanks again for the module.
  5. Update: a couple of days later, the problem returned. I contacted support for this account and after a bit of back and forth, I gave up. I took a look at the hosting Plesk cp and saw that mod_sec is turned off. The PHP version was 5.3 (I'm pretty sure I had it at 5.6) so I changed it back to 5.6. I'm basically back where I started. Maybe I'll move the account to my reseller hosting. Everything works fine there...
  6. So, as PWaddict predicted, turning off mod_security did the trick, but I couldn't do it with the htaccess rule. I tried that first, but it didn't do anything, so I disabled it in the Plesk control panel. (It's under 'Web Application Firewall..'; I've set it to 'detection only' rather than 'on' or 'off'. If anyone knows of a downside to this or if I can target something more directly, please let me know). But the video now appears as it should. Thanks all.
  7. Ah, I should have mentioned that. Since this is alive site, and that's an upcoming gig, I needed a workaround. I'm not using the module there, just a special field that inserts the YouTube URL in an iframe. I prefer the responsiveness of Ryan's module. @netcarver I've run into that problem in the past, so I've checked. All clean text. @PWaddict That sound promising. I've had problems with mod_security before. I'll try it out a bit later today. Last night I created a local version of the site and the videos loaded fine, leading me to think it's a hosting/php/config thing.
  8. @artaylor I've tried different URLs with similar results. I just tested the embed URL and that didn't work. And as @adrian pointed out, but short form does work (on the 'good' site). I checked other text formatters to make sure they didn't conflict. One thing I just thought of is that they are served from different hosting companies (StableHost vs HostingUK) so differing server configs could be in play...
  9. Hi all. This has been driving me nuts: I've used this module previously and it worked perfectly. I've got it on 2 sites, but music-related. One works normally; I use the textformatter on the body text and videos display fine. The other only works if it's a Vimeo video; YouTube URLs slow the page loading then only displays the URL. I've tried a number of tests and different URLs and I can't figure this out. Both sites are not new and I'm pretty sure that it used to work where now it doesn't. Here are two samples (they are past gigs, so I can play around with them without messing up the live sites): Works: https://waveneyvalleyfolkcollective.co.uk/events/kirsty-merryn-jack-harris/ Doesn't Work: http://www.burstoncrown.com/events/sunday-sessions/falling-from-trees/ Any suggestions?
  10. As a follow-up: I had the same problem and tried everything – including the one recommended by prestoav. I am developing 3 sites running on a FastHosts reseller account. All running PW 3.0.42 on php 5.6. One is on an older server and had no problems uploading images. The other two are on their newer 'cluster' servers and those were the sites with problems uploading. Long story short, the FastHosts support investigated and said that turning debug OFF in the site config file would solve the problem. Sure enough, that's fixed the problem. I don't know if it is a problem with PW, FastHosts servers or what, but if anyone encounters this problem, it's worth checking your debug setting.
  11. Thanks, Macrura. I just read that post and I like the idea of using selectors as arrays. I might try that after I redo my code the 'normal' way. My script works as is (with out using brand.name) because my input IS the brand name, not the page id... if I understand correctly. But I see from that post that maybe I should use the ID and do as you suggest. After my original post, I used rtrim for something else then slapped my head for not trying it here. Then I just need to read up on whitelists... Cheers.
  12. Hi all. I'm building a product search page with a filter consisting of selects and checkboxes. It's based on Ryan's excellent Skyscraper demo, but I'm trying to add multiple checkbox fieldtypes. I've got it working, but it's not very elegant and I'm sure there's a better way to do it. Given the following checkboxes: [x] Adidas (15) [ ] Asics (10) [x] Nike (20) If only Adidas is checked, 15 shoes will be found; if both Adidas and Nike, 35 shoes will be found. The form field: foreach($pages->get("/brands/")->children() as $brand) { $selected = $brand->name == $input->whitelist->brand ? " checked='checked' " : ""; echo "<label><input $selected type='checkbox' name='brand[]' value='{$brand->name}'> {$brand->title}</label>"; } Here's what I've got for the select, based on the Skyscraper search: $selector = ''; ... if($input->get->brand) { $brands = $input->get->brand; $selector .= "brand="; foreach($brands as $brand) { $value = $brand; $selector .= "$value|"; $input->whitelist('brand', $value); } $selector .= ", "; } ... $selector = "template=product-page, limit=24, " . trim($selector, ", "); This sort of works (although pagination doesn't work because I don't know how to do the whitelist part -- bonus question!). The correct results are returned, but an echo of the selector string looks weird: "template=product-page, limit=24, brand=adidas|nike| " (there's a trailing pipe character that I don't know how to remove). Is there a better way to do this? Thanks in advance.
  13. Thanks for the suggestions. I did do a fresh install with the default theme to a subfolder on the same server. No extra modules, no new pages. Same thing: fast/normal when logged into the admin; sloooooow when not. I did get another warning about 'Warning: set_time_limit() has been disabled for security reasons', so I'll probably contact the hosting company and see if they can suggest anything. I'd like to be able to set a time limit, just to rule that out; I can do it in htaccess for php5, but I can't figure out how to do it for php 7. I can work around the issue by reverting to php 5, but that's not great.
  14. Hello. I've come across strange behaviour under the following situation. Maybe someone can explain what's happening? PW 3.0.42 running on a FastHost php 7 server. Initial page loads have about a 6 second latency! At first I thought I had some bad code, but I stripped everything back to the most simplest of pages, still with a huge loading delay. Once I log in as a superuser, the pages load normally (150-200ms). This was happening on at 3 sites. All pages had a latency of about 6 sec. until I logged in to the admin panel. I also have one or two PW 3 sites running on an older php5.6 account, which runs normally. I downgraded one of the php 7 sites to php 5.6 and the pages loaded normally. One more thing that may or may not be related: I did get an error "WARNING: SET_TIME_LIMIT() HAS BEEN DISABLED FOR SECURITY". That took me down a path of setting the max_execution_time in .htaccess. Which also inspired me to downgrade from php7 to 5. The curious thing is how signing in as a superuser solves the problem. Thanks. - Paul
  15. Ok, I got it. It turns out it's because this particular site is still using php v5.3.x which doesn't like the "Array Initialization Construct: []" I've worked around it by using "array(" instead: $result = $MailChimp->post("lists/$list_id/members", array( 'email_address' => $page->email, 'status' => 'subscribed', )); Cheers, Paul
  16. Hi @benbyf. Well, I first got the error when I tried to install the module, so I never got far enough to enter a List ID (or any other settings). I then commented out lines 73-76 (and 82-85 when I got the same error) and was able to install the module and insert API and List ID. But when I uncommented the lines, I get the same error.
  17. Hi. I'm trying to install the WireMailChimp module, but I'm getting an error when I install: "parse error (line 73 of /Users/paul/Sites/pw-projects/site/modules/WireMailChimp/WireMailChimp.module)" I'm using PW 2.7.2. Any ideas why?
  18. (Slaps forehead) Thanks godmok. I read that page and looked through the list of options, but somehow missed that. Cheers.
  19. Hi. I've got a client that wishes to see all the page links in the rendered pagination, without the separator (...). Is this possible? I know the page links may get reeeeally long, but that's what he wants. I know there are optional arguments that can be passed to renderPager(), but I can't see one for removing the separator. Any suggestions folks?
  20. Thanks ukyo, that was quick! That looks pretty straightforward and it makes perfect sense. I'll give it a shot.
  21. Hello all. I'm planning a site that will include 5 languages. Processwire looks perfect for this. From what I can tell, the 'normal' behaviour is to have different urls for each language. But rather than having 5 parallel 'sites', each with a different language, my client needs to have each of the 5 languages displayed on the same page. The site is mostly in english, but news posts will be multi-lingual and appear together on one page, one after another. Is this possible? Does anyone have any suggestions for the best way to achieve this? Thanks in advance.
  22. UPDATE: I just tried Kiwi Chris's code and it worked fine for me. I had previously used $this->contact->get($field->name->title) instead of this $this->contact->get($field->name)->title which worked.
  23. Hi Kiwi Chris. Did you ever solve this? I've got the same problem and have tried similar things with no luck. Any enlightenment would be useful. thanks.
  24. Thanks, Robin S! I'm using neither Page Fields nor the FormBuilder, but (relatively new) Options Field Type. But I just did a test with a Page Field to get my head around your code, and I think I get it. I've also read up on the Options field type and will take a stab at putting something together. Thanks for pointing me in the right directions.
  25. Hi Folks, I've got a site with some contact and quote forms which get sent to my client and get saved as pages so the client has a record of the submitted forms. He'd like to analyse some of the form data. So for instance, there's a field that asks 'where did you hear about us?' with select options like 'Advertisement', 'Google', 'Recommendation', 'Magazine', etc. I'd like provide a page so the client could see how many respondents chose 'Google' vs 'Advertisement', etc. A simple tally would be fine, but then I could calculate percentages, maybe chart the results, etc. My first thought was to use $pages->count('selector') to count the pages with a certain answer. I'd know what percentage that was by comparing it to the total of saved pages for that form. But would I need to do this for each question? Is there a better way to tally/count all the answers for a given field?
  • Create New...