Jump to content

Ralf

Members
  • Posts

    144
  • Joined

  • Last visited

Everything posted by Ralf

  1. Hello all, once again I have a problem how to integrate the PDF output into my page ... (With a direct output I get it in the meantime, see here). But now I use the standard template "Regular" (which is already included in the installation) and it uses the "Markup regions" method as output strategy. Well, and this is where I get stuck. Because if I try it with the same method as in the link above, it wants to open a PDF in the browser, but there is ALWAYS an error message. However, it can't be the code, a) I've already tried it only with the most necessary and b) any test code works wonderfully in "Tracy", whether I want to output it directly or save it, everything works. Now I'm unfortunately a bit at the end of my ideas and hope to get some helpful tips from the community. Would be happy, thank you and stay healthy cu Ralf
  2. Thanks for the suggestion, but I need a formatted output in various other places (eg in the backend overview), so I can not implement this manner. I have inserted the $page->of(false); ? But I still have a question about your first answer, or rather I do not really understand the last sentence. How can this work? If I enter a date in the field A, how can he fill the field B WITHOUT saving the page (without Ajax)? Or am I just misunderstanding your statement?
  3. @BillH thank you very much, that was exactly what I was looking for.... I only had to modify the following line slightly, otherwise it gives me problems with my date (fieldtype: datetime). // old line $originalValue = $page->date_field; // modified line to my needs $originalValue = strftime('%Y-%m-%d', $page->getUnformatted('date_field')); Thanks cu Ralf If someone wants to see the whole code again...
  4. Hi all, i am currently facing a task where i want to fill an integer field using php based on an input from another field as already written in the subject. Specifically, my request is as follows: I have a date field in which I select e.g. the date 2021-02-06. In a second field (I thought e.g. of an integer field) the correct calendar week is now automatically entered according to the input from the "date field". In my case this would be "06" or "202106". The PHP code for the conversion would be theoretically this date("oW", strtotime("2011-01-07")); // gives 201101 Could someone help me with the hook here???
  5. Hello everybody, in order not to hijack the Wishlist & Roadmap thread, here is an extra thread about my current webP problem where I need your help. More precisely, it's about a strange phenomenon in the creation of images. - I have an Image Field, where I can upload an image. - Then I save the page with the image and call up the internet address in the frontend. - PW now generates a webP image for me. => HOWEVER this picture is unfortunately "empty".... More details see in this article here: https://processwire.com/talk/topic/14236-webp-support/?do=findComment&comment=208142 Help where is my error? Is it PW? is it the GD version I use? Thanks Ralf
  6. Hello everybody, i am currently working on a project where i want to implement the webp support in the code (<picture>...). But what I'm already busy with all this weekend, that PW for whatever reason doesn't always generate a webp image? In the first screenshot (which is reproducible) no webp image is generated. But if I edit this original picture and change parts of it, then make a jpg out of it and upload it, it works. Unfortunately, this is not only the case with this picture, but with other pictures this has already happened to me on Friday ? Help what could be the reason for this? ----------- The server specification from my hosting provider ProcessWire 3.0.165 PHP version 7.4.10 gd module version 2.1.1 WebP Support - enabled imagick module version 3.4.4 but NO entry in the supported formats! (that's why I did not enable IMagick Image Sizer)
  7. Hello Ryan, thanks for the update and yes the new page is more the look-and-feel of the main page. I'd like to give you a short feedback on two points I noticed during the first view/trial. 1. I have to admit that I personally am a person who likes to visually perceive larger lists. That is to say, I appreciated the fact that in the old page a small picture of the author was displayed with each module entry. I have to admit, if I have a list of 25, 40 or 50 modules in front of me and all entries look "the same" I knew in the past, I'm now looking for a module of author x, who has his picture looking like this... and then I "scrolled" over the search result quite fast. Would it be possible to include this module Autor Avatar in the new directory? 2. The second point concerns the search function in the module directory. Currently it seems to me as it looks like it probably does not search in the "body" area. Would this be possible? Explanation: The following problem occurred during my first test, the first module which I always install with every new PW installation is the "ProcessWireUpgrade" module. So my difficulty was, I can't remember the exact name ... don't ask why, I already tried it with postits etc. etc. ... nothing helps. ? So I entered "Update" in the search field (I know update and upgrade is not the same thing) and it gives me only one entry here: "MarkupBrowserUpdate" ? but that's not what I was looking for. I knew that the module is from you, so I clicked on your name in the author's section and went through all your modules and see, it's not update but upgrade. OK the search can't find anything, but the word "update" does appear in the body text, so why doesn't it show me this? Long speech, short sense... wouldn't it be helpful if the search function would also search the body area? Or a completely different idea (I'm working a lot with the blog system right now) how about a hashtag function for the modules? The module author can then enter 1, 5, 10, ... Keywords to be included. Or would even both be helpful? Only my two cents, thanks for reading and a nice weekend
  8. 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)
  9. 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
  10. 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
  11. 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?
  12. 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
  13. @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.
  14. @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 ?>
  15. @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.
  16. 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
  17. @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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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"
  24. 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.
  25. 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
×
×
  • Create New...