Jump to content

flydev

Members
  • Posts

    1,339
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by flydev

  1. You can make your own array and pass it as an argument to the render() method. A short snippet exemple for your need : $website = ""; $options = array('headline' => '<h2>Einträge</h2>'); if (strlen($website)<=0) { $temp = array('commentHeader' => 'Geschrieben von {cite} am {created}'); } else { $temp = array('commentHeader' => 'Geschrieben von <a href="{website}">{cite}</a> am {created}'); } $options = array_merge($options, $temp); $temp = array( 'dateFormat' => 'd/m/Y', 'encoding' => 'UTF-8', 'admin' => false ); $options = array_merge($options, $temp); echo $page->guestbook->render($options); // argument as Array()
  2. Until you find the particular topic, there are two modules which can help protecting/hiding content : http://modules.processwire.com/modules/page-protector/ http://modules.processwire.com/modules/protected-mode/
  3. Same result, I already tested it when LostKobrakai answered. On both version I dont get any value if a redirect is triggered.
  4. Just tested your code under PW 2.7 and 3, I can't get it working on both version with the line $session->redirect(basename(__FILE__)); Commenting the line, it show the integer (value 1) on both version.
  5. Maybe a dumb question, but do you have the directive AllowOverride None in your setting ?
  6. I run my PW websites on PHP 5.6 and I have not encountered any issue during installation. (somes migrated from php-5.5). Can you give us any server log error ? Also, I suggest you to double check the PHP extensions between your two severs.
  7. A bootstrap 4 alpha version exemple with navbar and dropdown : <nav class="navbar navbar-dark bg-primary bg-faded"> <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2"> ☰ </button> <div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2"> <a class="navbar-brand" href="#">Responsive navbar</a> <ul class="nav navbar-nav"> <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item dropdown"> <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Languages <span class="caret"></span></a> <ul class="dropdown-menu"> <h6 class="dropdown-header">Dropdown header</h6> <?php foreach($languages as $language) { // determine the "local" URL for this language $url = $page->localUrl($language); // output echo "<li><a class='dropdown-item' href='{$url}'>{$language->title}</a></li>"; } ?> </ul> </li> </ul> </div> </nav>
  8. As szabesz said, everything will work. Until you do not hardcode your urls but use the API, all good.
  9. Hello and welcome theo. I think that your best bet would be a subdirectory. You create your directory, upload processwire and the important step to get it working is to modify your .htaccess. What the documention say about that : If you installed ProcessWire in an subdir you have to adjust the RewriteBase to it. So for example if your installation lays in a folder called "pw" (your URL woud look like "http://yoursite.com/pw/") your RewriteBase should look like the following: RewriteBase /pw/ More info there : https://processwire.com/docs/tutorials/troubleshooting-guide/page3
  10. A simple call with the right option should do the trick : $(document).ready(function(){ var popup = new Foundation.Reveal($('#myModal')); popup.open(); }); the docs : http://foundation.zurb.com/sites/docs/reveal.html
  11. This is just a directive. You can include the code without any issue. [doc]
  12. Hello, you might look at this module for the login thing : https://processwire.com/talk/topic/8387-page-protector and some snippets code there: https://processwire.com/talk/topic/107-custom-login/
  13. Cool ! but... I forgot the following line in step 3, class hnsmtp; In the constructor we need to add $this->emailMessage->smtp_certificate = $this->smtp_certificate; I edited my previous post containing the instructions. Nice module and thanks for the update, I tested it right now and it work like a charm!
  14. The possibility to manage clients without their credentials is very exciting. I will give a try today. thanks @diogo
  15. Bumping an old topic but I have the exact same question. Their control panel can be set to english ?
  16. A small contribution: Add an option to have ability to use Self-Signed Certificate on a given SMTP server with WireMailSmtp and PHP >= 5.6 What PHP say - source : https://secure.php.net/manual/en/migration56.openssl.php HOWTO: ----------- 1) In file smtp.php, class smtp_class, we add a member variable and a small function : /* Allow self signed certificate */ var $smtp_certificate = false; Function AllowSelfSignedCertificate($allow = false) { $version=explode(".",function_exists("phpversion") ? phpversion() : "3.0.7"); $php_version=intval($version[0])*1000000+intval($version[1])*1000+intval($version[2]); if($php_version<5006000) return; if($allow) { stream_context_set_option($this->connection, 'ssl', 'verify_peer', false); stream_context_set_option($this->connection, 'ssl', 'allow_self_signed', true); } else { stream_context_set_option($this->connection, 'ssl', 'verify_peer', true); stream_context_set_option($this->connection, 'ssl', 'allow_self_signed', false); } } and, in the Connect() method, call the function just in before we check for the result of stream_socket_enable_crypto : Find : $this->OutputDebug('Starting TLS cryptograpic protocol'); if(!($success = stream_socket_enable_crypto($this->connection, 1, STREAM_CRYPTO_METHOD_TLS_CLIENT))) Replace to $this->OutputDebug('Starting TLS cryptograpic protocol'); $this->AllowSelfSignedCertificate($this->smtp_certificate); if(!($success = stream_socket_enable_crypto($this->connection, 1, STREAM_CRYPTO_METHOD_TLS_CLIENT)) 2) In the file smtp_message.php, class smtp_message_class, add a member variable : /* Allow Self Signed Certificate */ var $smtp_certificate = 0; In the method StartSendingMessage() , assign the new member variable: $this->smtp->smtp_certificate = $this->smtp_certificate; 3) In the file WireMailSmtpAdaptator, class hnsmtp, add a member variable : private $smtp_certificate = false; and in the method set_var_val(), add a case smtp_certificate for our checkbox : Find : case 'smtp_ssl': case 'smtp_start_tls': case 'smtp_debug': case 'smtp_html_debug': Replace : case 'smtp_certificate': case 'smtp_ssl': case 'smtp_start_tls': case 'smtp_debug': case 'smtp_html_debug': In the class constructor, add : $this->emailMessage->smtp_certificate = $this->smtp_certificate; 4) In the WireMailSmtpConfig.php file, add a field : add : $field = $modules->get('InputfieldCheckbox'); $field->attr('name', 'smtp_certificate'); $field->label = __('PHP >= 5.6 - Allow self signed certificate'); $field->attr('value', $data['smtp_certificate']); $field->attr('checked', $data['smtp_certificate'] ? 'checked' : ''); $fieldset->add($field); 5) In the WireMailSmtp.module file, add a settings to the getDefaultdata() : Find : 'valid_recipients' => '' // email addresses of valid recipients. String that we convert to array at runtime. Add after (take care of comma ','): 'smtp_certificate' => 0 // allow or not self signed certificate (PHP >= 5.6) Result : Hope it help. Sorry for my english
  17. We are all falling in love with PW good luck dude
  18. and giving the option dateFormat directly to the function, it works for you ? exemple: $page->comments->renderAll(array('dateFormat' => 'm/d/y g:ia',));
  19. About The exception Invalid email address (processwire@localhost); She is triggered when we leave empty the configuration field "Notifications From Email". Just finished to give a try at your solution (with PW3) and everything work fine. No idea about formatting the time output atm. Have you tried editing your field in the configuration page ? It say :
  20. I was trying to reproduce @Zahari issue but I ran into another problem with email settings, I got an exception : Exception: Invalid email address (processwire@localhost) (in \pw\wire\core\WireMail.php line 81) WireMailSmtp is installed and correctly configured. Any idea ?
  21. Thanks you guys I got it. Elegant solution there
  22. Hello, I have a PHP script being called by AJAX request. At this moment everything work perfectly, but my script is in the root directory, bootstraping PW. request = $.post('/public_html/pw/contactus.php', serializedData); My question is, it is possible to put this PHP script in my templates directory and call it from there ? (if I hardcode the path I get a 403 HTTP error and doing that can cause problem between dev environment and production); How I should code my path in the Javascript code ?
  23. I am just finishing a new website with PW and Bootstrap v4 alpha and it work very well. Uikit could be the best alternative imo.
×
×
  • Create New...