Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by godmok

  1. You could use another field, login via email or title, but even then there is the problem: User 1 has password: 123456 User 2 has password: 123456 If you search the same name/email at login and loop with the password on found users, then user 2 could login into user 1 account. This would be bad. The possibility is there to have the same password, and you can login into the wrong user account.
  2. Now it is working. This was a great update! The field is a simple field in a user profile template.
  3. Fields in admin use percent as default width, so I would vote for: checkbox for the default option if to use pixel on input fields, if not set, then use percentage. You can be quite flexible if there is a check for: % em rem px number only and use this as the width value. "Number only" will use percentage or pixel width if option is checked. I am looking at mobile use, too, and pixel are not so fun to use there.
  4. Almost working good, but some troubles: Page: The input field does not show the label name if none is set: Field: set checkbox on "Country Code" and "Extension" is lost, have to activate it again.
  5. Hi everyone, I can't get my head around this, so maybe someone can help: I want to know how install the dev branch of processwire with composer. I use laragon and the "quick create" function and there you can run composer like this: "composer create-project processwire/processwire %s". OK, this is working, so I will get the master branch from it, but how about dev? I found some examples for laravel on this question, but no luck with it. Here some examples: composer create-project processwire/processwire %s --prefer-dist --stability=dev composer create-project processwire/processwire:dev %s composer create-project processwire/processwire:dev %s --stability=dev composer create-project processwire/processwire:dev %s --prefer-dist --stability=dev composer create-project processwire/processwire:dev-master %s --prefer-dist --stability=dev composer create-project processwire/processwire:dev-branch %s --prefer-dist --stability=dev composer create-project processwire/processwire:@dev %s --prefer-dist --stability=dev and so on... Maybe someone got this already and would like to share?
  6. This works! tried it on a development site and will now install the new version of it to live. Update: worked on live site without problems after updating Phone Format Output and my phone field in admin and template file.
  7. Sounds good for me Would definitely use it like this! I tested the field again and changed the fieldtype settings for the "Phone Output Format" under "Modules" -> "FieldtypePhone" and see there, again problems came up. This are my Output Format Options: {+[phoneCountry] }{([phoneAreaCode]) }{[phoneNumber,0,3]-}{[phoneNumber,3,4]}{ x[phoneExtension]} /* Standard North America: +1 (111) 111-1111 x111 */ {+[phoneCountry] }{([phoneAreaCode]) }{[phoneNumber]}{ x[phoneExtension]} /* Alternate North America: +1 (111) 1111111 x111 */ {+[phoneCountry]-}{[phoneAreaCode]-}{[phoneNumber,0,3]-}{[phoneNumber,3,4]}{ x[phoneExtension]} /* Alternate North America: +1-111-111-1111 x111 */ {+[phoneCountry]-}{[phoneAreaCode]-}{[phoneNumber]}{ x[phoneExtension]} /* Alternate North America: +1-111-1111111 x111 */ {([phoneAreaCode,0,2]) }{[phoneNumber,0,4] }{ [phoneNumber,4,4]}{ x[phoneExtension]} /* Standard Australia without country code and with leading zero for area code: (01) 1111 1111 x111 */ {+[phoneCountry] }{([phoneAreaCode,1,1]) }{[phoneNumber,0,4] }{ [phoneNumber,4,4]}{ x[phoneExtension]} /* International Australia with country code and without leading zero for area code: +1 (1) 1111 1111 x111 */ {+[phoneCountry] }{([phoneAreaCode,1,6]) }{[phoneNumber,0,3] }{ [phoneNumber,3,3]}{ [phoneNumber,6,3]}{ [phoneNumber,9,3]}{ - [phoneExtension]} /* International phone number with country code and without leading zero for area code: +49 (111) 123 456 789 012 - 111 */ I have set a line between your examples and mine (last line). I can select the format without a problem, but: If I delete the line break between, then the selection will not change but has as first option "none" (normally there would be the unformatted version). I would suggest to ignore such empty line breaks in the Format Options textarea, but still have the possibility to set them for groups. If I change let's say "phoneNumber,9,3" to "phoneNumber,9,2" in my code (with or without line break), then my format selection is lost and set to unformatted (or "none" as it is first option). Additionally any change in the Format Options field has changed the created field under "Setup" -> "Fields", and there it is set to unformatted/first option. It happens with any changes on the options (adding/removing a block and so on). As I see the <option value=""> under "Fields" uses the Format Option as the value but then loses it after a change. And: the frontpage output is still on the last Output Format Option, means no changes were updated on the frontend at all. It won't change as long as I save the field under "Fields" again with the right Format Option selected. That is OK, but then you have to know that you have to update all fields with this selected option again :/ Hope this helps somehow...
  8. Hi @adrian, sorry for being late. Now the field works like it should. I was just questioning myself if it would be possible to create own formated numbers and output them. I use something like this on the field input: 49 0123 456 789. On the output I remove the zero from 0123 if there is one. Then in the frontend there is a link with "tel:+" and I can't use the unformatted number, because the number is wrong. Output unformatted output: 490123456789. This should be the own created output format: 49123456789. Best would be formated as +49123456789. In the field settings I have set the format with removing the first number, but how can I get this self made output format easy into the frontend? I have created a function for that, but it would be nice to have individual output format names like: $phone->fomatedNumberNoAreaLeadingZero (fomatedNumberNoAreaLeadingZero would be my own set name in the settings, as example), and the output will be from the settings. Would be nice
  9. Hi @adrian, I got an error on line #186 in InputfieldPhone.module. Error comes up on a created phone field. Fixed it by using double underscore. Wrote an issue in github, too. Error (with single underscore): $f->description = _('Whether to ask for extension when entering phone numbers.', __FILE__); Fix (double underscore): $f->description = __('Whether to ask for extension when entering phone numbers.', __FILE__); I got two other issues, too, but can't figure it out how that works: The phone field is in a user template called "person" (have multiple user templates), and if I set a zero at the beginning of the area code, then this zero will not be saved, as long as I write another number to it (after or before the zero). Here some examples: Number 123 -> change to 0123 -> after save: 123 Number 123 -> change to 01123 -> after save: 01123 -> change to 0123 -> after save: 01123 Number 0123 -> change to 00123 -> after save: 0123 Number 0123 -> change to 10123 -> after save: 10123 Number 123 -> change to 0456 -> after save: 0456 -> change to 0123 -> after save: 0123 Best solution for now is to delete the field and set it new. Anther Solution is to change the numbers to something else then change it back. The output on the frontend wasn't changed after the profile update, I had to save/update(select output format) the phone field again, so the output was right again. That was no caching problem, or at least no normal one.
  10. Hi @strandoo, numPageLinks option should be what you want to set. Set it to 999 and it should be good to go without separator. Description: https://processwire.com/api/modules/markup-pager-nav/ numPageLinks: Number of links (integer) that the pagination navigation should have. Default: 10 echo $results->renderPager(array( 'numPageLinks' => 999 ));
  11. Hi @adrian, I didn't read the whole 37 sites, so sorry if this comes up again, but I have a really weird problem: The debugger bar is not shown in one situation. Most of the time it will not show if I do something like this: fill out formular and send (bar is shown before send) check form (same page/template), if ok: forward to another page. at the other page: the bar is not loaded/shown, even after reload and browser cache disabled. waiting for around one or two minutes, then reload the same page: bar is shown. Between point 3 and 4 I can visit other pages and the bar is still not shown. At point 4 the missed dumps and send emails are shown. This is making problems at some pages, that should not be reloaded again. After some minutes the bar is shown again. before there is no visibility, and the div container with the id "tracy-debug" is not loaded/created. The show button is loaded, but hidden and if unhidden then it has no function at all. Is this known?
  12. Looks like an attack on a WordPress site with a small wave. Maybe this is an interesting read for it: https://perishablepress.com/protect-post-requests/
  13. Hi @Wanze, I am trying something like this but am getting into one error. What I am doing is: $markupMain = wireRenderFile( 'partials/pdf_invoice', [ 'invoice' => $invoice ] ); $pdf->markupMain = $markupMain; The error I get is this: PHP Warning: is_file(): File name is longer than the maximum allowed path length on this platform (260): ... I looked into the WirePDF.module file and found out, that a check on the markup is tested with if/else on this steps: $markup instanceof TemplateFile? is_file($markup)? is_string($markup)? Of course my markup is a long HTML string, but check on the markup at point 2 comes up with the warning. PDF is generated, so no problem at this end. Maybe I can ignore this? Oh, and is it possible to update to a newer version of mPDF, so there could be a better PHP 7 compatibility? I tried to just copy the newer version into the folder, but it was not working, so I wonder what to change on the files.
  14. A little help if someone has the same problem: images on develpment site were included, but not on live site. There is no error or any hint, but only a red "x" as placeholder for the image. Try to convert to base64 string included the image to the PDF. For me it even reduced the filesize $imagedata = file_get_contents( "../assets/img/logo-pdf-invoice.png"); // alternatively specify an URL, if PHP settings allow $base64Img = "data:image/png;base64," . base64_encode($imagedata);
  15. @hansv The admin backend is not working with _main.php. What you mean is to set the favicon in the frontend. Jonathans example looks good for me.
  16. just made a little fiddle for you: https://jsfiddle.net/px0pa6uf/3/, hope the code will help you out. I don't know what image you use, so i put the optional @media code for the iPad pro. There you can set a background that is exactly matched for the device width and height. You don't need the JS example for this, I just added it because I don't know how you get the iosVersion value, and maybe it comes helpful for you, but no, it is not needed for this CSS fix. Fixing CSS problems on devices feels like IE fixes all over again...
  17. Just to clarify: background-attachment is not working well on iOS Safary: http://caniuse.com/#feat=background-attachment Here the CSS that can work for the container (did not tried it out, but should work): .background { background-size: 100%; background-image: url('your_background.jpg'); background-attachment: fixed; background-repeat: no-repeat; position: fixed; top: 0; left: 0; height: 100%; width: 100%; z-index: -1; } Additional you can add "bottom: 0;" and "right: 0;" if something is not working. At the end it would look like this in your HTML structure: <body> <div class="background"></div> ... </body> I don't really get why it is not possible with media queries, because you can get the device really easy by some width and height (and other parameter) values that are mostly used for iPad or other devices. Here a link for possibilities: https://css-tricks.com/snippets/css/media-queries-for-standard-devices/ Here is a script from codePen to check the Version of the iOS version (I don't know if you already have this for your iosVersion): and use it in your JS code for variable iosVersion. Then do some JS+CSS ~magic~. Try CSS only (keep it simple), if it is not working (or get too complex for you) combine it with JS if it makes sense. BUT: Please, do not run the scroll position on every scroll to change the position in your inline CSS code. On not so powerful hardware it can hurt the experience of your site. The CSS code should do better. Hope this helps.
  18. Hi everyone, I have a problem with a member site where I put a link in CKEditor field thatshould go to a users profile page. The profile page is a site with one urlSegment, that contains the name of the user from the admin. The structure looks like this: -profiles --username (urlSegment) -some page (CKEditor field with a link to /profiles/username) -admin (PW admin area) --users ---username (user profile) So "some page" has a CKEditor field with a link to a profile page. Now the problem is, that this link source is always changed to the admin path and not the profiles (with urlSegment). A guest user can not look into this. Can this be deactivated, or is it wanted to work like this? My solution now is to create an additional page under "profiles" that is linked by a pagefield in the user profile. So a Link will always link to the "real" page under "profiles". Could there be a easier solution than creating an extra page as there is already one under admin but still let the links in CKEditor untouched? Thanks!
  19. Hi everyone, I looked at the code from the skyscraper demo page and found it really helpful. But on the frontpage I wanted to insert some keywords to the input field and got some mixed feelings about it. The point is: you have to put the exact text phrase into it to get a better result. So the search for "tower located in chicago" has other results (two) than the results for "tower chicago" (two, but different). As I understand is: user will fill in any kind of random words into it and think the search for "tower chicago" has the searched pages for "tower located in chicago" too, because the two words are inside that text too, right? I know the search example is small and a show for beginners, but it hurts on the user experience side, what could result in bad experience. Maybe changing the label "keywords" to something else would be fine and a fast fix? kindly regards godmok
  20. You are right, both page fields were set as 'single' fields, forgot to mention that.
  21. Hi @zervis, you could try $pages->findMany("template=user"); or $pages->findMany("role=user"). I tested this with normal PW users and $pages->find(), but it should work with findMany, too. Another way could be: $pages->find("template=user", ["lazy" => true]) see here for options, but I didn't tested that.
  22. Hi everyone, this is more a note than a question but I also wanted to know if it is wanted to be like that, and I didn't find any Info on this. I had a structure like that: my site has a user-profile page and a PW user. The user has a page field to link it to its profile page. So far so good, but to get some information from the PW user I set a page field into the profile page, so both pages are bound by two lines (profile<=>user). Each line goes in only one direction. What happened after is this: the server run out of memory (allocation?). Seems like the page input fields run in circles. The page was still shown, but broken, with the error at the bottom. The fix was easy: just put one page field into the PW user, link that with the profile and do a $users->find("page_field=$page->id") in the template of the site. Easier done could be to use the $page->createdUser profile value, but that makes it a little more complicated to change at creating the user and profile site. Will do that later on. Many ways to go, I like that the most on PW As I understand this can happen to any pages, so be warned to not combine pages like this. There are better ways. So: is this a wanted logic? Two pages can loop into each other? Are there any security notes on something like this, maybe on the docs? Or something like small notes to DO NOT do something like this or be warned somehow? Thanks!
  23. That hook option would be awesome. It would be my first steps to it, but it looks promising. I will try that, but as it looks like I have to do it the long way, so it will be a form with multiple select and one input field for the search part of the site. When the site is live I will check out the hooks and implement it into the cache field. I will let this topic open and mark it solved when I get it run. Maybe something will happen until then or somebody has another solution for this. Thanks again!
  24. Hi @Robin S, at first there were eight fields and with nine words the limit was set. There were some problems with the cache field so I had to do it that way. Now it is working fine with it and was reduced to two fields for now, and I hit the limit at 88 words, but only because of the restricted limit of the input field with 255 characters. The Limit for the MySQL joints is 61. I will grab the %= LIKE operator again, as in the beginning. I talked to my client and we will do the input field by cache field only. All page fields will be an added filter by a select or checkbox form field for now. As I understand now, the only possibility to get the functionality is by adding all information into a cache field as text, or loop over all words and maybe hit the MySQL limit. Page fields won't work for cache fields. I make just like at the beginning and like @Robin S said: loop over every word and create a long selector. For now the impact is not a big deal. To be honest I think the performance is great! Just seen a little more than 20ms for creating the page at 88 words, still under 200ms in global if the site is generated. Just awesome! It would be nice to get fields from a page field into the cache field optionally, like name, title and so on. Something like a ASM subselector? Maybe anyone has an idea for a search solution, else I will let this topic open for now until I finish this or come up with an solution. Thanks everyone!
  • Create New...