-
Posts
1,394 -
Joined
-
Last visited
-
Days Won
17
Everything posted by Juergen
-
Quite good idea, but in this case it prevents the storage of the changed value because the reload enters before the new value will be stored. $(document).on("click", ".ui-button", function(){ location.reload(true); }); ui-button is the button class of the save button in the modal window. A timeout would be a possible solution, but I dont know how long it will take to store the value. For the moment I have added a timeout for 1 second $(document).on("click", ".ui-button", function(){ setTimeout(function() { location.reload(true); }, 1000); }); During the test it seems ok. Maybe there is a better solution.
-
The new frontend editing feature in PW 3 is great, but if a value of field will be changed only the changed value will be visible on the frontend. All other texts will be the same. It is often that other values depending on such a field should also change depending on the value of that field. Example: You have a select field where you can change the status of a product (available, sold out). If you change the status a hint text depending on the status should be displayed on the page or not. F.e. Select sold out ->This product is sold out at the moment. Select available -> dont show a text For now you have to refresh the page manually to show or hide the depending text on the page. This is often disturbing for customers. It would be great if I have the possiblity to refresh the page automatically if something was edited on the frontend and the save button was clicked.
-
I have tried to figure out how to change the status (spam, approved,...) via api from the email link. I have created a custom comment form and custom comment list with my markup. Both work as expected. The only thing I could not figure out was how to change the status from pending to approved or another status via the email link if it will be clicked. In the email link there are several GET variables which can be used to create an if statement. F.e if(GET->[success] == "approve"){ ..... ..... set new comment status to 1 } There are several GET variables so this makes it a little bit tricky. Has anyone tried to make the email activation of comments via the api. Best regards
-
No I dont want to mix up - adding the slash is the most consistent method in this case.
-
Problem solved: The slash was on the wrong place. Now the url looks like this: http://www........at/registrierung-abgeschlossen/?user=tester&hash=57498c2ab30a29a2ea66ef153158ed1c The slash is before the question symbol and now it works. Thanks Kobrakai.
-
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?
-
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.
-
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
-
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
-
Template caching and deactivating post and get variables - How to?
Juergen replied to Juergen's topic in General Support
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. -
Template caching and deactivating post and get variables - How to?
Juergen replied to Juergen's topic in General Support
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. -
Template caching and deactivating post and get variables - How to?
Juergen replied to Juergen's topic in General Support
Anyway it doesnt work at all. I leave the page uncached. Thanks for your efforts. -
Template caching and deactivating post and get variables - How to?
Juergen replied to Juergen's topic in General Support
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. -
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
-
I have the same error with PW 3.12
-
Removing the session_start() from the AutoFbPost.module at the beginning solves this problem
-
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
-
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
-
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
-
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.
-
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
-
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