Jump to content

flydev

Members
  • Posts

    1,366
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. Your clients can now download/view the files in the directories. ps: I can't edit my previous post ?
  2. Hello, A solution should be to bootstrap ProcessWire, coding a function which list the all the files in the current directory and subdirectories. Also, writing a custom function give you full control over the listed files, by example, filtering the files by a given allowed extension. You can test the following: In your /test directory, create a file called index.php. In the index.php write the following the code : <?php include("../index.php"); // bootstrap ProcessWire function scanDirectories($dir, $allowext, $recurse = false) { $retval = array(); // add trailing slash if missing if(substr($dir, -1) != "/") $dir .= "/"; // open pointer to directory and read list of files $d = @dir($dir) or die("Error: Failed opening directory $dir for reading."); while(false !== ($entry = $d->read())) { // skip hidden files if($entry[0] == ".") continue; if(is_dir("$dir$entry")) { if($recurse && is_readable("$dir$entry/")) { $retval = array_merge($retval, scanDirectories("$dir$entry/", $allowext, true)); } } elseif(is_readable("$dir$entry")) { $ext = substr($entry, strrpos($entry, '.') + 1); if(in_array($ext, $allowext)) { $retval[] = array( "name" => "$dir$entry", "type" => mime_content_type("$dir$entry"), "size" => filesize("$dir$entry"), "lastmod" => filemtime("$dir$entry") ); } } } $d->close(); return $retval; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Files list</title> <style type="text/css"> body { padding: 5%; max-width: 1260px; margin: 0 auto; } table { width: 100%; border-top: 1px solid #000000; padding: 0; margin: 0; vertical-align: middle; } th, td { text-align: center; border-bottom: 1px solid #000000; border-left: 1px solid #000000; padding: 0; margin: 0; } th:nth-last-child(1), td:nth-last-child(1) { border-right: 1px solid #000000; } </style> </head> <body> <h1>Files list</h1> <?php $rootdir = './'; // root directory $ext = ['jpg', 'png', 'pdf']; // allowed extensions $dirlist = scanDirectories("./", $ext, true); // output file list as HTML table echo "<table cellpadding='0' cellspacing='0'>\n" . "<thead>\n" . "<tr><th></th><th>Name</th><th>Type</th><th>Size</th><th>Last Modified</th></tr>\n" . "</thead>\n" . "<tbody>\n"; foreach($dirlist as $file) { echo "<tr>\n" . "<td><img src='{$file['name']}' width='32'></td>\n" . "<td><a href='{$file['name']}'>". basename($file['name'])."</a></td>\n" . "<td>{$file['type']}</td>\n" . "<td>{$file['size']}</td>\n" . "<td>".date('r', $file['lastmod'])."</td>\n" . "</tr>\n"; } echo "</tbody>\n"; echo "</table>\n\n"; ?> </body> </html> Copy/Upload now some images or files in /test and visit your site at http://mysite/test/ to see the result. @Karl_T code updated.
  3. What are the values of : IdleTimeout ProcessLifeTime FcgidMaxRequestLen FcgidIOTimeout ?
  4. You should really try to read and understand the code of MapMarker. I was in the same situation as you are, and finaly made my own fieldtype very easily. I implemented LeafletJS easily just by reading the comments and the code (and found that the module was already done in the forum lol...). Take this module as tutorial, in this module you can find how to store and get data from. https://github.com/ryancramerdesign/FieldtypeMapMarker/blob/master/FieldtypeMapMarker.module#L142-L199 You will find an example there, and of course by looking at others module's code. Later, for exemple, you will certainly ask what are ___wakeupValue and ___sleepValue, and/or other methods. The step is to go through the forum and search. You will find good topics and hints here and there to understand. Also, you should experiment a bit, try to modify the code/datas, check the DB wih PhpMyAdmin and learn from. You will see your module's table with datas. And do not hesitate to ask help on the forum.
  5. flydev

    Form

    The simple thing we was missing (if not another) is nl2br() - @phippu try : $out .= nl2br($message); You should get your multiline output.
  6. flydev

    Form

    I just tested it by curiosity and can't get output multiline... I think we are missing something simple.
  7. Please show us more details about the error.
  8. Foundation 6 Minimal site profile for ProcessWire This profile is based on the "minimal site profile (intermediate edition)" and bundled with Foundation 6. This precompiled version can be downloaded at github. Features Foundation 6 framework Font-Awesome MeanMenu Slick Carousel (Why not Orbit ?) Render / helper functions for : Simple ul navigation Foundation Multi-level topbar MeanMenu - Responsive menu for mobile device Slick Carousel Foundation Accordion Foundation Callouts Jumbotron Dependencies jQuery How To Install Download the zip file at Github or clone directly the repo with git clone and skip the step 2. Extract the folder site-fdn6-precompiled into a fresh ProcessWire installation root folder. During the installation of ProcessWire, choose the profile "ProcessWire Foundation 6 profile". References Foundation 6 documentation ProcessWire documentation MeanMenu documentation Slick Carousel Documentation Credits The ProcessWire staff Screenshots
  9. just remove the namespace. The code should be : <?php include_once ('./index.php'); // bootstrap try { $mail = wireMail(); $mail->to('someone@domain.com'); $mail->from('root@mydomain.com', 'My Company'); $mail->subject('My subject'); $mail->bodyHTML('My message body'); $mail->send(); } catch(Exception $ex) { echo $ex->getMessage(); } Does it work ?
  10. Could you tell us which version of ProcessWire you are using please ?
  11. Hi, You could do something like that, assuming you are on PW-3. Create a file called testwiremail.php in the root directory and add the following code : <?php namespace ProcessWire; include_once ('./index.php'); // bootstrap try { $mail = wireMail(); $mail->to('someone@domain.com'); $mail->from('root@mydomain.com', 'My Company'); $mail->subject('My subject'); $mail->bodyHTML('My message body'); $mail->send(); } catch(\Exception $ex) { echo $ex->getMessage(); } Now you can navigate to http://mydomain.com/testwiremail.php
  12. For reference there is a nice blog post about it : https://processwire.com/blog/posts/front-end-editing-now-in-processwire-3.0-alpha-4/
  13. You might use a simple code which check the HTTP_ACCEPT_LANGUAGE server variable like the following snippet : <?php $userLocale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']); switch ($userLocale){ case "de": // deusth $session->redirect("http://de.mydomain.com"); break; case "en": // english $session->redirect("http://en.mydomain.com"); break; case "fr": // french $session->redirect("http://fr.mydomain.com"); break; default: // default locale/page : english $session->redirect("http://en.mydomain.com"); break; }
  14. You should use clearAddresses() before sending the second email : [...] if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!<br>Sending an email to the submitted email from user...<br>"; // clear addresses $mail->clearAddresses(); //Set who the message is to be sent to $mail->addAddress($field3, 'Bob'); $mail->Subject = 'Thanks for contacting us | sent once'; $mail->Body .= "Thanks for contacting us at our Site."; // send email $mail->send(); } This should do the work.
  15. So we could build some profiles based on a supported frameworks - ie: uiKit here - bundled with the module and play with it directly from PW ? oh and WOW !
  16. On the Firefox troubleshooting page, they say that if the problem only occure on certain website, it can be a problem with the firefox's cache. Did you try to clear cache and cookies ?
  17. Hi sekru, Do you have the possibility to test - maybe on a local dev server - another version of PHP ? I try to reproduce your issue without success. The repeater with an image field inside work as expected on PW-3.0.22 / PHP 5.5. I will try later on a PHP-7 version as I dont have any dev server at this moment..
  18. On mobile device a typo exist just above the avatar, or is normal ? it's a bit troubling. Note the 1 dy - instead of 1 day (?)
  19. I would like to say that it depend on the SSL certificate issuer and the type of certificate you buy from. For example, if you buy a Wildcard security certificate (which can be more expensive too), it will extend security to multiple subdomains based on your main domain name. In your case, for a wildcard certificate, the common name (CN field in the CSR) will be *.example.com and will be valid for "www.example.com" and "example.com", "shop.example.com", "secure.example.com" and so on. If you want some examples for server configuration, please let us know which type of server you are running on. Also, you can start playing with certificate and configuration using a free certificate from StartSSL.
  20. A non constructive answer here but just my opinion. I LIKE THE NEW FORUM - thanks for the good work !
  21. Thanks you for trying this profile. I just pushed an update to the css for the responsive menu. Just remove the following code in main.css.
  22. You are right. I thought while I was writting .
  23. What about making a new PHPMailer object in the success statement block and send a new email with the informations the user has submited ? Example: [...] else { echo 'Message has been sent.'; // create a new PHPMailer object $mail = new PHPMailer(); $mail->From = "email@domain.com"; $mail->FromName = "Contact"; // add the address user $mail->AddAddress($field3); $mail->Subject = "Thanks for contacting us"; $mail->Body = "Thanks for contacting us at our Site." $mail->send(); } For information, there is a new PHPMailer module available and also WireMailSmtp.
  24. I made a precompiled edition, here you go : https://github.com/flydev-fr/site-pwbs4/archive/precompiled.zip The installation process is the same, but no command-line or external tools required.
  25. Hello, Have you followed the step 4 ? After you uploaded the files, you have to modifiy your code manualy for each file's reference (css / js / font) in your templates. If you dont have any templates then you should at least create one and use it for every page (I mean the basic-page template for example found in the default installation) then create the pages tree. --- I think you should watch this video made by Philipp:
×
×
  • Create New...