Jump to content

chuckymendoza

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by chuckymendoza

  1. I believe it could be a problem with the Hosting Service and the security settings applied by them. Let me explain: I have a lot of clients where I update the ProcessWire Master with the Upgrades module without any problems. Upgrades of ProcessWire Master and Dev Versions, including the latest versions, are show on the Upgrades page. But there are also some clients, who use the German Hoster Strato.de. Maybe it's something with the Hosters security settings, but I never see any Updates regarding the ProcessWire versions? I can only see possible updates of modules. So I always have to udpate manually by FTP.
  2. Thanks a lot, that’s a good tip, I will have a deeper look at! Thomas
  3. Ah, okay, I see. Okay, good to know, that I didn't made any mistakes in my implementation. Would be nice to see your AJAX-Search working with RockPageBuilder too, in the future. ? Thanks for the quick response, Thomas
  4. Hello and many thanks for this tutorial. I adapted it to my site and it works great. There is one thing. I tried to search some content that is inside a Repeater Matrix field, but it seems, this isn't possible so far? I have a Repeater Matrix field on every page, where I can add a text field, a headline, an image field, and so on. The search routine wasn't able to find anything, that's inside it. I believe it's not that simple to just add the Repeater Matrix field to the search_cache field, regenerate the cache and be ready, since I already tried that out. ? So, I'm a little bit clueless what needs to be changed in the code to work with Repeater Matrix too. Any suggestions? Thanks so much, Thomas
  5. Yes, THANKS A LOT! This gave me the crucial hint! This is the code that worked for me: $happynewyear = $pages->new("template=program_jahre, parent=/programm/archiv/, name=$jahreszahl"); $happynewyear->setOutputFormatting(false); // disable output formatting $happynewyear->of(false); // disable the output formatting API $langObjDE = $languages->get("name=default"); // Get the language object for the default language $langObjEN = $languages->get("name=english"); // Get the language object for the second language $happynewyear->setLanguageValue($langObjDE,'name',$jahreszahl); // set name of page for default language $happynewyear->setLanguageValue($langObjDE,'title',$jahreszahl); // set title of page for default language $happynewyear->setLanguageValue($langObjEN,'name',$jahreszahl); // set name of page for second language $happynewyear->setLanguageValue($langObjEN,'title',$jahreszahl); // set title of page for second language $happynewyear->setLanguageValue($langObjEN,'status',1); // set status of page for second language to active $happynewyear->save(); // save
  6. I may have a simple problem, but I can't find a solution, yet. I have a multilanguage Website and like to create a new page via the API with $pages->new The names of my languages are "default" and "english" ("en" in my environment) What I want: set the title of each page the same, in the default and on the English page. I already have set the name identical for both languages with: $happynewyear->set('name', $jahreszahl, 'default'); // set the name for the default language $happynewyear->set('name', $jahreszahl, 'en'); // set the name for the en language And this code works. Problem: this seems not to work with the title of the pages. (Page Title (Multi-Language) is activated When I visit the default site, the title is set correct, but not for the english page. And when I visit the english page first, the title is set correct for the english page, but not for the default page. Am I missing something? Thanks for your help in advance! -Thomas $happynewyear = $pages->new([ 'template' => 'programm_jahre', 'parent' => '/programm/archiv/', 'name' => $jahreszahl ]); $happynewyear->set('name', $jahreszahl, 'default'); // set the name for the default language $happynewyear->set('name', $jahreszahl, 'en'); // set the name for the en language $happynewyear->set('title', $jahreszahl, 'default'); // set the title for the default language $happynewyear->set('title', $jahreszahl, 'en'); // set the title for the en language $lang="english"; // $lang is the language you want to set as active, e.g. 'english' for French $langObj = $languages->get("name=$lang"); // Get the language object for the second language $happynewyear->set("status$langObj", 1); // Set the status of the page's second language to active $happynewyear->save("status$langObj"); // Save the page with the second language status set to active
  7. This would be wonderful to get new, working module @patman I think, others will get the same problems if they switch to PHP8.1 sooner or later. It seems, please correct me if I'm wrong, that the module is no longer maintained. I don't know, how others solve the problem with spambots crawling for emails, but I really would appreciate, if someone could update the module, or create a new one? ? Thanks so much, also, for the tips on solving the errors. Thomas
  8. Hi @Roope I get the following error message by using a server with PHP 8.1 on all pages, that DO NOT include an email: Deprecated: is_nan(): Passing null to parameter #1 ($num) of type float is deprecated in ... FileCompiler/site/modules/EmailObfuscation/EmailObfuscation.module on line 248 When I switch back to PHP 8.0 (or lower), everything seems to be fine. (ProcessWire 3.0.200, EMailObfuscation 1.2.5) -Thomas
  9. Easy solution! If you want load an XML file like this one: <?xml version="1.0" encoding="UTF-8" ?> <EXAMPLE> <job> <jobTitle>A title 1</jobTitle> <company>Company 1</company> </job> <job> <jobTitle>A title</jobTitle> <company>Company 2</company> </job> </EXAMPLE> you can skip <Example> directly and change line 221 in MarkupLoadRSS.module to: foreach($rss->job as $item) { And in your template file to can access the <jobTitle> with: $rss = $modules->get("MarkupLoadRSS"); $rss->load("example.xml"); foreach($rss as $item) { echo $item->jobTitle; }
  10. Hello friends, I have the following problem. I got an XML file that looks like this: <?xml version="1.0" encoding="UTF-8" ?> <EXAMPLE> <job> <jobTitle>A title</jobTitle> </job> <job> <jobTitle>A title</jobTitle> </job> </EXAMPLE> So, what is missing here is the usual opening <rss> tag right after <? xml and we don’t have the usual <channel> and <item> tags. Okay. So, MarkupLoadRSS can not read this file until I change the following line 221 in the MarkupLoadRSS.module from foreach($rss->channel->item as $item) { to this foreach($rss->EXAMPLE->job as $item) { to be in line with my .xml file and also add a opening and closing <rss> tag directly into the .xml file like this: <?xml version="1.0" encoding="UTF-8" ?> <rss version='2.0'> <EXAMPLE> <job> <jobTitle>A title</jobTitle> </job> <job> <jobTitle>A title</jobTitle> </job> </EXAMPLE> </rss> The problem is, later, I will not be able to change the XML file, it is generated by another site. So I need to tell MarkupLoadRSS to ignore the <rss> opening and closing tags. Does anybody know how this is possible? I had a deeper look into the module but I don’t see where the <rss> tag is a interpreted. Maybe someone can give me a clue, please? Thank so much in advance, Thomas
  11. I have discovered a strange problem with two completely different PW websites (PW 3.0.123) that are hosted on different hosting services. When I upload images whose first 4 initial letters result in the word "conf", the images are uploaded but not displayed in the backend. They are also displayed as a "broken link" in the frontend. I cannot edit them in the backend either. Example files could be "conference.jpg" or "confirmation.jpg" or just "conf.jpg". I could not detect this problem on my virtual server (MAMP). I use a simple image-field with the default setting. If I rename the same image (as shown in the screenshot here) as a test, a preview of the image is generated without any problems. Does anybody have an idea what this could be due to? Thanks so much, Thomas
  12. I believe it has something to do with the server. My local copy of the site (3.0.98) translated the © into a c, too. There isn’t any explaining error message, just „invalid image“ (see German screenshot). When I remove the © from the filename it’s uploaded without any error. I also tried other filenames containing Umlauts like ä or special symbols like @ – this works. A symbol like the „Registered Mark“ ® produces the same error like the ©. It’s not a big thing, my client can rename the files, but it would be nice to know why this happens only to this kind of letters. Strange.
  13. A client of me got an error in PW 3.0.98 while uploading images that contain a © in the filename. Any clues how I could filter this in the backend of PW to avoid this? Thanks, Thomas
  14. This looks fabulous! Saw in your screen the example for selling digital fonts. This looks great. A question: will it be possible to give a variant (let’s say: Font Italic) an option to sell it with different license types? Mostly you have something like: Licence 1 = 1-5 User, Price X License 2 = 6-20 User, Price Y And when do you think is Padloper 2 ready to take off? ?
  15. 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
  16. 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
  17. So easy and it works! Thanks a lot, adrian! This makes my day.
  18. 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
  19. 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
  20. 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?
  21. 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); }
  22. Hi, thanks for the answer.
  23. 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
  24. Hmm, forgive me, but that is above my head.
  25. 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
×
×
  • Create New...