Jump to content

Juergen

Members
  • Posts

    1,347
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by Juergen

  1. Hello Joss and Adrian, Thanks for your answeres! @Joss I can do the same with php string replace or preg replace and this will be cacheable, so this is not the way that I want it to do. @ Adrian I have tried this module yesterday, but I also want to add some additional divs for CSS3 effects. This module can only add additional classes so this is also not the right solution. I havent figured out where the markup will be produced (which file is responsible for the output). This could also be a possible solution: To change the markup where it will be produced. Best regards Jürgen
  2. Hello @ all, I use the CKEditor and I want to change the output markup of inserted images, but I dont know where. The standard output for unlinked images: <img alt="Wüste" src="/site/assets/files/1471/desert.150x0-is-pid1468.jpg" height="113" width="150"> I want to change it to: <img class="thumbnail" alt="Wüste" src="/site/assets/files/1471/desert.150x0-is-pid1468.jpg" height="113" width="150"> or for linked images: <a title="" data-original-title="" href="/site/assets/files/1471/desert.jpg"><img alt="undefined" src="/site/assets/files/1471/desert.150x0-is-pid1468.jpg" height="113" width="150"></a> I want to add lightbox2 attribute <a class="thumbnail" title="" data-original-title="" data-lightbox href="/site/assets/files/1471/desert.jpg"><img alt="undefined" src="/site/assets/files/1471/desert.150x0-is-pid1468.jpg" height="113" width="150"></a> Is it possible to change the output without php-manipulation on the template?
  3. Issue already well known (https://github.com/ryancramerdesign/ProcessWire/issues/803#comments) - so thread closed.
  4. Thanx for the ultra fast response. Works quite well
  5. Hello at all I have overwritten the label of the body field in various templates, but if I try to output it in the site template I always get the initially label name. The output code: <?php echo $page->fields->get('body')->label;?> The initially label of my body field is "maintext" and this will be outputed. In my teammember template I have overwritten "maintext" with "About me" but I always get "maintext" as the label and not "About me". Can someone point me into the right direction of outputting the overwritten label?
  6. Hello Macrura, dependencies and repeaters work as expected. The link to the topic provided is no longer valid for the new version. It is from February. In the latest version it is possible to use repeaters and dependencies. The fields will be shown or hidden depending on field values. I have only used it with equal (=) and not with larger or less (<,>), but with equal there is no problem. Only the storage of these repeater fields is the problem and this is not depending on js (it is PHP). Nevertheless thank you for your contribution. Best regards Jürgen
  7. Hello @ all, I have a problem with a repeater field and the storage of its values. Some of the fields in the repeater field have dependencies - so the are only visible if a specific field has as specific value. All the fields with dependencies in the repeater field will not be stored - all the others are stored quite well. So this must be a problem due to the dependency. I use the latest Processwire from Github! Has someone made the same experience? Maybe it could be a bug? Best regards Jürgen
  8. Hello @ all! Question: Is it possible to change the title (name) of the short cut menu in the backend admin? Currently it only shows the template file name (fe if the template file name is "news.php" it shows the name "news" in the short cut menu. I want to change it to fe "add news". I have a multilingual site so changing the name by changing the template name is not an option. Best regards Jürgen
  9. The cron job triggers the event calendar at the moment, so it checks if the event is out of date and then it unpublish it (schedule module). I have also planned to trigger the newsletter subscriptions. I use Mailchimp for the newsletters. At the moment the list of subscribers/unsubscribers will be triggered via the newsletter form from the frontend. If there is a change (subscription or unsubscription) and the submit button will be pushed the list will be sent to Mailchimp to get the list always up to date. But this only works for the frontend at the moment. If I change a newsletter subscription in the backend it will not work at the moment because nothing triggers the sending of the changes to Mailchimp. Server ist Apache.
  10. Hello at all, I am not a skilled PHP-expert so the question will be easy for all the experts out there. I use a cron job and there will be the possibility to trigger it in various intervals (minutes, hours, days,...) Question: Does it makes a huge difference in case of the performance if I use an interval of every minute (server load) on a small site. At the moment I cannot feel a difference but the site is not public (maintainence mode). Which interval is recommended? Best regards Jürgen
  11. Hello at all, I want to hide the option checkbox to "hide the page in search and lists" checkbox for a specific user role in backend, but I cant figure out how it should be done. For example: This option should only be visible for administrations but not for managers. Please take a look at the image below. I know that I can add various fields to the permissions (page-edit, page-publish and so on). So there must be a way to add this hide in list permission too, but I dont know how. Can someone point me into the right direction because I only want to offer the possibility to unpublish a page to the customers. Thanks in advance Jürgen
  12. Thanks Soma, this was what I am looking for. Unfortunately there was no hint in the explaination of $sanitizer->username($value) that this is dpreceated in 2.4.
  13. First of all, its not a big problem. I have created a custom registration form. For the username field I have used the sanatizer api before storing the username in the database. $username is the variable from the form input after submit (Post) I sanatize it like this: In the guidelines there is the following statement: So far so good, but sanatizing the username value changes all big letters [A-Z] to small letters [a-z]. So it doesnt allow big letters in the username. It is not a big deal, but big letters should be allowed according to the statement. Does anyone made the same experience. PS: I use the latest stable version of PW. Addition: it also changes the "@" into "-" .
  14. Thanx Kobra Kai, i will see whats going on in the "wild out there" and if I will track some "bombing" I will try your advice. At the moment I start only with one throttle login and hope the best
  15. I know with the IP-Settings. But I am little bit aware of it because if people from f.e. the same company try to login and they use the same host -> this could be a problem. Anyway: the chance that this should be happen is marginal. Thanks
  16. Thanks Martijn for your answere! But: Attackers often try to user different usernames and passwords and hope that one combination is true. In this case a lots of requests will be send to the server and the server will be busy too. Doesnt it make more sense to create the time limit of next login in any case of false entries to prevent the "bombing" of the server and not only if the username is the same and only the password changes? Best regards
  17. I have also the login throttle included in my custom login in form, but it should only work if your are entering the same username with different passwords. I you are entering always a different username and a different password it seems that try and catch method wouldnt count the false logins. Here es the part of the code of the login form. Question: Does try and catch method only works if you are entering the same value in the username field and compare it with the password?? I only got the messages "to wait until xx seconds before next login" if I entered the same username more times. But with different usernames it shows me always that the password and the username doesnt match message (without the time message). Best regards Jürgen
  18. Thank you Soma, your solution works perfect. SQL-query: to get stored language and not the current language - this was the idea, but unchaching the user is much better foreach: to grab all links to the profile page in each language and pick out the one which fetches the user language - this was the idea behind it. Best regards
  19. I found the solution (thanx to Soma to put me into the right direction) The essential part is to redirect the user in his language to the next page (in this case a profile page where he can update his user information). The main problem was to get the redirection url in the users prefered language. Here is the code I use (this piece of code is in the login page): 1084 is the id of the profile page where I want to redirect. The first step is to make a static call of the db to get the stored user language (not the current of the page!!!!). This is the reason why i dont use the PW api. $data is the variable for the language stored in the users profile (in this case 1011 as the id for the English language) The last step is to create the url for the English version ($profileurl) - it leads to /en/my-profile in my case - this is the path to English profile page. To redirect to this page I use this url in the session. Ready to go. I dont know if this is the perfect solution but it works.
  20. So I have to redirect after the login to the profile page in the desired language. Step 1: Call the login page Step 2 Enter your userdata (username and password) Step 3 redirect to the profile page in the users prefered language This is excactly where I am struggling. my redirect code is: if($user->isLoggedin()) $session->redirect($profileurl); I get the $profileurl in this way: $profile = $pages->get(1084); $profileurl = $profile->url; But how can I get the url in the desired language ? Best regards
  21. Hello Sergio, thank you for your answere! But: I can get the user language with the direct call of the db. My problem is to trigger the site language in that way. I have created a session and compared it in an if statement like you do, but thats the wrong way. It doesnt work. My code: $user->language->id doesnt influence the site language - thats the main problem. Best regards Jürgen
  22. I have setted up a multilingual site with 2 languages (German and English). Goal: If a user logs in in frontend the language would automatically change to his prefered language (entered in his user profile). F.e.: John Smith has English as his prefered language (stored in the language field). The default language of the site is German. So if he logs in, the site language should be changing to English until he logs out. I use the following language switcher in the frontend. <form id="language-switcher" name="language-switcher" class="navbar-form navbar-right" role="form"> <select class='form-control' onchange='window.location=$(this).val();'> <?php foreach($languages as $language) { $selected = ''; // if this page isn't viewable (active) for the language, skip it if(!$page->viewable($language)) continue; // if language is current user's language, make it selected if($user->language->id == $language->id) $selected = " selected=selected"; // determine the "local" URL for this language $url = $page->localUrl($language); // output the option tag echo "<option$selected value='$url'>$language->title</option>"; } ?> </select> </form> This language switcher code is from another entry and works quite well. The problem is that $user->language->id is the current state in the language switcher and not the stored value in John Smiths profile, so it is dynamic and changes every time I activate the language switcher. I can get the stored value with a static call of the db. $loginuser = $user->id; $sql = "SELECT data FROM field_language WHERE pages_id=$loginuser"; $result = wire('db')->query($sql); list($data) = $result->fetch_row(); $userlanguageindb = $data; So the variable $userlanguageindb is the real stored data. So far so good. But how can I influence the site language after the login?? This is my main problem. I would be glad if someone can point me into the right direction. Best regards
×
×
  • Create New...