Jump to content

MatthewSchenker

PW-Moderators
  • Posts

    677
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by MatthewSchenker

  1. Greetings, As far as my experince goes, this is true. I use various date calls all the time in my ProcessWire sites, mixing ProcessWire and good old PHP to get what I need. To add one more link to kongondo's list, Ryan and I posted a bit on this here: http://processwire.com/talk/topic/2600-datetime-field-issue-with-dev/?p=25648 Thanks, Matthew
  2. Greetings, This general idea of linking a framework with ProcessWire is interesting. Before I started using ProcessWire, I used CodeIgniter mostly, and was starting to get into Laravel. More recently, I have gained greatest respect for Yii. All of my development work is in ProcessWire these days. But I'm curious -- what are your goals are for linking ProcessWire with Yii? What can you accomplish by combining the powers of each one? There are already a couple of discussions on this topic, but again, I wonder if maybe we need one where we just look at PW/framework partnering? Thans, Matthew
  3. Greetings, Excellent interview! Ryan comes across as brilliant and extremely likeable -- which we all know is a true portrait. Thanks, Matthew
  4. Greetings, No problem! Of course, there are also lots of JQuery plugins that will also work. I just prefer to use straight JS if I can. Let me know if there are other parts of the site I can describe. This project is being reviewed in presentations. I am planning to expand the project in response to feedback over the next few weeks. I will be building an "educators" section. Also, I will be creating a front-end interface for managing the site. I'll report back on all this soon. I also want to emphasize how wonderful it is to use ProcessWire for this kind of site. It is so natural to tie into good PHP/JS practices, I can give the client complete control of the system, and whenever necessary I can jump in to make improvements to the site with clean code. Thanks, Matthew
  5. Greetings, Those Gists by Soma are nice and clear. Between those and some other discussions here, you have two methods illustrated for doing front-end forms: (1) using PocessWire's Inputfield modules; (2) using regular HTML form fields. Both work well. Thanks, Matthew
  6. Greetings, I will check out the online gaming sources. Although, I'm a bit intimidated by the numbers some of you are posting here! I'll just have to dive in and see where I stand. Thanks for the suggestions, Matthew
  7. Greetings, I am preparing another forum post about different ways to deal with duplicate titles in front-end forms. But in the meantime... What about appending the date/time onto the titles? That would ensure unique titles, and give you useful information right in the title. Of course, this would only be good in cases where you are not going to display the page to the public (which is the case here). Thanks, Matthew
  8. Greetings, We can really have fun with this. How about giving more weight to posts when the posts... - Contain <code> tags - Receive "likes" from people who have more likes than you - Receive "likes" from people who have been members longer than you - Appear in certain boards (for example, "API & Coding," rather than "Pub") Thanks, Matthew
  9. Greetings, There is also some luck involved. I have seen many posts where someone really spends some time giving a great answer to someone's question, but does not receive a "like" from the person who started the discussion. Maybe we need to factor in how many times the words "thank you" appear right next to someone's name in a post, and encourage everyone to hit that "like" button if someone really helped you out! Thanks, Matthew
  10. Gretings, As a test, I just removed the "unlink" from one of my foreach loops, but left it in the other one. It seems to work as expected. If I have "unlink" at the end of the loop, the files are removed; if I don't include it, the files are not removed. It's strange that it isn't working for you. I actually am wondering whether in some cases it might be a good idea to keep the temporary files? In those situations, I'm considering building a new sub-folder in the temp directory for each page -- maybe auto-create it based on the page ID? Thanks, Matthew
  11. Greetings, Funny! No, we mean this... Thanks, Matthew
  12. Greetings, Only saw this post today, after reading an (unrelated) discussion -> http://processwire.com/talk/topic/4044-forum-likes-and-posts-and-the-top-list/ Go is great! I have been trying to master it for years. Thanks, Matthew
  13. Soma, I play Go, and have been working at it for years! The difficulty is in finding other people with the patience to play. I agree with the idea of doing more than just a straight "like count." There should be some reflection of the "like proportions." Another matter to consider is what I would call "like density." Does the user get likes from many different users, or does he/she have a smaller number of people who "like" him/her? Thanks, Matthew
  14. Greetings, When I started this discussion, my goal was to pull together various renditions of code that were being discussed in forum discussions and create a single full example people can use to make front-end page submissions, and to also do this with photos. This is a vital part of building the kinds of sites that are really exciting with ProcessWire. I have now used the techniques detailed in this discussion for several projects, including one where I am building a completely custom front-end interface with page submission and page editing (more on that soon). In my first post in this discussion, I have the "unlink($pathname)" included in the routine. This removes the temporary image. Horst makes reference to the same code posted by Ryan. HANDLING MULTIPLE FILE-UPLOAD FIELDS IN THE SAME FORM Since starting this discussion, I have also added multiple file uploads in the same form. The steps are pretty easy. Below is my original code from post #1, with additional code for a second file-upload field (indicated with "[NEW CODE]"): <?php// First, confirm that a submission has been made if($input->post->contactname) { // Set a temporary upload location where the submitted files are stored during form processing $upload_path = $config->paths->assets . "files/contact_files/"; // New wire upload $contact_photo = new WireUpload('contact_photo'); // Reference field name in HTML form that uploads photos $contact_photo->setMaxFiles(5); $contact_photo->setOverwrite(false); $contact_photo->setDestinationPath($upload_path); $contact_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // Second wire upload (other_photos) [NEW CODE] $other_photos = new WireUpload('other_photos'); // Reference field name in HTML form that uploads photos $other_photos->setMaxFiles(10); // Allow 10 other photos $other_photos->setOverwrite(false); // Use the temporary location set above $other_photos->setDestinationPath($upload_path); $other_photos->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files = $contact_photo->execute(); $other_files = $other_photos->execute(); // [NEW CODE] // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors() if(!count($files)) { $contact_photo->error("Sorry, but you need to add a photo!"); return false; } // Set up submissions in the ProcessWire page tree $np = new Page(); // create new page object $np->template = $templates->get("contact_submission"); // Set template for pages created from form submissions $np->parent = $pages->get("/customer-service/contact-us/contact-submission-listing/"); // Set parent for pages created from form submissions // Send form submissions through ProcessWire sanitization and apply each to a template field for the new page $np->of(false); $np->title = $sanitizer->text($input->post->contactname); $np->name = $np->title; $np->contactname = $sanitizer->text($input->post->contactname); $np->email = $sanitizer->email($input->post->email); $np->comments = $sanitizer->textarea($input->post->comments); $np->save(); // Run photo upload for "contact_photo" foreach($files as $filename) { $pathname = $upload_path . $filename; $np->contact_photo->add($pathname); $np->message("Added file: $filename"); unlink($pathname); } // Run photo upload for "other_photos" [NEW CODE] foreach($other_files as $other_file) { $pathname = $upload_path . $other_file; $np->other_photos->add($pathname); $np->message("Added file: $other_file"); unlink($pathname); } // Save page again $np->save(); ?> <p>Thank you for your contact information.</p> <?php return true; } else { ?> <p> Sorry, your photo upload was not successful...</P> <?php} ?> And here is the updated submission form that would connect with the above code: <form action="/customer-service/contact/contact-success/" method="post" enctype="multipart/form-data"> <p><label for="contactname">Name:</label></p> <p><input type="text" name="contactname"></p> <p><label for="email">E-Mail:</label></p> <p><input type="email" name="email"></p> <p><label for="comments">Comments:</label></p> <p><textarea name="comments" cols="25" rows="6"></textarea></p> <p>Click the "Select Files" button below to upload your photo.</p> <input type="file" name="contact_photo" /> <input type="file" name="other_photos[]" multiple /> <button type="submit">Submit</button> </form> Points to keep in mind: 1. Add a WireUpload action for each photo-upload field, setting the rules for each one. 2. Add a separate "execute" action for each photo-upload field. 3. Add a separate foreach loop for each photo field you need. 4. If the file-upload field is for multiple files, make sure that the setMaxFiles() action matches what you set in the admin panel for that field. 5. In your form, if the file-upload field is for multiple files, specify the name with square brackets, and add the "multiple" designation. Thanks, Matthew
  15. Greetings, I have been following this discussion -- an excellent example of a case study with highlights of how to accomplish several key goals in ProcessWire. This last post highlights a couple of interesting points for me: 1. Emphasizes the advantage of having everything exist as a page in ProcessWire (in this case, tags). 2. How easy it is to use the API to implement functions that take care of major actions in ProcessWire. 3. How to migrate an existing CMS to ProcessWire. Might be dangerous if more people in the WordPress community knew about it! Regarding 3: I come from the Joomla world. It seems that WordPress databases are more logical than Joomla databases. I think the migrate script for Joomla would be much more involved because simple "page" data is very fragmented in that CMS. But the same principles would apply. As always, a very illuminating discussion! Thanks, Matthew
  16. Greetings, Very interesting. I have been on the fence regarding CSS/JS frameworks for some time (experimenting but never full adopting them), but Foundation has been the one I like the best. I just have not felt sufficiently motivated to stop using my own code. And yet, I understand that it might be best to just start using a framework. With your new profile, it might make the jump even easier! I look forward to giving this a try, and I will report back on my experiences. Ryan -- THANK YOU so much for all your tremendous work, creativity, and endless generosity. Thanks, Matthew
  17. Greetings, Sorry for the delayed response... I build tabs as often as possible using straight Javascript. It allows me to easily style the tabs. It works great in ProcessWire using some of our favorite selectors. Here is the layout code in my template for the film pages: <div id="tab_container"> <div id="tab_box"> <ul id="tab_headings"> <li><a id="tab1">About</a></li> <li><a id="tab2">Discussion Questions</a></li> </ul> <div class="individual_tabs_container" id="tab1C"> <?php echo $page->tab_heading; ?> <?php echo $page->about_tab_text; ?> </div> <div class="individual_tabs_container" id="tab2C"> <?php echo $page->discussion_tab_text; ?> </div> </div> <!-- /tab_box --> </div> <!-- /tab_container --> Here is the Javascript that fires up the tabs, which you just need to place after the layout code above: <script> $(document).ready(function() { $('#tab_headings li a:not(:first)').addClass('inactive'); $('.individual_tabs_container').hide(); $('.individual_tabs_container:first').show(); $('#tab_headings li a').click(function(){ var t = $(this).attr('id'); if($(this).hasClass('inactive')){ $('#tab_headings li a').addClass('inactive'); $(this).removeClass('inactive'); $('.individual_tabs_container').hide(); $('#'+ t + 'C').fadeIn('slow'); } }); }); </script> Finally, here is the CSS for the tabs: #tab_container { /* Full-width container holding the tabs element */ margin-top: 61px; display: inline; float: left; width: 100%; } #tab_box { /* Box containing tabs element, inside tab_container */ margin-left: 10%; display: inline; float: left; width: 80%; } #tab_headings { /* Unordered list that forms the tab headings */ width: 100%; height: 33px; margin: 10px 0 0 0; } #tab_headings li { /* Text of the tab headings */ float: left; text-align: center; width: 33%; height: 33px; } #tab_headings li a { /* Active tab */ cursor: pointer; font-size: 1em; font-weight: bold; color: #fff; padding: 8px 0 9px 0; display: block; background: #00698C; } #tab_headings li a.inactive { /* Inactive tab(s) */ padding: 8px 0 9px 0; color: #999; background: #888; text-align: center; } #tab_headings li a:hover, #tab_headings li a.inactive:hover { /* Hover effects of the tab headings */ color: #A40000; } .individual_tabs_container { /* DIVs holding actual content that appears when you click on a tab */ clear: both; width: 100%; text-align: left; padding: 20px 0 20px 0; background: #666666; } .individual_tabs_container h2 { /* <h2> inside individual tab areas (you can change <h2> to any element you want styled) */ margin: 10px 15px 10px 15px; color: #5685bc; font-size: 1.5em; } .individual_tabs_container p { /* <p> text inside individual tab areas (you can change <p> to any element you want styled) */ margin: 10px 15px 10px 15px; line-height: 1.3em; color: #f6f6f6; } .individual_tabs_container ol li { /* Ordered list in discussion questions tab (you can change this as needed) */ list-style-type: decimal; list-style-position: inside; margin: 0 15px 10px 30px; text-indent: -1.3em; color: #fff; } Play with the styles to get the color scheme or sizing you want. The only part that can be tricky is making sure to do the math right for the tab borders. Feel free to post follow-up questions. I'm always happy to help! Thanks, Matthew
  18. Greetings Horst. Beautiful photos! You obviously have talent, and the imagery in your web site does a great job of showing your skills. I like the way you introduce the various themes for your work. I have some small comments, which may follow some of what has been said here already: 1. Perhaps add more direct mentions of your themes on the home page? 2. The home page slider should perhaps identify the theme of each of the slideshow images. 3. The home page slider does not "light up" the disk of the current image. 4. The galleries load extremely slowly. Sometimes, images scroll to the next one before they load. 5. It would be great to have some brief statements in writing from you in key places throughout the site -- just a bit more of who you are or what is behind the work we are looking at. My comments come from viewing the site with Safari and Chrome on an iPad 3. I will take a look from desktop later. Thanks for sharing, Matthew
  19. Greetings, Soma! I didn't know this was possible... Thanks for pointing this out. Just another example of how, with ProcessWire, you just need to ask the question to get a (great) answer. Thanks, Matthew
  20. Greetings, What exactly do you want to output? Which pages/fields/data? You have to be more specific. Thanks, Matthew
  21. Greetings, I felt a needle-like pain in my head, and wondered where it was coming from... Ah, there it is -- Joomla and Artio. All jokes aside, it is true that in Joomla there are ready-made components that take care of a whole range of actions. But then you have to override what you don't want or need, wage mortal battles where various pieces of baked-in Joomla code conflict with your modules and plugins, and spend hours trying to get a developer's attention long enough to figure out where in the world they placed the code for a particular action you need to customize, and why they put it there. And let's not forget that no Joomla component can be used without... Joomla! Which means you are also inheriting its migraine-inducing template system, admin area, lack of custom fields, mind-numbing dummy menu entries and plugin ordering (Joomla people will know what I mean by these last two). OK, let me take a breath... I understand the idea of using something that has "been done already." But since I started using ProcessWire, in all seriousness, it takes me less time to create something from scratch than to wrangle with any of Joomla's "ready-made" code. Two better ways to go: 1. Get part-by-part help from the community 2. Find ready-made JQuery, PHP, and other components that can hook into ProcessWire Thanks, Matthew
  22. Greetings, Just an idea... If you are building front-end forms using the ProcessWire API, you could pull in an external library. I've started using Zebra Form lately, which has a great API for building the forms and doing client- and server-side validations. I really like it. Here's a link: http://stefangabos.ro/php-libraries/zebra-form/ Thanks, Matthew
  23. Greetings, There is no "member module" per se. I'm not sure it would be feasible (or even desirable) to create a membership module, because it would be making assumptions about how you want to do things. What each site needs and how it interprets "membership" is pretty wide ranging. With that said, I'm sure that a variety of existing modules can each help with a part of the overall membership plan. Then there will be parts you will need to code. The better approach would be if you described each of the individual membership goals you have, and then people can help you develop each part of the overall solution. Try that and you will be pleasantly surprised how quickly you get answers! Thanks, Matthew
  24. Greetings, If you want complete flexibility from any formatting, you can just create forms any way you want and run through the ProcessWire API to actually make pages. Soma has posted a lot of examples of this, and I started a discussion on it also (with additional details for file uploads). I use this all the time: http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/ More recently, I have been experimenting with Zebra forms, which allows very nice validations on forms and works nicely with the ProcessWire API. Thanks, Matthew
  25. Greetings, Yes, I agree. I have not used CodeIgniter or Laravel for new projects since I started using ProcessWire. Each of the PHP frameworks has some pieces that are useful. Actually, Laravel is now essentially a conglomerate of other libraries. But I really believe that as a whole system, the ProcessWire framework is better. It's not a pressing issue for me. But I wonder where sharing libraries will allow us to benefit from some existing options, while being happy with the very strong and "expressive" syntax of the core ProcessWire framework. Thanks, Matthew
×
×
  • Create New...