Jump to content

Juergen

Members
  • Posts

    1,414
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Juergen

  1. Unfortunately the slash at the end doesnt work. I can remember that there is a module which (I dont know the name) which is responsible for redirects if a url has changed. Could be this the reason?
  2. Correction: The GET parameters will be sent - I can see it for a short moment in the url, than they will be removed - for me it looks like a redirect. Maybe from a module. After that the page is visible. ?? Maybe this could be the reason @ LostKobraKai. I will add the slash and try it once more.
  3. Hello @ all, I have used for a long time the code from the first entry: https://processwire.com/talk/topic/4066-activate-user-account-via-email/?p=39846 I have the latest PW devs installed an today I have discovered that this code doesnt work anymore. The registration works well and the user get the email to verify his account by clicking the activation link. The link looks like this: : www........../registrierung-abgeschlossen?user=tester1&hash=47eeaa6d0363b323d48730fce39039bf The strange behavior starts when the user click this link in the email. If the links was clicked the landing page is not the same url as above. It is www........../registrierung-abgeschlossen/ ->without the GET parameter. So it seems that there will be a redirect. If I want to echo the values of the GET parameter all will be empty. Here is the code of the activation page: <?php /*************************/ /** Activation template **/ /*************************/ include("./inc/head.inc"); echo '<div class="maincontent registration-complete row">'; echo '<main class="col-md-12">'; $activate_username = $_GET['user']; $activate_hash = $_GET['hash']; echo wire("users")->get($activate_username)->id;//this only for testing and shows always 41 for the admin $mister = _t('Mister', 'Generic'); $miss = _t('Miss', 'Generic'); if (wire("users")->get($activate_username)->id) { if (strcmp(wire("users")->get($activate_username)->user_activation, $activate_hash) == 0 || wire("users")->get($activate_username)->user_activation == 0) { $mainheadline = $page->get("headline|title"); $useractivehead = _t('Your registration was successfull', 'Generic'); $useractivetext = _t('Your account has just been successfully activated. You can register now with your access data at our website.', 'Generic'); $useractive = '<div class="alert alert-success" role="alert"><h4><i class="fa fa-info-circle"></i> ' . $useractivehead . '</h4><p>' . $useractivetext . '</p></div>'; echo '<div class="page-header"><h1>' . $mainheadline . '</h1></div>'; $activate_user = wire("users")->get($activate_username); $activate_user->of(false); $activate_user->addRole("guest"); $activate_user->user_activation = "0"; $activate_user->save(); //$activate_user->of(true); echo $useractive; //show success message $gender = $activate_user->usergender; if ($gender == "1") { $gendertext = $mister; } else { $gendertext = $miss; } $first_name = $activate_user->user_first_name; $last_name = $activate_user->user_real_name; $useremail = $activate_user->email; $currentuserlanguage = $activate_user->language; } else { $mainheadline = _t('Errors occur during the activation', 'Generic'); $usererrorhead = _t('An error occured', 'Generic'); $usererrortext = _t('We are sorry but an error occured during the activation. Please contact the owner of the website.', 'Generic'); $usererror = '<div class="alert alert-danger" role="alert"><h4><i class="fa fa-warning"></i> ' . $usererrorhead . '</h4><p>' . $usererrortext . '</p></div>'; echo '<h1 itemprop="name">' . $mainheadline . '</h1>'; echo $usererror; //show error message } } else { $mainheadline = _t('Errors occur during the activation', 'Generic'); $usernotfoundhead = _t('Account not found.', 'Generic'); $usernotfoundtext = _t('Sorry, but your account was not found in our database.', 'Generic'); $usernotfound = '<div class="alert alert-danger" role="alert"><h4><i class="fa fa-warning"></i> ' . $usernotfoundhead . '</h4><p>' . $usernotfoundtext . '</p></div>'; echo '<h1 itemprop="name">' . $mainheadline . '</h1>'; echo $usernotfound; //show error message } echo '</main>'; echo '</div>'; include("./inc/foot.inc"); ?> Has anyone an idea, why the GET parameter arent there? Best regards
  4. Hello @ all, I have a general question about how PW deals with db queries. If I query the same db field multiple times on a page, fe the title field, will this field be queried only once or for every appearence on the page. $page->title ...... $page->title ...... ...... $page->title Thanks for you answeres
  5. Thanks for your hints. I will leave the page uncached so I can use CSRF. The page loads quite fast so its not really necessary to use a cache.
  6. Ok, this causes the problem. I use a redirect to the same page after there are no errors to prevent double form submission. After the redirect only the success message will be shown, but this only works if the cache is disabled. In my case I see the (empty) contact form again without the success message, because the page will be reloaded from the cache. This is the problem.
  7. Anyway it doesnt work at all. I leave the page uncached. Thanks for your efforts.
  8. The field is hidden. I think this could be the problem because all none hidden data will be submitted, but the value of the hiddenfield not.
  9. Hello @ all, I have a page with a contact form, which is cached. After submitting the form the cache is active. I use the template cache. There is the possibility to add deactivating cache disabling post and get variables. So I have included a hidden field in the template: <input type='hidden' id='aftersub' name='aftersub' value='1'/> Then I added the hidden field to the post fields of the template cache tab, but the template cache will not be disabled after submission. I am not a PHP-pro, so can anyone tell me how to use the cache disabling variables correctly? Thanks in advance
  10. I have the same error with PW 3.12
  11. Glad to hear that ! Now the "save the page and go to the frontend" button is not necessary anymore if you use PW3, because this functionality is integrated in the core.
  12. Removing the session_start() from the AutoFbPost.module at the beginning solves this problem
  13. I use PW3 and I always get this error message if I try to login in backend after uploading the module to the server: Is this module not compatible with the latest PW version? Best regards Jürgen
  14. Thanks, my first thought was to use a hook, but I dont know exactly how. So its not a big problem at the moment.
  15. Hello @ all, I use the new frontend editing of PW3 in some cases. Now I need to reload the page after changes were made in the modal dialog, because some text appear on the page depending on the changes (a lot of if-conditions that show or hide text depending on that changes). After saving the modal only the field which was edited changes. After I press the reload manually I can see all other changes on the page. Is there a way to reload the page automatically after the save button in the modal is pressed? Best regards Jürgen
  16. I found the solution: My search term variable is $q. This is what causes the problems because I didnt include it $q. Instead I used $optionvalue as mentioned above So the syntax is manufacturer.title=$q Now I got the correct results thanks all
  17. Unfortunately I got all pages of the site in the results. It doesnt matter what kind of syntax I use So this doesnt seem to work.
  18. Hello @ all, I want to know if it is possible to make a site search also for select option fieldtype? In my case I use this fieldtype to choose the manufacturer of a product. The field itself is called "manufacturer". I have tried to include the field in my site search as "manufacturer", "manufactuer.title", manufactuer->title" but no luck. My goal is to include all products in the results if someone enters the manufacturer name in the search field. Any hints? Best regards
  19. Hello @ all, I have discovered a problem with the new frontend editing in PW3. I use a field which is only visible under certain conditions (inputfield dependency). This makes it not working on frontend. I use the following code: <div edit="1001.myfield"> ... </div> "myfield" is only visible if another field has a specific value (dependency). In the backend "myfield" is visible because the other field has the correct value, but on the frontend the modal is empty. It seems that it doesnt check against the value of the other field. Possible but not elegant workaround would be to surround it with a fieldset and set the dependency to the fieldset. Has someone a better solution? Best regards
  20. Hello @ all, I have created a product page where customers can filter products depending on various attributes. I dont want to show all product matches on one page so I use a pagination to split it. So far so good - everything works as expected. The problem starts when I press the pagination button to see the next page (fe page 2). Then all products will be shown instead of the selected ones. As you can see: The pagination shows all pages Here are some code examples: // Get all products matching the filter criteria $p = $pages->find("template=products$productkindselect$offerkindselect, limit=$itemnumber"); $resultcounter = count($p); if ($resultcounter > 0) { //loop through each item foreach ($p as $child) { //Output the children fe $child->title; } } The code for the pagination $results = $p; echo $results->renderPager(array( 'currentItemClass' => "active", 'nextItemLabel' => "<span class='fa fa-angle-double-right'></span>", 'previousItemLabel' => "<span class='fa fa-angle-double-left'></span>", 'listMarkup' => "<nav><ul class='pagination'>{out}</ul></nav>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>" )); $pagination = $results->renderPager(); Has anyone tried to use a pagination with a filter an has a working solution? best regards
  21. Hello szabesz, thanks for your reply. Yes there is a singleimage.php inside the products folder (without any writing mistakes). Thats the reason why I cannot find an explanation why it doesnt work. You write in your case it works well, so the problem is somewhere on my side.
  22. Sorry but this makes no difference
  23. Hello @ all, I want to create a new render instance of an image field like described in this post https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/#specifying-custom-views I created the fields folder as described. Everything works fine if the render file is dirctly under the field folder, but if I want to use a custom rendering file it doesnt grab it. I have created a subfolder inside the fields folder which was named "products". In it I have a custom image file for a product image. The image field name is "singleimage" and the file inside the products folder is "singleimage.php". I have tried to render the image output in this way: echo $page->render('singleimage', '/products/singleimage'); Unfortunately it doesnt grab the file "singleimage" inside the "products" folder. It always uses the fallback. What can be the reason? Is the syntax wrong? I use the latest dev version of PW Best regards
×
×
  • Create New...