Jump to content

Ralf

Members
  • Posts

    133
  • Joined

  • Last visited

Everything posted by Ralf

  1. Hello @adrian, ... yes, if you look under "Admin -> Setup -> Fields -> force_passwd_change" this is also possible *am I stupid* 🙈 I looked it up under Language and didn't have the idea to look under Fields... sorry. Of course you can find everything there and enter everything you want. Secondly, thanks yes, I have now found the translation in the language files and translated it immediately ("You must change your password now"). But as far as my actual topic with the "output" is concerned, it still doesn't work. My question here is, do I have to add any code to the PHP template file of LRP (login-register.php) in the frontend to output exactly this message "You must change your password now"? Because this message is currently not displayed in the frontend? (but in the backend I see this message)
  2. Hello @adrian, Would it be possible to make the fields which are displayed in the user profile "translatable"? I am talking about lines 109 and 261-264 in your code? https://github.com/adrianbj/PasswordForceChange/blob/master/PasswordForceChange.module.php#L261 Furthermore I am currently building the code into an LRP module from ryan and I would like to display the message in the front-end that the user has to change his password now. How do I display this again? Sorry I am standing a little bit on the hose right now... 🙈 Thanks cu Ralf
  3. Dear All and @flydev 👊🏻 i am currently creating a contact form and wanted to use the Google recaptcha for this. While implementing, I come across the following problem that I can not get solved... My page code structure looks something like this: <?php namespace ProcessWire; ?> <div id='content-body'> <div class='uk-grid' data-uk-grid> <div id='content' class='uk-width-1-2@m'> <?=page()->body?> </div> <div id='contactform' class='uk-width-1-2@m'> <h3>Contact Form</h3> <?php // Google reCaptcha as Modul $captcha = $modules->get("MarkupGoogleRecaptcha"); ...... // form was submitted so we process the form if($input->post->submit) { // Do cool stuff here <<<<-------- I cannot get in here } ?> <form class="uk-form-stacked" action="./" method="post"> <div class="uk-margin"> <label class="uk-form-label" for="name">Your Name <span class='uk-text-danger'>*</span></label> <div class="uk-form-controls"> <input type="text" name="name" class="uk-input" value="<?php echo $name?>" placeholder="Your Name here"> </div> </div> <div class="uk-margin"> <label class="uk-form-label" for="email">Your Email-Adress <span class='uk-text-danger'>*</span></label> <div class="uk-form-controls"> <input type="email" name="email" class="uk-input" value="<?php echo $email?>" placeholder="Email-Adress"> </div> </div> .... <div> <!-- Google reCaptcha code START --> <?php echo $captcha->render()?> <!-- Google reCaptcha code END --> </div> <div class="uk-margin"> <input type="submit" name="submit" class="uk-button uk-button-default" value="Submit"> </div> </form> <?php echo $captcha->getScript(); ?> </div> </div> </div> My problem is now, as soon as I insert this line of code "<?php echo $captcha->getScript(); ?>" on the page like this, my query "if($input->post->submit)" does NOT work anymore .... HELP what is wrong here or where is my mistake? Thanks Ralf
  4. You mean something along those lines? https://developers.google.com/fonts/docs/getting_started Google Fonts are used in your e.g. html code for the frontend, so an implementation in PW is not necessary. By the way, have you ever read up on the great ideas @dragan has for you?
  5. Hello everybody, I have a problem with a PW installation that i can't quite understand or i don't know where to look for forgotten settings? I have a separate member area in the frontend. When I click from page to page, I always get a new SessionID assigned. Until now this was not a problem, but now I wanted to store form data in a session variable and use it over several pages, but this is not possible, because it gets a new SessionID assigned every time I call another page? In the files I only found the following values: config.php /* * Your PHP has a configuration error with regard to sessions. * It is configured to never clean up old session files. Please correct this by adding the following to your /site/config.php file * */ ini_set('session.gc_probability', 1); and in every php file for a template I have this code in the first line: <? //This page is only displayed if a member is logged in, otherwise the user is redirected to the login mask. if($user->isLoggedin() != true) $session->redirect($config->urls->root.'access/login/', false); ..... Otherwise I would not be aware of any other code that could be responsible for such behavior 🤔 Is there any other setting for this topic in the backend or elsewhere? For tips I would like to thank you already now Thanks Ralf
  6. @Guy Incognito did you do everything renobird wrote in his post on page #4 of this thread? In particular "... In order for title to show as a connection option during your import, you need to add the title field to the user template file. ..." http://processwire.com/talk/topic/383-module-import-pages-from-csv-file/?p=10160 For me the import works, I just edited ~200 users.
  7. @bernhard many thanks for your PM help. For everyone else who might have the same problem as me, here are my implementation steps (no guarantee - I'm not a programmer) 1. activate URL segments (a good introduction can be found here: https://processwire.com/docs/front-end/how-to-use-url-segments/) 2. create my page WITHOUT URL segment (this shows the content + a button) 3. create a new page for the URL segment (e.g. /pdf) - this creates the PDF and displays it e.g. with show(). 4. it works 😎 My Code from No 2 (content + button) - mytemplate.php <?php if(strlen($input->urlSegment2)) throw new Wire404Exception(); switch($input->urlSegment1) { case '': // Segment 1 is empty so display main content <!-- my main content --> // My button to the PDF-creation-code echo "<a href='". $page->url ."pdf/' target='_new'>generate PDF</a>"; break; case 'pdf': // Display the PDF include 'mytemplate-pdf.php'; break; default: // Anything else? Throw a 404 throw new Wire404Exception(); } ?> My code for example from No 3 (PDF creation) - mytemplate-pdf.php <?php $pdf = $modules->get('RockPdf'); $mpdf = $pdf->mpdf; $pdf->set('SetHeader', 'This is my header text'); // Two different ways to generate an output $mpdf->WriteHTML('Hello World ' . date('H:i:s')); $pdf->write('<!-- my custom comment --> Foo Bar Foo Bar ...'); // Output $pdf->show(); // to directly show your file in the browser ?>
  8. @bernhard many thanks for this great module. I am currently testing how it works and I will be able to use it in the future. Unfortunately there is one important question for me at the moment: How do you integrate it into your site? 🤔 I would like to put the whole code into an own file (the pdf generation doesn't have to be done every time the page is loaded) and then trigger the pdf output via a link/button on my content page. A tip in the readme how this could look like in a live version (not only in tracy) would be great. Sorry to be stuck on this point.
  9. Dear @gmclelland, many thanks for the tips, especially the one with the checkbox I found very interesting. My customer doesn't want a comment function now, so I commented the whole thing out. The trick was in the "blog-post.php" file and then a chache problem with my browser why it didn't work at the beginning... Many thanks again for the tips cu Ralf
  10. @OLSA many thanks for the module that works great to set up and select! However, I still have a big problem... If i have selected an icon and then click on save, the information "Session: Saved Page: ...." appears on top. But when I want to leave the page I ALWAYS get a popup with the following error message (sorry translated from German) "This page asks you to confirm that you want to leave the page - data you have entered may not be saved." What am I doing wrong or is there an error in the CSS/JS? Can someone please help me? Thank you cu Ralf
  11. Dear processwire professionals, i have a question about the PW standard template "Regular". This template is great and I use it to create a new page with UIKit. But at the moment I still fail something due to a task... Is it possible to design the comment function for the blog part OPTIONAL? Which part of the code do I have to change if I don't want to allow a comment function for this homepage? I tried to comment out different lines in the file _uikit.php, but without success. The result were always PHP error messages... 😞 So now my question to the auditorium, if somebody could help me? If this question is already answered in the forum and I did not find it by my search, I apologize and would be happy about a link. Many thanks and many greetings Ralf
  12. Hello Can, I know the whole thing is a little older... but did you get any further back then? Have you been able to develop the whole thing into a module? Many thanks and many greetings to Peru
  13. Hello everybody, i have a question, which unfortunately i can't answer at the moment... A friend of mine is looking for a new homepage and asked me if it is possible to use PW to create a system with about 30-60 editors who can write articles/news in 3-5 "areas". But only have the possibility to either create NEW articles or edit their own articles. a) That means for user 1 the edit button is only allowed for his own articles, but not for articles from user 2 to 40. b) The new button should be displayed on the parent pages for all users. Excluded from this should be the SuperUser, be able to edit all articles. I'm sorry for a stupid question, but I'm on the line for a solution. 🙈 My question now to the professionals, is this possible and if so how do I have to set PW with rights and permissions? I would be very pleased about feedback! Thanks Ralf
  14. Help... After the update from 3.0.98 to 3.0.118 the complete page doesn't work anymore 😞 there is only one error message left: Parse error: syntax error, unexpected 'new' (T_NEW) in /www/htdocs/xxxxxxx/wire/core/WireArray.php on line 2480 this is the code in WireArray.php /** * Create a new WireArray instance of this type, optionally adding $items to it * * This method call be called statically or non-statically, but is primarily useful as a static method call. * * ~~~~~~ * // Create new WireArray with a, b and c items * $a = WireArray::new([ 'a', 'b', 'c' ]); * * // This also works when called statically (array syntax can optionally be omitted) * $a = WireArray::new('a', 'b', 'c'); * ~~~~~~ * * @param array|WireArray|mixed|null $items Items (or item) to add to new WireArray * @return WireArray * @since 3.0.117 * */ public function ___new($items = null) { $a = self::new($items); $this->wire($a); return $a; } Could anybody help? Thanks Ralf
  15. Hello together, I´m a bit confused about doing the output of the securefile respectively securefiles... Wanze wrote this code: if ($input->get->download == 1) { $yourSecureFile->download(); } Now I'm a little overstrained and need your help. I build a template at the frontend for secure files and I generate the current output with this code $content = $page->body; $pdffiles = wire("page")->file; foreach ($pdffiles as $pf) { $content .= "<a href='' title='{$pf->name}'>$pf->name</a> ($pf->filesizeStr)<br />"; } but how can I now tell this link which of the secure files the user wants? This is the current output... Thank you for any hint Ralf
  16. Hi kixe, thanks - but hmm strange, the output is now nothing. But it should be 2 or 5 entries output - if i insert 1045 or 1041 as ID value. Have you else any idea? PS: a second challenge is to combine it with a query after "$user->roles"
  17. Hi kixe, sure, I can try. /* Home | |- events (template: events -> field: title) | |- event (template: event -> fields: title, date, jobs (PageTable - with the template "job" for items) | | |- job A (template: job -> fields: title, select_task (Page), job_begin, job_end, select_place (Page), | | | staff_needed (Integer), select_group (Page - PageArray with "Roles" as the Parent of selectable pages), | | | participants (Page - PageArray with "Users" as the Parent of selectable pages)) | | |- job B | | |- job C | | |- job X | | |- job Y | | | |- event | |- job D | |- job E | |- job F | |- tasks (template: basic-page -> field: title) | |- task A (template: task -> field: title) | |- task B | |- places (template: basic-page -> field: title) | |- place A (template: place -> field: title) | |- place B sorry that i missed the jobs in the first page tree.
  18. Hi, i build a ""assignment list" and want to find some pages with the same event select_groups as the active user has roles. My setting: Home |- events (template events) | |- event | |- event (template event -> title, date, jobs (PageTable) | |- tasks |- places The PageTable "jobs" has the template "job" (title, select_task, job_begin, job_end, select_place, staff_needed, participants & select_group -> which is a PageArray with "Roles" as the Parent of selectable pages!) And now I have tried using the following code to output the test data: $events = $pages->find('template=event, jobs.select_group=1045, sort=date'); foreach($events as $event){ $content .= strftime('%d.%m.%Y', $event->getUnformatted('date')) ." $event->title<br />"; foreach($event->children as $child){ $content .= "<b>{$child->select_task->title}</b> ({$child->select_place->title})<br /> ({$child->job_begin} bis {$child->job_end})"; } } which 1045 is only a example id from one Role. BUT this Code ignore the select_group and output ALL events?! Questions: - goes the whole at all with one "find"? - how can i search after x user roles in y pages? (so I only display these events per user which he is allowed to see with his roles) How can I achieve that? Thanks Ralf
  19. I found the mistake/ problem ... it were the curly braces // it doesn´t work $content .= "\$child->select_task->title: $child->select_task->title<br>"; // is working $content .= "\$child->select_task->title (with {}): {$child->select_task->title}<br>";
  20. Hi diogo, thanks for your fast answer. Sorry but "select_task" has in the settings -> Single page (Page) or boolean false when none selected?! And if i put your code behind the "print_r" foreach($child->select_task as $task){ $content .= $task->title; } i get this "Notice: Trying to get property of non-object..."
  21. Hello everybody, i try me just on a new project an "assignment list" for my association. I built years ago a first version with php and mysql but now i want to switch to Processwire My backend I have designed as follows: Home |- events (template events) | |- event | |- event (template event -> title, date, jobs (PageTable) | |- tasks |- groups |- places The PageTable "jobs" has the template "job" (title, select_task, job_begin, job_end, select_place, staff_needed, select_group & participants). And now I have tried using the following code to output the test data: $events = $pages->find('template=event, sort=date'); foreach($events as $event){ $content .= strftime('%d.%m.%Y', $event->getUnformatted('date')) ." $event->title<br />"; if($event->hasChildren > 0) { foreach($event->children as $child){ $content .= "<li>\$child->url: <a href='{$child->url}'>$child->url</a> // \$child->id: $child->id // \$child->select_task: $child->select_task // \$child->select_task->title: $child->select_task->title // \$child->select_place: $child->select_place //<br> \$child->staff_needed: $child->staff_needed // \$child->participants->count: $child->participants->count // \$child->job_begin: $child->job_begin // \$child->job_end: $child->job_end // </li><br><br>"; echo '<pre>'; print_r($child); echo '</pre>'; } } } the output you can see here: http://entwicklung.hungerberghexen.de/events/ My problem now is that with my code above i get not all values from the fields (it almost looks as if I would not be deep enough in the array?) e.g. "job_begin" & "job_end" -> work -- but for "select_task" i get only the ID ?! In advance thank you very much for any helpful hints cu Ralf
  22. Hi Martijn, thank you very much! It works perfektly again Have a nice Weekend cu Ralf
  23. Hello @all, its just a few days gone since Martijn write this beautiful code and PW is now in Version 2.6.1. available. This is the reason why i answer to this Thread, yesterday i updated my Installation with this code from Version 2.4.0 to 2.6.1 and at the first look around it seems all good. But when i open now a horse page in the backend i get the following Error: Recoverable Fatal Error: Argument 1 passed to InputfieldWrapper::append() must be an instance of Inputfield, boolean given, called in /www/htdocs/xxxxx/site/modules/HorseFamilyEdit.module on line 151 and defined (line 192 of /www/htdocs/xxxxx/wire/core/InputfieldWrapper.php) This error message was shown because you are logged in as a Superuser. Error has been logged. Administrator has been notified. This are the lines from "HorseFamilyEdit.module" // Markup $markup = $this->modules->get('InputfieldMarkup'); $markup->label = $this->_("Kinder"); $markup->value = $table->render(); $wrapper->append($markup); $view = $form->find("id=ProcessPageEditView")->first(); $form->remove($view); $form->append($wrapper)->append($view); } } And the the InputFieldWrapper Code are the same in Version 2.4.0 and 2.6.1, the only difference are the line in the file. My Question is now, could somebody help me? Thanks in advance Ralf
  24. @ Martijn fabulous - you made my day !! change the z-index from 2 to 10 makes the difference...
  25. @Manfred62 thanks for the confirmation. This misconduct is known to me. Unfortunately I have discovered this problem not until shortly before publication. But my first try, it failed to repair. Now I've decided to completely change the slider, but this will take some time ... I have tested Slider2 and thought I'll try it?
×
×
  • Create New...