Jump to content

szabesz

Members
  • Posts

    3,015
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by szabesz

  1. Thanks for the tip @Robin S I cannot se how it can be faster than my dead simple solution. Sure, I perform an otherwise useless search but Google is sooo fast With the "keyword search feature", I need to be able to remember the keyword(s). Well, I already use a lot of them in other contexts so I find it hard to memorize more. Next, I need to type the get there. One click in the Bookmarks Bar and another double click to highlight the dummy search word is what I can do quickly without mistakes. Yeah, it's lame but it works for me.
  2. I never use it in production only on my local machine when I need to do a lot of clicking around in the admin without coding. In which case I notice considerable improvement. That's all about my experience with it though. Not to much... BTW, it is more like a discussion for the Dev Talk section, isn't it?
  3. Yeah, we discussed it in PMs. I thought it might have been removed that is why he was looking for it...
  4. https://www.google.hu/search?as_sitesearch=processwire.com%2Fdocs&as_q=profile https://www.google.hu/search?as_sitesearch=processwire.com%2Fblog&as_q=recipe https://www.google.hu/search?as_sitesearch=processwire.com%2Ftalk&as_q=migrate I bookmarked these and update the search word after clicking them and press enter. I know it's crude but it is the fastest way for me
  5. I have it running on my machine. It is based on ProcessWire 2.3.0. I can zip it up for you if you send me a PM. First one is easy to install, second one is not As far as I know they are basically the "same".
  6. @ryanC I understand that you want to learn PHP from ground up but building upon a CMF like ProcessWire has the benefit of a few things: you do not have to reinvent the wheel, you can find plenty of examples in this forum to solve all basic needs and more, when you ask for help others can help you out more easily because you speak the same lingo, so to speak For example: https://processwire.com/talk/topic/407-processing-contact-forms/?do=findComment&comment=36384 Your basic form processes the received data without sanitizing it which is not good. As @adrian pointed out above, you validate the email but discard the validated value afterwards. All in all, a lot should be ironed out before your form can work and be secure but since you are on ProcessWire I recommend seriously considering switching to a code snippet like the one I linked to. You can start by reading up on API variables over here (as an introduction): https://processwire.com/api/variables/ This page is not complete since more has been added but you can find the rest here: https://processwire.com/api/ref/ The PW form example should make more sense after looking up the relevant API variables. If you happen not to understand all the bits you can – of course – use a search engine to find things like: https://stackoverflow.com/questions/3700042/in-php-what-does-represent or ask a question in the relevant forum discussion. You made sure you can send emails with ProcessWire, and now it's time to make sure you also use ProcessWire to build that form. I'm sure you will not regret it
  7. Yep, I'm still on 4.6.20.
  8. It should not matter. I am out of ideas what could cause this. Let's ping @adrian, he is more experienced than me anyway... Hope he can help.
  9. I submitted a request to include it in the core: https://github.com/processwire/processwire-requests/issues/126
  10. Try enabling Mail Interceptor with the Sticky option. Probably I was wrong suggesting that the 'Once' option is ok in this case as it uses AJAX and the actual result should show up as a second row in Tracy's bar. First row displays "No emails sent" but the second row (titled AJAX) should be the intercepted email.
  11. Hi, I have not read the whole thread but I think Ryan's delayed output with all those concatenating stuff is not for everyone, normally I do not use it either. I have a hybrid approach of using all sorts of possibilities which is rather long to explain but maybe one day I have the time to do a write up on it in my own blog. The most important thing is that most of the time I use <?php include __DIR__ . '/../path/to/file.php'; ?> but there is something to keep in mind: http://yagudaev.com/posts/resolving-php-relative-path-problem/ Using PHP's own include() and its variants has the advantage of being able to access all the variables you need during the rendering process without doing much extra "work". It works well for not too "convoluted" frontends. Yet, more sophisticated approaches might be required in other cases but for just starting with ProcessWire you will probably not need more than this for quite a while. Note that PHP is a native template engine, at least Rasmus Lerdorf says so: http://www.tinybutstrong.com/article_3rd_kind.html https://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html I do something similar. Early in the rendering process I implement the "business logic" and store stuff in variables which can be outputted and/or tested later in the native Rasmus's style code part generating the actual output. This way most code editors can auto format, syntax highlight, intellisense, etc... your HTML code. Concatenated code is hard to read to say the least. Some IDEs deal with it well – e.g. PHPStorm (which is not free) – but still...
  12. All three modules for ProcessWire capable of sending via SMTP are just piggy-back on WireMail (we have WireMailPHPMailer too) meaning we need to install and configure them but otherwise the code to send the actual email via WireMail is the same, but the module takes over to do the actual sending. The approach itself should not matter in this regard. I only use WireMailSmtp but probably the other two modules can also specify things like default Sender address and name, extra signatures, headers, valid recipients, etc... Also, by sending via SMTP the email is less likely to land in a spam folder, and in some server environments it is not even possible to send via the default mail() function. Google offers 200 (as far as I can remember) SMTP messages a day, however the webserver itself should be able to send it via SMTP too. Google can be used if the local environment does not send it for some reason.
  13. First of all, I copy/pasted your code and did not notice that you used submit instead of send. It is send. I corrected my post above. I've been using MAMP Pro for a while – MAMP should work the same in this regard – and I can send emails even with PHP's built in mail() function, not just with SMTP. Meaning in my system both work. SMTP should work from your own local machine no matter what (provided it is configured properly, of course). I use WireMailSmtp but Swift Mailer should work too. Note that you can make sure the sending bit of the code works by using @adrian's Tracy Debugger. The Mail Interceptor Panel should be turned on temporarily only (Once or Sticky button), and by pasting the snippet into its Console and running it, it should show the message: $mail = wireMail(); $mail->to('your@mail.com')->from('your@mail.com')->subject('test 1')->body('body 1')->send(); So first of all, make sure you can send emails. If Tracy can catch your mail, it means your code is ok, so you can move forward and set SMPT up if needed. If you get stuck with setting up the SMTP module, you can post questions in the appropriate forum threads.
  14. This one and not just brand new pages. I think it does not really matter what the previous life of the page was if we went to keep it Unpublished. I vote for "save only behavior" so that users new to AOS do not trip over it accidentally just like I do I'm not new to AOS but last time I did not notice that I published the page and it was so for more than a week... Those who are confident enough could switch to the current behavior but that does not include me anymore.
  15. @tpr Morning! I have a question about Save on crtl+s (which is command+s on macOS, BTW): from this morning on I need keep it off as I kept accidentally publishing new pages which should not be published yet, it is because the action is not Save but rather Publish and I got used to it forgetting not to do it when I should not publish the page. So the question is: is it possible take into account the status of the page and do "Save + Keep Unpublished" when it is Unpublished?
  16. Oh yes it is! As I use the admin's login form as a public login form (just redirecting frontend users to another page) it was crucial to change the logo... #logo { display: none; margin-top: 6px; } //replacing the logo: var logo_o = $("#branding #logo"); logo_o.attr("href", "/"); var innerHtml_str = logo_o.html(); var updated_str = innerHtml_str.replace("/wire/modules/AdminTheme/AdminThemeReno/styles/images/", "/site/templates/admin/"); logo_o.html(updated_str); logo_o.show(); //made hidden by display: none; so we need to turn it on. This is to prevent flashing. I hope that's all. I did it some time ago....
  17. In order to change it I used brute force too. Nice to see some in AOS as well
  18. This should send the email: <?php $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); if (isset($_POST['submit'])) { $to = 'myemail@xyz.com'; $subject = 'Feedback from my site'; $message = 'Name: ' . $_POST['name'] . "\r\n\r\n"; $message .='Email: ' . $_POST['email'] . "\r\n\r\n"; $message .='Comments: ' .$_POST['comments']; $mail = wireMail(); $mail->to($to)->from('myemail@xyz.com'); // all calls can be chained $mail->subject($subject); $mail->body($message); $mail->send(); }
  19. The home page has page ID 1, so if($page->id > 1) { echo $page->title .' - '; } means that the page's Title is only prepended to it if it is not the home page. But you remove it altogether so echo $page->title; must spit out the value of the Title field no matter what. In the screenshot I can see that it is a ProcessWire 2.7.3 site. I started with ProcessWire 3.x beta so I'm jut guessing here but probably this feature has been added later. Similar behavior can be achieved with a hook like this: https://github.com/processwire/processwire-requests/issues/124#issuecomment-337139081 and in your case it should look like this: <?php $wire->addHookAfter('InputfieldTextarea::render', function(HookEvent $event) { $inputfield = $event->object; $out = $event->return; if($inputfield->hasField != 'altTitle') return; if(strlen($inputfield->value) > 70) { $alert_text = "The length of this field is greater than 70 characters!"; $event->return = "<p style='color: red;'>$alert_text</p>" . $out; } }); this hook goes into /site/ready.php (if you do not have one just create this PHP file) and it is just a warning, not a validator. Also, the message only appears after saving the page.
  20. PHP's mail() is "just" a simple function one can call. However, WireMail is a class, which means one can use it to instantiate objects (ie. "create instances of it") which can be used to "manage" the action of sending emails. You can read a bit about OOP here, for example. First of all $m = wireMail(); gets an instance of WireMail and stores a reference to it in $m. $m is just a variable, it can be called "anything" (except for reserved words, of course) like $mail but do not confuse the function mail() with the variable $m. Just copy the complete examples provided in the docs or in Ryan's post and adjust it accordingly. For example: $mail = wireMail(); $mail->to('user@hi.com')->from('ryan@runs.pw'); // all calls can be chained $mail->subject('Mail Subject'); $mail->body('Mail Body'); $mail->bodyHTML('<html><body><h1>Mail Body</h1></body></html>'); $mail->send(); That is a simple example which should work.
  21. You need to use that object – $mail – after you have created it. Like this: https://processwire.com/talk/topic/5693-new-module-type-wiremail/ This topic might get you started: https://processwire.com/talk/topic/8753-simple-wiremail-implementation-on-localhost/ But the easiest/fastest way to setup a contact/enquiry/feedback form is using Simple Contact Form module from @justb3a
  22. Hi Bernhard, Modified and Created are the same for new – not yet modified "again" – pages. Does that help? Related post:
  23. Hi, Can you give us an example? I cannot seem to follow... Also, your post seems to be cut off at:
  24. Go to: Setup > Fields > altTitle > Input tab: Did you get an error (if yes, what?) or you just did not see any change in the source code of the page? If the latter, did you make sure you are not watching some sort of cache? (browser, cloudflare, ProCache, ProcessWire cache etc...) I have no experience with this one but if you are still getting cached pages then it is what makes it hard for you to work on any changes. Seeing how much trouble it means to make changes to the site, you might want to ask for some paid help. Have you considered this?
  25. Hi, One solution: for creating Dates setup a PageTable on your single Dates Page, so that Dates are created by adding items in the table. Actual Date Pages are stored under a Parent according to your setup ("Select a parent from items" on the Details tab of PageTable field). From then on, you have a parent which can be used for asmSelects. This can be used for your Settings page. For the Event page, you need to setup "Custom PHP code" for "Selectable pages" under the Input tab of the PageReference inputfield. I've never done this so I'm not the right one to show you a proper example, but this might help you get started:
×
×
  • Create New...