jacmaes

Members
  • Content count

    190
  • Joined

  • Last visited

  • Days Won

    2

jacmaes last won the day on June 28

jacmaes had the most liked content!

Community Reputation

182 Excellent

About jacmaes

  • Rank
    Distinguished Member
  • Birthday 10/05/1973

Profile Information

  • Gender
    Male
  • Location
    Seville, Spain

Recent Profile Visitors

7,316 profile views
  1. Thanks a million, @kongondo ! You pointed me to the right direction. In the end I had to loop through the $all_options as you anticipated. The following works: // get the Select Options Field $field = $fields->get('licences'); // get all the defined options $all_options = $field->type->getOptions($field); foreach($all_options as $licence) { // check 'checked' status $checked = $user->licences->get("id={$licence->id}") ? ' checked': ''; $my_form .= "<label for='$licence->id'> <input name='carnet_de_conducir[]' type='checkbox' id='$licence->id' value='$licence->id' $checked>$licence->title</label>"; } After hours of wasted sleep and overengineered failed attempts, here you come to save the day with this classically elegant and readable PW snippet. I'm so grateful ! Gottta love this forum.
  2. I'm sure it's been asked before on the forums, but I haven't found a relevant answer after multiple searches. I have a form on the frontend that mirrors the user profile on the backend. After logging in, I want the user to be able to edit multiple fields on his or her profile. For simple text entries (e.g. First Name, Street Address, Phone Number or Email), and single options (e.g. radio buttons for Gender: male or female or select dropdowns for a Country list), I have no issue and everything works fine: the user first fills out the form then can go back and update whichever field they want. That's standard profile editing stuff from the frontend. But I hit a roadblock when I want to offer multiple choices. For example, I have a Select Options field set up to show multiple checkboxes for choosing various types of driver's licences. With the following code (edited for brevity): $licence_types = array('B1', 'B', 'A1', 'C1', 'D1'); // same options as defined in my select options field foreach($licence_types as $licence) { $content .= "<label><input type='checkbox' name='licences[]' value='$product'> $licence</label>"; } .... $user->of(false); $user->licences = $licences; $user->save(); $user->of(true); the user can successfully submit this info from the frontend form: But now how do I show them the result of what they submitted when they go back and want to update their profile from the same form? In other words, how do I insert the checked='checked' (or simply 'checked') HTML in the previously selected checkboxes? For example, if they selected the first two options –B1 and B– in the example above, how do I make these two checkboxes ticked? With the following loop, I can show the previously selected checkboxes: foreach($user->licences as $licence) { $content .= "<label for='$licence->id'> <input name='licences[]' type='checkbox' id='$licence->id' value='$licence->id' checked>$licence->title</label>"; } How do I merge the two loops so that they see this, as expected: Maybe with in_array()? Any help would be greatly appreciated.
  3. I'm wondering the same thing... Seems strange coming from such a dedicated team.
  4. You should be able to use the "data-uk–*" prefix and have it pass the HTML validation. See the docs here, under the "Component usage" heading: https://getuikit.com/docs/javascript I understand that according to the spec, HTML5 custom data attributes should be prefixed as such, with "data-*": https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*
  5. Like @Falk and @Macrura I sometimes have the same, forever-spinning loading behavior, especially with images that are at least larger than 3000 pixels.
  6. I've used the code on this tutorial for at least 4 or 5 sites, and it's rather easy to tweak for your needs. (You can pay for the full source code if you want to reward the developer for his work, but you don't have to: you can copy and paste the various parts needed).
  7. @Macrura thanks, I can confirm that I no longer have the issue after downloading the module from Github manually.
  8. @Macrura @Peter Knight so we have a pattern. I'm not the only one experiencing this issue then.
  9. @horst Yes, I've refreshed the modules a couple of times, and I've made sure to clear the cache (browser cache + "cache" folder in "assets"). I've tried on three different sites that are very similar, and same problem. @adrian Upgrading PW is indeed the only thing I did. Reverting back to the master branch fixes the issue immediately. My field setting is as such: And I'm calling the image this way: <img alt="<?= $page->title; ?>" src="<?= $page->image->first->getCrop('landscape')->url; ?>">
  10. Anyone using this module with the latest dev (3.051)? After updating from the master branch (3.042 at the time of writing), it no longer points to the full URL of the crops, i.e. URL in Master: "/site/assets/files/9168/death-of-a-fisherman.675x0-landscape.jpg" Truncated URL in Dev: "/site/assets/files/9168/" A modules refresh hasn't fixed this issue.
  11. Regarding the email validation, it works great... except when my client tried in on his fully updated iPhone 5, and somehow the session gets lost when he clicks on the link in the activation email he receives: he ends up with the initial default form (username + email), and he's stuck in a loop. I've been trying to reproduce it, but to no avail. He's using Safari, and not in Private Mode (which by the way does break the activation). Have you any of you guys run into this issue? Or have any clue what could be happening? Thanks in advance.
  12. I'm getting the following error on PW 3.045: Error: Uncaught Error: Call to a member function of() on boolean in /home/my-domain/public_html/site/modules/PasswordReset/PasswordReset.module:187 Stack trace: #0 /home/my-domain/public_html/site/modules/PasswordReset/PasswordReset.module(235): PasswordReset->resetPassword() #1 /home/my-domain/public_html/site/templates/password-reset.php(3): PasswordReset->controller() #2 /home/my-domain/public_html/wire/core/TemplateFile.php(268): require('/home/my-domain...') #3 /home/my-domain/public_html/wire/core/Wire.php(374): ProcessWire\TemplateFile->___render() #4 /home/my-domain/public_html/wire/core/WireHooks.php(682): ProcessWire\Wire->_callMethod('___render', Array) #5 /home/my-domain/public_html/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #6 /home/my-domain/public_html/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) (línea 187 de /home/my-domain/public_html/site/modules/PasswordReset/PasswordReset.module)
  13. Ah, there's light at the end of the tunnel. Those annoying cookie banners required by a misguided 2012 European law might soon disappear. One less thing to implement...
  14. @szabesz you'll need to remove the line that I added to block attempts to scan Wordpress, or you won't be able to login: RedirectMatch 403 (?i)(wp-admin|wp-content|wp-login) But you can basically copy and paste from from the code from the original site: https://perishablepress.com/6g/
  15. @Macrura Here's what's above the PW directives in my .htaccess. Notice that I'm pointing explicitly to a 403 html file, right below the 6G directives: ErrorDocument 403 /403.html Start of .htaccess: # 6G FIREWALL/BLACKLIST # @ https://perishablepress.com/6g/ # 6G:[QUERY STRINGS] <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{QUERY_STRING} (eval\() [NC,OR] RewriteCond %{QUERY_STRING} (127\.0\.0\.1) [NC,OR] RewriteCond %{QUERY_STRING} ([a-z0-9]{2000}) [NC,OR] RewriteCond %{QUERY_STRING} (javascript:)(.*)(;) [NC,OR] RewriteCond %{QUERY_STRING} (base64_encode)(.*)(\() [NC,OR] RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\[|%) [NC,OR] RewriteCond %{QUERY_STRING} (<|%3C)(.*)script(.*)(>|%3) [NC,OR] RewriteCond %{QUERY_STRING} (\\|\.\.\.|\.\./|~|`|<|>|\|) [NC,OR] RewriteCond %{QUERY_STRING} (boot\.ini|etc/passwd|self/environ) [NC,OR] RewriteCond %{QUERY_STRING} (thumbs?(_editor|open)?|tim(thumb)?)\.php [NC,OR] RewriteCond %{QUERY_STRING} (\'|\")(.*)(drop|insert|md5|select|union) [NC] RewriteRule .* - [F] </IfModule> # 6G:[REQUEST METHOD] <IfModule mod_rewrite.c> RewriteCond %{REQUEST_METHOD} ^(connect|debug|delete|move|put|trace|track) [NC] RewriteRule .* - [F] </IfModule> # 6G:[REFERRERS] <IfModule mod_rewrite.c> RewriteCond %{HTTP_REFERER} ([a-z0-9]{2000}) [NC,OR] RewriteCond %{HTTP_REFERER} (semalt.com|todaperfeita) [NC] RewriteRule .* - [F] </IfModule> # 6G:[REQUEST STRINGS] <IfModule mod_alias.c> RedirectMatch 403 (?i)(wp-admin|wp-content|wp-login) RedirectMatch 403 (?i)([a-z0-9]{2000}) RedirectMatch 403 (?i)(https?|ftp|php):/ RedirectMatch 403 (?i)(base64_encode)(.*)(\() RedirectMatch 403 (?i)(=\\\'|=\\%27|/\\\'/?)\. RedirectMatch 403 (?i)/(\$(\&)?|\*|\"|\.|,|&|&amp;?)/?$ RedirectMatch 403 (?i)(\{0\}|\(/\(|\.\.\.|\+\+\+|\\\"\\\") RedirectMatch 403 (?i)(~|`|<|>|:|;|,|%|\\|\s|\{|\}|\[|\]|\|) RedirectMatch 403 (?i)/(=|\$&|_mm|cgi-|etc/passwd|muieblack) RedirectMatch 403 (?i)(&pws=0|_vti_|\(null\)|\{\$itemURL\}|echo(.*)kae|etc/passwd|eval\(|self/environ) RedirectMatch 403 (?i)\.(aspx?|bash|bak?|cfg|cgi|dll|exe|git|hg|ini|jsp|log|mdb|out|sql|svn|swp|tar|rar|rdf)$ RedirectMatch 403 (?i)/(^$|(wp-)?config|mobiquo|phpinfo|shell|sqlpatch|thumb|thumb_editor|thumbopen|timthumb|webshell)\.php </IfModule> # 6G:[USER AGENTS] <IfModule mod_setenvif.c> SetEnvIfNoCase User-Agent ([a-z0-9]{2000}) bad_bot SetEnvIfNoCase User-Agent (archive.org|binlar|casper|checkpriv|choppy|clshttp|cmsworld|diavol|dotbot|extract|feedfinder|flicky|g00g1e|harvest|heritrix|httrack|kmccrew|loader|miner|nikto|nutch|planetwork|postrank|purebot|pycurl|python|seekerspider|siclab|skygrid|sqlmap|sucker|turnit|vikspider|winhttp|xxxyy|youda|zmeu|zune) bad_bot # Apache < 2.3 <IfModule !mod_authz_core.c> Order Allow,Deny Allow from all Deny from env=bad_bot </IfModule> # Apache >= 2.3 <IfModule mod_authz_core.c> <RequireAll> Require all Granted Require not env bad_bot </RequireAll> </IfModule> </IfModule> ErrorDocument 403 /403.html <FilesMatch "\.(js|css|html|htm|php|svg)$"> SetOutputFilter DEFLATE </FilesMatch> <ifModule mod_headers.c> Header set Connection keep-alive </ifModule> # ---------------------------------------------------------------------- # Expires headers (for better cache control) # ---------------------------------------------------------------------- <IfModule mod_expires.c> ExpiresActive on # Your document html ExpiresByType text/html "access plus 0 seconds" # Data ExpiresByType text/xml "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType application/json "access plus 0 seconds" # Favicon (cannot be renamed) ExpiresByType image/x-icon "access plus 5 days" # Media: images, video, audio ExpiresByType image/gif "access plus 1 week" ExpiresByType image/png "access plus 1 week" ExpiresByType image/jpeg "access plus 1 week" ExpiresByType image/webp "access plus 1 week" ExpiresByType image/svg+xml "access plus 1 week" # HTC files (css3pie) ExpiresByType text/x-component "access plus 1 month" # Webfonts ExpiresByType application/x-font-ttf "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType application/x-font-woff "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" # CSS and JavaScript ExpiresByType text/css "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" </IfModule> ################################################################################################# # START PROCESSWIRE HTACCESS DIRECTIVES # @version 3.0 # @indexVersion 300 ################################################################################################# ....