-
Posts
4,088 -
Joined
-
Last visited
-
Days Won
88
Everything posted by horst
-
@Tom. Interesting thread! I do not use any FrontendFramework if I don't have to, (only jQuery). I more and more try to understand the basics and don't want to learn frameworks. Additional to that, I can copy paste the most from @wbmnfktr post, because my setup is as follows: ? My boilerplate for new projects: Starting with one out of 3-4 personal PW-profiles, that are more or less without content, but with special configurations and modules my personal SCSS Skeleton jQuery and / or some personal JS-snippets Tools I use and need: git my own Preprocessor- and Minifier module in PW some code and scss snippets bound to the $config->debug state for developing Tools that may be added on demand: Lazysizes Slick Slider script MixItUp script Thats my tools that give me freedom from things like grunt, gulp, whatever: The first one is my preprocessor and minifier pw module that detects every single file change of js, css, less and scss files (and the @import dependencies) automatic on page load. It can process less & scss and can minify css, js, html. The second one are three little buttons in the top left on frontend pages that can toggle a breakpoint indicator and a hierarchical background color system to identify html elements dimensions and positionings.
-
Login/Register - disable the email validation link
horst replied to JeevanisM's topic in Modules/Plugins
phpinfo() will shed some light. ? -
GET json data via REST API and store value in session
horst replied to jds43's topic in General Support
There are the php functions json_encode and json_decode. You can use one to add it to the session, and the other to read it from the session. (Sorry, on mobile. Therefore no links or examples here. ) -
You may read in this thread about it, but the last post had the best solution for me:
- 1 reply
-
- 1
-
-
Haha! Good advice! :-)
-
@tires please can you mark your initials post title with [SOLVED], so that every one can see this in the post listings? If you don't know how to: Go to your initial post of the thread and click "Edit", then you are able to not only edit the post body but the title too.
-
Maybe it has to do with that reported issues on github get more attention (at least from Ryan), and that issues on github are much better to handle in that workflow then in the forums here. The forums here are prior to support people with (maybe at first: "undefined issues" for them) that may be uncovered as wrong usage or something different. And sometimes it uncovers to be an issue in the core code base. Those one need to be filed at github to get recognition in the issue resolving workflow! If you want to contribute to this project, you can file an issue at github into the issue repository, using the issue template there. A detailed explanation also is there to help everyone who is willing to participate in this community project.
-
What is $import->post() ?? Do you mean $input->post() ?
-
Please file a github issue (with the pw version)
-
What is the debuglog saying which server is connected, what is the servers response, what is the transfer protocol etc etc. the debug log from the debugsend() method should tell what happened.
-
Yep, but it definetly will change at those smaller webhosting plans too, at least if they are setup using ubuntu etc., because (I heard from a medium german hosting company) that upcoming ubuntu etc. will change apache's default setup to work with HTTP/2 (and PHP as apache module is dropped and no more available then ? ).
-
After looking to it a second time, one may come to be able to see the not so sad truth, that is: With ProcessWire we have an opensource project on a very high level in regards of code base, stability & homogenity and much much more along those lines. AND all of of this is directly related to Ryan's decision to *work through all pullrequests* himself to deeply understand, modify, and adapt the code, so that he himself is ALWAYS & IMMEDIATELY able to fix bugs resulting from those code changes. (Even after years, when maybe some people who have sent PRs have left the project again and are no longer reachable.) This has a lot of advantages! And it has, (as everything has), some cons. One of them is, that he is something like a OneManCodingArmy :-), but he is only *one* man. And I don't want him to waste his time to read through every github issue, plus every github pullrequest AND ANSWER TO EVERY ONE of them, in order to explain "why he doesn't want to do it that way, or that he doesn't have time now to do it, or that it could produce a lot of side effects, or, or, or". And one of my fantasies is that he might already be unhappy about not having the times to be carefree active here in the forums, as it was possible for him until about 4-5 years ago. It might feel ungrateful for him to read such a post. This, as a result of his disciplined behaviour, to advance the project as far and effectively as possible. Every week, or almost every day. (( @ryan Did you imagine or wish this when you turned your code into an open source project in 2010? I'm just kidding! But it may sometimes be tiring to be confronted with the same thing over and over again, when the answers have already been given many times and the internet supposedly doesn't forget anything. But when people "don't have time" to do a little research first, or try to look at it from a different angle before, but (in the worst case without any impulse control) always bring up the same things again. Pffhhhh, for my well-being that would be nothing. ? I want you to have time and energy to work in your own flow & rhythm on *your* ProcessWire. Your ProcessWire, that you gifted to us. ? )) @bernhard The truth is, (not the sad truth, not the happy truth, just the truth): it's one of two possible choices that he took 10 years ago. With all the pros and cons. In my opinion, every member of the community should respect that and never forget it. Because all that we have learned to love and appreciate about ProcessWire, all that has enabled us (even in early days, when we may not have had much code experiences) to write our own modules, is the result of that decision and I wouldn't want to miss it. The alternative would be to abandon this course and (quality) control. But all the people I've spoken to in the past, all of whom have more than 15+ or 20+ years of experience in the software business and open source sector, have consistently told me: "Be glad that it is this way. There were so many projects that started that way, but opened up and broke 1 or 2 years later." And about @netcarver question: I have contributed a lot of stuff in regard of image handling in PW. But it seems that less then 5% of it is reflected in githubs contributors list. The most things, where Ryan included my PRs as is, we have had conversations and colaborations about and on it on github or private via PM or email, until the code was accepted by him (in regard to his principles, anounced above). Aaand, it could be, that it also has something to do with the fact that he not only made the experience that I am still approachable after 6 years when it comes to issues, decisions or questions, but that I also not only understood his decision, but also respect it. Even if it has a negative effect on me in some areas. (But that's also just a fantasy of mine, with no claim to truth.) ?
-
Thanks for reporting! I'm using PHP 7.2 and currently don't have a PHP 7.3 server running. I will update my dev setup when I find time and fix this.
-
Because the current test part only does the connection part, (ping the server and login), within the modules settings screen. It was written for PW 2.4 (and is backward compatible until now). I think this would be a good addition, maybe besides the current connection test.
-
You can add some debug code into a template file and call a page with it: $to = array('me@example.com'); $subject = 'Wiremail-SMTP Test ' . date('H:i:s') . ' äöü ÄÖÜ ß'; $mail = wireMail(); if($mail->className != 'WireMailSmtp') { echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; } else { $mail->from = '--INSERT YOUR SENDER ADDRESS HERE --'; // <--- !!!! $mail->to($to); $mail->subject($subject); $mail->sendSingle(true); $mail->body("Titel\n\ntext text TEXT text text\n"); $mail->bodyHTML("<h1>Titel</h1><p>text text <strong>TEXT</strong> text text</p>"); $dump = $mail->debugSend(1); } So, in short, instead of using $mail->send(), use $mail->debugSend(1) to get output on a frontend testpage. The output is PRE formatted and contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection, like this one:
-
https://lmgtfy.com/?q=site%3Aprocesswire.com%2Ftalk+password+recovery+ryan&s=g&t=w
-
Pagination? --> https://processwire.com/api/ref/paginated-array/ Add pagination properties to your find selector, (as Dragan already suggested), and store relevant parts into session variable(s).
-
Hey, lets pull it down to this: serving the full filesystempath should work everytime, if the file is_readable(), URL „may“ work most of the time, as the pdf-lib will expand it to the full filesystempath. In both scenarios finally the full filesystempath is needed to read, parse, import the imagefile into the pdf object. ?
-
I think you need to pass the full (absolute) filename to the mpdf->image() method, not a relative one and not(!) a URL. $filename = "/absolute/filepath/to/the/image.jpg"; // or when using PWs pageimage $filename = $image->filename; // do a test in your script for debugging: if(!is_readable($filename)) die('Missing file'); $mpdf->AddPage('L'); $mpdf->Image($filename, 0, 0, 210, 297, 'jpg', ...
-
https://mpdf.github.io/reference/mpdf-functions/image.html
-
wireshell - an extendable ProcessWire command line interface
horst replied to marcus's topic in API & Templates
? @justb3a Good luck on your (new) way and many, many thanks for all your contributions !! ? ❤️ ? -
@Jens Martsch - dotnetic, I had set it up some years ago under win7 with a (sort of) proxy batchfile. It is a single file, that I pointed the modules default protocol settings to. Don't know if this can be of help for you, as I hadn't read all the posts here. But here is the windows batchfile that I use(d): @GOTO START <?php $editor = "C:\\Program Files\\NuSphere\\PhpED\\phped.exe"; if($argc > 1) $url = $argv[1]; list($file, $line) = explode('&line=', str_replace(array('editor://open/?url=file://', ''), '', urldecode($url))); if(is_file($file)) { exec("\"$editor\" \"$file\" --line=$line"); } exit(0); ?> EXIT :START @ECHO OFF SET PHP=C:\php\php.exe %PHP% "%0" %* EXIT Short explanation: the batch script (maybe named something like "tracyopener.bat", located somewhere in the system path) is called with the tracy default params for file & line. the first line tells the win batch interpreter to skip the PHP section and start at the line where the php exe is defined the next line calls the PHP interpreter, passes the own script to it "%0", followed by all other params "%*", what is an alias for %1 - %9 when the PHP interpreter processes the script, the first line is interpreted as HTML or text output and therefor ignored. the next lines get and prepare the passed params for usage with my preferred editor NuSphere PhpEd, using the exec() function.
-
[SOLVED] How to add user and date to an uploaded file?
horst replied to dotnetic's topic in Module/Plugin Development
Hi Jens, what Dragan said, if you can switch & test to PW 3.0.142 with the new implemented images subfields, that would be simple to setup and protect for usernames / ids and modified or uploaded timestamps. But you need to test it in a dev environment first, as it is "brandnew". I believe the best hook for all file and image related things on upload is >before "InputfieldFile::fileAdded" < (https://processwire.com/talk/topic/22252-admin-hook-image-upload-watermark-pim/?tab=comments#comment-190948 -
I build and use one template that is bound to a single page in PW where both are simply named "ajax". I can access it per URL "/ajax/" and use it for everything that needs to send or retrieve data in the background. Here is an example from a project where different forms send data that need to be validated first and then send to final (external) destinations. The client browser optionally gets back HTML like "success messages" or error descriptions. <?php namespace ProcessWire; /*============================================================================== XXXXXXXXXX :: site/templates/ajax.php 2019-07-04 ==============================================================================*/ /******************************************************************************* * * This template file handles form submissions that are raised via AJAX! * * Sanitize, validate, log and submit to final destinations. * * // how the used JS looks like $.ajax({ url : gAjaxUrl, // /ajax/ type : 'POST', async : true, dataType : 'html', // returned data has to be HTML data : submitData, // submitted data object success : function(markup) { if('' != selector) { // a selector string to match the $(selector).html(markup); // markup container } } }); ... * *******************************************************************************/ // only process AJAX calls if(!$config->ajax) return 'WRONG ACCESS METHOD'; // only process POST requests with valid required id if(!$input->post->hidden_id) return 'WRONG ACCESS METHOD'; // ... followed by all project specific validations etc. So, with your example I would check if there is a post value named theme, and if the value is one out of a whitelist of valid theme values: // does this belong to theme selection if($input->post->theme) { $validThemeValues = ['dark', 'light']; if(!in_array($input->post->text('theme'), $validThemeValues)) { header('HTTP/1.1 403 Forbidden'); return; } $session->set('selectedTheme', $input->post->text('theme')); return; } // does this belong to another thing? if($input->post->anotherThing) { // first validate, then process data // ... return; }
- 3 replies
-
- 10
-
-
- $session
- client to server
-
(and 2 more)
Tagged with: