Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

6 Neutral

About chuckymendoza

  • Rank
    Jr. Member

Profile Information

  • Gender

Recent Profile Visitors

1,354 profile views
  1. This solves my problem! Added max_input_vars = 10000 to the php.ini THANK YOU VERY MUCH, you made my day! Have a nice day, Thomas
  2. Hello together, I have a problem with the image field and in my case it seems that there is a limit of how much images can be in such field. The following case: I have around 20 pages. Each has a usual image field, where I can upload an unlimited number of images (array). Most of the pages got 50-200 images but one page got 411 images (I know, it’s much ) Now, when I change the order of one image (let’s say I drag & Drop the first image after the third) or delete one image by clicking on the trashcan, everything runs fine. BUT when I click SAVE the image won’t be deleted or moved to it’s new place. You can change anything else on the page - I have a text field there - and save it, no problem. Interestingly I can add (upload) new images but I’m not able to delete or move them. - The file size of the images are between 200kb and 1.7MB, RGB, JPGs. - When I duplicate the page and try to delete/move I got the same problem. - I also created a whole new page and got the same problem - Also tried a different server (virtual and online): same problem - ProcessWire 3.0.62 So, is there a limited to the images field? Any clues except limiting the image files to max. +-200 images? Thanks so much in advance and have a great weekend. Thomas
  3. So easy and it works! Thanks a lot, adrian! This makes my day.
  4. Hello together, this might be a newbie questions, but I got some problems with a PageArray and don’t know how to go on. My goal is give out the parent.name of a page that was found earlier and was put into a PageArray. My found pages: $matches = $pages->find($selector); Some of the pages that are present in $matches need to be put into a new array $the_page_array. I do this via a this foreach loop, but I do not foreach($matches as $match) { if ($match==condition_blah_blah) { $the_page_array[]=$match; // if condition true, then add pages to new array } } From here, I can print out some stuff, e.g. my parent.name of the $single_page: foreach($the_page_array as $single_page) { echo „<a target='_blank' href='$single_page->url'>$single_page->title</a> "; echo $single_page>parent->name; } So far so good. But from here I want to find some pages in the PageArray that have a given parent.name: $filtered_matches = $the_page_array->find(„parent.name=blahblahblah"); But this gives out an error: Error: Call to a member function find() on array In fact, I can use any PageArray function like $filtered_matches = $plz_page->getTotal(); and I get the same error. I believe this has something to do that $the_page_array is an PageArray (or not)? Any help or hint would be wonderful. Thanks in advance Thomas
  5. Hello together, I have the following search routine to find pages containing one or more ZIP codes. postleitzahlen.plz is the selector and is a repeater.value The following code works fine and finds all pages that contain the (German) ZIP codes in my test string $p_test $p_test="40489|40822|40878|40880|40882|40883"; $selector = "template=print, title|job_body|job_body_2|job_body_3%=" . implode("|", $suche_1) . "; $selector .= ", id=[postleitzahlen.plz=".$p_test."]"; $matches = $pages->find($selector); My problem is, I do not have 6 numbers in $p_test, I have a lot more. In the worst case scenario I could have around 1500 ! If I have more then 80 numbers in my $p_test I got an error message: Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? Is there a limit in having too much selectors? Thanks, Thomas
  6. Guys, this is wonderful and so simple. I love PW! !title%=nyc works like a charm! In my case I needed to exclude not only from the title but also from some more fields, my thoughts, that this would work were wrong: !title|job_body%=word_to_exclude Instead someone must use: !title%=word_to_exclude, !job_body%=word_to_exclude It is possible to unify this, or is it the way PW works?
  7. Hello together, currently I’m working on some kind of enhanced search for pages->find in the FRONTEND and I like to ask if someone has a possible solution or hint on how to build it. My problem is, I like to add search strings with a "+" or "-" in front of word and tell PW what to search and what not based on the input of the user. Example: Let say I have the following page tree Airports — NYC, USA — Miami, USA — Tokyio, Japan — Berlin, Germany Let’s say that all pages have more then one body text field but in one of them is a text that contains the words "Airport" and "Air-condition". User enter the following text into an input field: Airport air +USA -nyc My preferences are: 1) find all Airports (or cities) with the word Airport or air in the title OR in the body text of the pages, also find part of the words like fair or air-condition 2) Filter the results of 1) and find only pages with the word USA inside 3) Filter the results of 2) and show only (exclude) the results with a word like nyc As the result only Miami, USA will be displayed, because it got USA and NOT nyc and in the body text are the words Airport and air-condition. For 1) I used the code (see below) from @Mats suggestion https://processwire.com/talk/topic/10883-search-with-and-string/ It searches part of words in the title and body with OR. But what I’m looking for is, how can I search for pages that have the search term AND the term with a "+" before. It finds me Airport but it should only find Airport if +USA is inside title of body text. And of course, how it is possible to exclude a word, for example with a "-" before the search term. In spoken language it would be: Find anything with Airport or air. Show only results containing the word USA and exclude anything from the results with the word nyc. In general, is it possible to exclude something from the search in pages->find and what could be a good start to code such a search function? Thanks so much in advance! Thomas if($q) { $input->whitelist('q', $q); $qs = explode(" ", $q); foreach($qs as $key => $q){ $qs[$key] = $sanitizer->selectorValue($q); } $selector = "template=print, title|body|body_2|body_3%=" . implode("|", $qs) . ", limit=50"; $matches = $pages->find($selector); }
  8. Hi, thanks for the answer.
  9. Hello together, I had a deeper look into the forum but didn’t found anything, so I like to ask the following simple question. Is there a module or a simple technique to export all users from the backend into a file? Afterwards, it should be possible to import the users again. I have a ProcessWire installation on a dev server and I don’t like the idea to add all users again by hand on the live server Thanks so much for your ideas. -Thomas
  10. Hmm, forgive me, but that is above my head.
  11. I do not like to cross-post here from https://processwire.com/talk/topic/8605-user-editsaddsmove-only-his-own-page/ because it deals with another problem but as part of finding a solution to my problem by using the module of @adrian I discovered a problem when a user enters a name of a page he don’t have access to in the search field of the backend. Example: user 1 enters "Blau" in the search field. user "Max Muster" also have a page named "Blau". So, in the search results both pages are visible and can be edited by user 1. The search results looks like this: @guenter55 : maybe I’m missing something or I have a different configuration but how do you deal with that kind of (security) problem? Thomas
  12. Hi, finally I had some time to test @renobird modified version of PageEditPerUser and also @adrian HideOtherUserPages modules for my problem. I like to describe my process here for others that deal with the same problem. First “solution”: Modules used: PageEditPerUser 0.0.3 HiddenAdminPages 1.0.0. All users got the same two roles (thanks @renobird for the tip) Roles: editor (edit, add, (but not) delete) editor_sub (edit, add, delete) Because of the installed HiddenAdminPages I can restrict pages for each user. Disadvantage: The more pages/user the site has, the more work it is to restrict pages for a new user. Second “solution”: Modules used: PageEditPerUser 0.0.3 HideOtherUserPages 0.0.1 (Same roles as first solution) As long as the page the user needs to edit got the same name (Page = user-1 , User = user-1) he or she can just edit his own pages, regardless where they are located Pro: Unlike the first solution, you do not need to add pages to a restriction list. This works better if you deal with a lot of pages. Disadvantage: A Parent page needs to named after the user. For me this solution is okay. Third “solution”: As I mentioned in one of my earlier posts, a solution without any modules would be to have a template for each user and a role for editing just this template. No modules used Pro: Well, it works. ;-) Disadvantage: When you deal with, let say, 50 users, you also need 50 roles and 50 templates. A little bit confusing in the template/roles area. I guess you probably also have 50 files in the site folder on the server? You have to optimize/prepare your templates before you add them to processwire to be aware of future changes inside the template files. Big problem: So far all three solutions would work somehow, and I would prefer solution 2 for my problem but I discovered a new “problem” with solution 1+2. I had a test what happens when user 1 enters the name of user 2 in the search field of the backend. Processwire finds the Parent page and shows an “edit” in the search results. The same happens when user 1 enters a name of a child page that is only visible to user 2. Example user 1 enters "Blau" in the search field. user "Max Muster" also have a page named "Blau". So, in the search results both pages are visible and can edited by user 1. As a result when user 1 knows how the pages of user 2( or any other user) are called, it’s easy to find them and edit them. I got tears in my eyes. ;-) As solution 1+2 works for me somehow both are not usable from the view of security. Maybe I did something wrong here, not sure. The easiest way would be to restrict the search in the backend to just the pages the user can edit (as part of the modules of solution 1 or 2). Any thoughts on that? Thomas
  13. Hi renobird, first a big thank you for the module. I’m honest and must say, that I didn’t find the time to test it because I need to finish another project first. But, i definitely will test it and will come here and keep you updated. Anyway, a big thank you for the module! Cheers, Thomas
  14. Wow, that sounds like the solution to my problem. Okay, here is a reminder: reminder! ;-) Thanks renobird!
  15. Hello, thanks for your help! At first it sounds like a good solution, but considering that Page 1 and Page 2 are using the same template it could be difficult. User 1 is still able to edit Page 2 not only his own page, Page 1. Okay, the HiddenAdminPages module could help to just show User 1 his Page 1 plus Subpages, but considering that I not only have 2 pages but rather 50 pages and 50 users it takes a lot of work since I need to select all pages that must be hidden for each user. It would be a lot of work if I have 100 pages / 100 users and need to just add one more user, so I need to select all 100 pages for that new user not to be visible. Another theoretical solution (I didn’t tried that out yet) would be to have a template for each user, even if they look the same, means: Page 1 (Template 1) - Children 1.1 (Template 1-Child) Page 2 (Template 2) - Children 2.1 (Template 2-Child) User 1 got Role 1. User 2 got Role 2. Role 1 got access to Template 1 only. Role 2 got access to Template 2 only. That in mind, with 50 users we got 2 x 50 Templates (Parent + Child) with 50 Roles. At all it would be easier to set that up when I need to add a new user, but in the end you have a lot of templates and roles. Hmm...
  • Create New...